Skip to content

amoschanda/code-buddy

Repository files navigation

🤖 Code Buddy

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.

✨ Features

  • 🚀 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!

📦 Installation on Termux

Quick Install (Copy & Paste)

# 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 .

One-Line Install

curl -fsSL https://raw.githubusercontent.com/amoschanda/code-buddy/main/install-termux.sh | bash

🚀 Quick Start

# 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

📋 Commands

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

💡 Usage Examples

Create a new project

You> Create a Python Flask web app with a homepage

🤖 Code Buddy will generate the files, then use /apply to save them

Edit existing code

You> /add app.py
You> Add error handling to the main function

Debug code

You> /add buggy_script.py  
You> Why is this code throwing a TypeError?

⚙️ Configuration

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

🔧 Supported Models

  • 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

📱 Why Code Buddy for Termux?

  • 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

📄 License

MIT License


Made with ❤️ for mobile developers!

About

AI-powered coding assistant for Termux - Like Aider but works without Rust!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors