A minimal ZSH widget that lets you press Ctrl+G, type a natural language request, and get an AI-generated shell command inserted directly into your command line. Pure ZSH + curl + jq + gum, powered by Groq to make that experience as fast as possible. It also recognizes the current OS, shell as well as some popular CLI tools like rg, fd, bat, eza, fzf, and many more!
zshcurljqgum- A Groq API key
-
Clone the repository:
git clone https://github.com/your-user/commander.git ~/.commander -
Add to your
.zshrc:export GROQ_API_KEY="your-api-key-here" source ~/.commander/plugin.zsh
-
Reload your shell:
source ~/.zshrc
- Press Ctrl+G - an
ai>prompt appears below your current prompt - Type a natural language request (e.g. "find all TODO comments in this directory")
- Press Enter to submit - the AI-generated command is placed into your buffer
- Press Ctrl+C or Ctrl+G to abort
- Review the command, edit if needed, then press Enter to execute
The input prompt is powered by gum, so it renders cleanly below your shell prompt without interfering with ZSH syntax highlighting or autosuggestions.
| Variable | Default | Description |
|---|---|---|
GROQ_API_KEY |
(required) | Your Groq API key |
COMMANDER_MODEL |
llama-3.3-70b-versatile |
Model ID to use |
Example:
export COMMANDER_MODEL="llama-3.1-8b-instant"