English | 中文
A zsh plugin that turns natural language into shell commands using local AI (Ollama / LM Studio).
Type what you want in plain language — get an executable command back. No cloud, no API keys, everything runs locally.
zsh,curl,jq- Ollama or LM Studio running locally
- Recommended model:
qwen2.5-coder:3b— fast, lightweight, good at shell command generationollama pull qwen2.5-coder:3b
Agent Install: Give this URL to your coding agent and it will handle everything automatically:
https://raw.githubusercontent.com/chaodongzhang/AutoBashCMD/main/INSTALL_GUIDE.md
Manual Install:
git clone https://github.com/chaodongzhang/AutoBashCMD.git ~/.AutoBashCMDAdd to your ~/.zshrc:
source ~/.AutoBashCMD/shell/autobashcmd.zshThen reload:
source ~/.zshrcai list all files in the current directory
ai find the process using port 3000
ai compress this folder into a zipOutputs the command only. Does not execute.
airun delete all .log filesShows the command first, press Enter to run or any other key to cancel. Dangerous commands (e.g. rm, sudo) require typing yes.
aiexplain grep -rn
aiexplain what does chmod 755 meanJust type naturally — if the input looks like natural language (contains non-ASCII characters), it auto-routes through airun:
列出当前目录下的文件
进入 src 目录
找出占用 3000 端口的进程Help queries also work directly:
ls这个命令如何使用
介绍一下 grep| Variable | Default | Description |
|---|---|---|
SHELL_AI_BACKEND |
ollama |
ollama or lmstudio |
SHELL_AI_MODEL |
qwen2.5-coder:3b |
Model for command generation |
SHELL_AI_TEXT_MODEL |
same as MODEL | Model for help/explain |
SHELL_AI_DEBUG |
unset | Set to 1 for debug output |
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama API endpoint |
LMSTUDIO_BASE_URL |
http://127.0.0.1:1234/v1 |
LM Studio API endpoint |
# Use LM Studio
export SHELL_AI_BACKEND=lmstudio
export SHELL_AI_MODEL=qwen3.5-9b-mlx
# Back to Ollama
export SHELL_AI_BACKEND=ollama
export SHELL_AI_MODEL=qwen2.5-coder:3b- Local fast-path: Common requests (directory listing, CPU usage, etc.) map directly to commands — no AI call needed.
- Intent classification: The model classifies input as
command,cd,help, orreject. - Dispatch: Each intent routes to the appropriate handler — command generation, directory resolution, help text, or rejection.
- Validation: Generated commands are syntax-checked (
zsh -n) and verified (whence). Invalid output triggers one retry with a correction prompt. - Safety: Risky commands (
rm,sudo,dd, etc.) require explicit confirmation.
MIT