Transform natural language into terminal commands using AI. Supports multiple AI providers (OpenAI, Gemini) with easy configuration management.
✅ Natural Language to Commands - Describe what you want, get the exact command
✅ Multiple AI Providers - OpenAI (GPT-4, GPT-3.5) and Google Gemini support
✅ Safety First - Warns about dangerous commands before execution
✅ Edit Before Run - Review and modify commands before execution
✅ Easy Configuration - Interactive setup and config management
✅ Cross-Platform - Works on Windows, Linux, and macOS
- Download
setup_windows.ps1 - Right-click and select "Run with PowerShell"
- Follow the prompts
chmod +x setup_linux.sh
./setup_linux.shThe setup script will:
- Install Python & pipx (if needed)
- Install cli-ai
On first run, you'll be guided through an interactive setup:
- Choose AI Provider - Select OpenAI or Gemini
- Enter API Key:
- OpenAI: Get from https://platform.openai.com/api-keys
- Gemini: Get from https://makersuite.google.com/app/apikey
- Select Model (optional) - Choose your preferred model
cli-ai "list all docker containers"
cli-ai "find files larger than 100MB"
cli-ai "show disk usage"
cli-ai "compress all jpg files in current folder"Manage your AI providers and settings:
cli-ai --configConfiguration menu options:
- Switch between providers (OpenAI ↔ Gemini)
- Update API keys
- Change models
- Add/configure additional providers
- View current configuration
- Configure popup hotkey (for SSH terminal integration)
For SSH terminals like MobaXterm, use the popup command bar:
cli-ai-popupImportant: On Windows, you must run PowerShell/CMD as Administrator for global hotkey support.
This starts a background service that:
- Listens for a global hotkey (default: Ctrl+Space)
- Shows a popup input bar when triggered
- Converts your natural language to commands
- Types the command directly into your active terminal window
- Connect to your SSH server (MobaXterm, PuTTY, etc.)
- Start the popup service (as Administrator):
cli-ai-popup - Press your configured hotkey (default: Ctrl+Space) anywhere
- Type your query: "check disk space"
- Press Enter
- The command (
df -h) is typed directly into your terminal!
To change the hotkey from the default ctrl+space:
cli-ai --config
# Select option 7: Configure popup hotkeyExample hotkey formats:
ctrl+space(default)ctrl+shift+aalt+f1- `ctrl+`` (backtick)
ctrl+alt+cwin+space
Note: After changing the hotkey, restart cli-ai-popup for changes to take effect.
Press Ctrl+C in the terminal where you started the service.
When you run a command, you'll see:
- AI Suggestion - The generated command with explanation
- Safety Warning - If the command is potentially dangerous
- Action Options:
y- Run the commandn- Aborte- Edit the command before running
- Models:
gpt-4o,gpt-4o-mini,gpt-4-turbo,gpt-3.5-turbo - API Key: https://platform.openai.com/api-keys
- Models:
gemini-2.5-flash(Recommended),gemini-2.5-pro - API Key: https://aistudio.google.com/app/apikey
Configuration is stored in ~/.cli-ai_config:
{
"provider": "openai",
"popup_hotkey": "ctrl+space",
"openai": {
"api_key": "sk-...",
"model": "gpt-4o-mini"
},
"gemini": {
"api_key": "...",
"model": "gemini-pro"
}
}If installed via pipx:
pipx upgrade cli-aiOr reinstall from source:
cd cli-ai
pip install -e . --force-reinstall# File operations
cli-ai "create a backup of all .py files"
cli-ai "rename all .txt files to .md"
# System monitoring
cli-ai "show top 10 memory consuming processes"
cli-ai "check if port 8080 is in use"
# Git operations
cli-ai "show commits from last week"
cli-ai "create a new branch called feature-x"
# Docker
cli-ai "stop all running containers"
cli-ai "remove unused images"Provider Error: Run cli-ai --config to check your configuration
Import Error: Make sure all dependencies are installed:
pip install openai rich prompt_toolkit google-genai keyboard pyautogui pywin32Popup Service Issues:
- On Windows, ensure you're running as Administrator
- Verify the hotkey format is correct (e.g.,
ctrl+space) - Check that no other application is using the same hotkey
Command Not Found: Restart your terminal or run the setup script again
- Python 3.8+
- Internet connection (for AI API calls)
- API key for your chosen provider