Your AI-powered shell command generator. Describe what you want to do in plain English, and I'll give you the exact command. No more memorizing obscure flags or searching through man pages.
Just describe what you need in plain English and get the exact command.
Choose from OpenAI, Anthropic (Claude), Google Gemini, or xAI (Grok).
Works seamlessly on Windows, macOS, and Linux.
Automatically detects your OS and shell for accurate commands.
Get several command alternatives to choose from.
Commands are clearly marked as low, medium, or high risk.
Prerequisites: Node.js 18 or higher and npm.
# Clone the repository
git clone https://github.com/domzilla/clai
cd clai
# Install dependencies
npm install
# Build the project
npm run build
# Link globally to use from anywhere
npm link
After installation, run clai for the first time and the setup wizard will guide you through configuring your AI provider.
# First run will prompt for API key setup
clai "list all files larger than 100MB"
The setup wizard will guide you through:
# Generate a command from a description
clai "find all duplicate files in current directory"
# Use a specific provider
clai -p anthropic "compress all images in this folder"
# Use a specific model
clai -m gpt-4.1 "show disk usage by folder"
# Get more command options (default is 3)
clai -n 5 "list running processes sorted by memory"
# Verbose mode - show detailed explanations
clai -v "set up a git pre-commit hook"
# Quiet mode - output command only, no interactive menu
clai -q "count lines of code"
| Option | Description |
|---|---|
-m, --model <model> |
Override the default AI model |
-p, --provider <provider> |
Override the default AI provider |
-n, --count <number> |
Number of command options to generate |
-v, --verbose |
Show detailed command explanations |
-q, --quiet |
Output only the command (no menu) |
--raw |
Output raw LLM response (for debugging) |
| Provider | Default Model |
|---|---|
| OpenAI | gpt-4.1-mini |
| Anthropic | claude-sonnet-4-5 |
| Google Gemini | gemini-2.5-flash |
| xAI (Grok) | grok-4 |
Models are fetched dynamically from provider APIs when possible, with fallback to a curated list.
For the ultimate experience, set up shell integration. This lets you type a description directly in your terminal and press a key to transform it into a command.
list files by sizeAlt+aEnter to run it# Auto-detect your shell
clai shell
# Or specify a shell
clai shell zsh
clai shell bash
clai shell fish
clai shell powershell
clai "rename all .jpeg files to .jpg"
clai "find files modified in the last 24 hours"
clai "delete all node_modules folders recursively"
clai "compress this folder into a zip file"
clai "show top 10 processes by CPU usage"
clai "display disk space usage"
clai "list all open network ports"
clai "find which process is using port 3000"
clai "undo the last commit but keep changes"
clai "show commits from last week"
clai "create a branch from a specific commit"
clai "squash the last 3 commits"
clai "count occurrences of 'error' in all log files"
clai "replace tabs with spaces in all .py files"
clai "extract email addresses from a file"
clai "sort a CSV file by the second column"
Every generated command includes a risk indicator:
| Risk | Description | Examples |
|---|---|---|
| Low | Read-only operations, safe to run | ls, cat, grep |
| Medium | Creates or modifies files | mkdir, touch, chmod |
| High | Potentially destructive | rm, rm -rf, sudo |
For high-risk commands, clai prefers safer alternatives when possible.