Skip to content

asuender/commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

commander

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!

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/your-user/commander.git ~/.commander
  2. Add to your .zshrc:

    export GROQ_API_KEY="your-api-key-here"
    source ~/.commander/plugin.zsh
  3. Reload your shell:

    source ~/.zshrc

Usage

  1. Press Ctrl+G - an ai> prompt appears below your current prompt
  2. Type a natural language request (e.g. "find all TODO comments in this directory")
  3. Press Enter to submit - the AI-generated command is placed into your buffer
  4. Press Ctrl+C or Ctrl+G to abort
  5. 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.

Configuration

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"

About

A minimal ZSH widget to prompt an AI for shell commands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages