AI-powered coding assistant for your terminal - Like Aider, but simpler and works on Termux!
Code Buddy is a command-line tool that lets you chat with AI to write, edit, and debug code directly in your terminal. No API key required - it works immediately after installation.
- 🚀 Works immediately - No API key setup required
- 💬 Chat with AI - Ask questions, get code suggestions (GPT-5.2)
- 📁 File Management - Create and edit files through conversation
- 🔄 Git Integration - Auto-commits changes with descriptive messages
- 🎨 Beautiful Terminal UI - Rich text formatting and syntax highlighting
- 📱 Termux Ready - Pure Python, no Rust/compilation required!
# Update and install prerequisites
sudo apt update && sudo apt install -y python3 git
# Install Code Buddy
pip install rich
pip install openai
# Clone and install
git clone https://github.com/amoschanda/code-buddy.git
cd code-buddy
pip install -e .curl -fsSL https://raw.githubusercontent.com/amoschanda/code-buddy/main/install-termux.sh | bash# Start Code Buddy in current directory
code-buddy
# Or use the short alias
cb
# Start with specific files in context
cb main.py utils.py
# Use a different model
cb --model gpt-4o| Command | Description |
|---|---|
/add <file> |
Add file to context for AI reference |
/drop <file> |
Remove file from context |
/files |
Show files in context |
/ls [pattern] |
List files in directory |
/read <file> |
Display file contents |
/apply |
Apply AI-suggested file changes |
/git status |
Show git status |
/git commit |
Commit current changes |
/git init |
Initialize git repository |
/clear |
Clear conversation history |
/model |
Show current model info |
/help |
Show help |
/quit |
Exit Code Buddy |
You> Create a Python Flask web app with a homepage
🤖 Code Buddy will generate the files, then use /apply to save them
You> /add app.py
You> Add error handling to the main function
You> /add buggy_script.py
You> Why is this code throwing a TypeError?
Customize with environment variables:
# Use a different model
export CODE_BUDDY_MODEL=gpt-4o
# Use a different provider
export CODE_BUDDY_PROVIDER=anthropic
# Use your own API key (optional)
export CODE_BUDDY_API_KEY=your-api-key-here- OpenAI: gpt-4.1-mini (default), gpt-4o, gpt-4o-mini
- Anthropic: claude-sonnet-4-5, claude-opus-4-5
- Google: gemini-3-flash, gemini-3-pro
- No Rust compilation - Aider fails on Termux due to tiktoken
- No sudo needed - Works with standard apt package manager
- No API key needed - Works out of the box
- Lightweight - Minimal dependencies
- Mobile-friendly - Designed for small screens
MIT License
Made with ❤️ for mobile developers!