AI-powered shell command generator. Describe what you want to do in natural language, get the command.
npm install -g ai-shell-cmdai-shell "find all JS files larger than 1MB"
# $ find . -name "*.js" -size +1M
ai-shell "compress this directory into a tar.gz"
# $ tar -czf archive.tar.gz .
ai-shell "show disk usage sorted by size"
# $ du -sh * | sort -rh
ai-shell "kill the process on port 3000"
# $ lsof -ti:3000 | xargs kill- You describe what you want in plain English
- AI generates the exact shell command
- You review and confirm (or edit) before executing
$ ai-shell "list docker containers with their sizes"
$ docker ps -as --format "table {{.Names}}\t{{.Size}}\t{{.Status}}"
Run this command? [Y/n/e(dit)]
| Provider | Models | Setup |
|---|---|---|
| OpenAI (default) | gpt-4o-mini, gpt-4o | ai-shell config --openai-key sk-... |
| Anthropic | Claude Haiku, Sonnet | ai-shell config --anthropic-key sk-ant-... |
| Ollama (local) | llama3.2, codellama | ai-shell config --provider ollama |
ai-shell config # Show config
ai-shell config --provider anthropic # Switch provider
ai-shell config --model gpt-4o # Set model
ai-shell config --openai-key sk-xxx # Set API key
ai-shell config --ollama-host http://... # Set Ollama URLConfig stored at ~/.ai-shell.json.
| Flag | Description |
|---|---|
--explain |
Also explain what the command does |
--no-confirm |
Execute without confirmation prompt |
- Natural language to shell commands
- Interactive confirmation before execution
- Edit command before running
- Multiple AI providers (OpenAI, Anthropic, Ollama)
- OS and shell-aware (adapts commands to your system)
- Zero dependencies (pure Node.js + curl)
MIT