Note: This project was completely generated with Antigravity.
CLI Copilot is a command-line tool that translates natural language queries into shell commands using your favorite Local or Cloud LLMs. It supports multiple providers like Google Gemini, Anthropic Claude, OpenAI, Ollama, and OpenRouter.
- Natural Language to Shell: Just ask what you want to do.
- Safety First: It shows you the command and waits for your confirmation (
Ato accept,Rto reject) before executing. - Multiple Providers: Supports Gemini (default), Anthropic, OpenAI, Ollama, and OpenRouter.
Note: Currently, Gemini and Anthropic are fully tested. Other providers (OpenAI, Ollama, OpenRouter) are implemented but experimental.
- Configurable Models: Choose specific models for each provider.
- Cross-Platform: Works on macOS, Linux, and Windows.
To install ch globally on your system:
git clone https://github.com/prabhat-krai/cli-copilot.git
cd cli-copilot
./install.shor using uv directly if you have it:
uv tool install git+https://github.com/prabhat-krai/cli-copilot.git- Clone the repository:
git clone https://github.com/prabhat-krai/cli-copilot.git cd cli-copilot - Install dependencies using
uv:uv sync
- Run from source:
uv run ch "your query"
Once installed, use the ch command:
ch "count all files in this folder recursively"The tool will suggest a command (e.g., find . -type f | wc -l). Press A to execute it or R to cancel.
By default, it uses Gemini. You can change the provider using the --provider flag or an environment variable.
Flags:
ch --provider openai "list files"
ch --provider anthropic "check disk space"
ch --provider ollama --model llama3 "hello world"Environment Variable:
export CLI_COPILOT_PROVIDER=anthropicYou must set the API key for the provider you choose:
- Gemini:
GEMINI_API_KEY - Anthropic:
ANTHROPIC_API_KEY - OpenAI:
OPENAI_API_KEY - OpenRouter:
OPENROUTER_API_KEY
Copy the example environment file and add your API keys:
cp .env.example .envThen edit .env and replace the placeholder values with your actual API keys. The .env file is ignored by git, so your keys stay private.
$ ch "find all python files modified in the last 24 hours"
Suggested Command:
find . -name "*.py" -mtime -1
Execute this command? (A)ccept / (R)eject [a/A/r/R] (A):