A multi-AI terminal agent that writes code, runs commands, searches the web, talks to you, and manages your projects -- from your terminal, your phone, or running 24/7 in the background.
Now with a Multi-AI Fleet Hub β multiple Code Buddy peers can observe each other's events live and invoke each other's LLMs via /fleet send peer.chat. Pilot local Ollama LLMs from any peer in your Tailscale network for free coding/reasoning. (Phase (d).1 β (d).16a, May 2026.)
Auto-memory writeback β the agent persists what it learns (preferences, decisions, gotchas) to .codebuddy/CODEBUDDY_MEMORY.md across sessions. View with /memory recent. buddy --init also generates an AGENTS.md at the project root for cross-CLI compatibility (read by Claude Code, Gemini CLI, Cursor, Codex). (rc.2, May 2026.)
Code Buddy is an open-source multi-provider AI coding agent that runs in your terminal. It supports 15 LLM providers with automatic failover and per-provider circuit breakers. It works as both a development tool (reads files, writes code, runs commands, creates PRs, plans complex tasks) and a personal assistant (voice conversation, memory, screen monitoring, push notifications via 20+ messaging channels, 24/7 background operation).
ChatGPT Pro / Plus subscription login (Phase d.23+) β buddy login, sign in once with your ChatGPT account, then chat with gpt-5.5 directly from the terminal. No API key, cost reported as $0.0000 (flat-fee plan).
Interactive TUI + tool calling. The agent reads project context, calls tools in parallel (web_search Γ2 for the screenshot below), and streams the synthesised answer.
Self-audit. Asked to find a bug in its own integration code, gpt-5.5 reads src/codebuddy/providers/provider-chatgpt-responses.ts, identifies a stale-variable issue (mutated body.model not propagated), and proposes the exact fix:
More captures + walk-through: docs/screenshots/.
# Install
npm install -g @phuetz/code-buddy
# Option A β bring your own API key
export GROK_API_KEY=your_api_key # or GEMINI_API_KEY / OPENAI_API_KEY / ANTHROPIC_API_KEY
buddy
# Option B β log in with your ChatGPT Plus / Pro subscription (no API key needed)
buddy login # opens browser for OAuth β tokens persisted
buddy whoami # β
connected Β· your.email@example.com Β· Plan: pro
buddy # auto-routes to gpt-5.5 via the Codex backend, cost $0.0000
# Or with a specific task
buddy --prompt "analyze the codebase structure"
# Full autonomy
buddy --yoloSee Getting Started for installation options, headless mode, session management, and typical workflows. The ChatGPT Codex OAuth flow is documented with screenshots in docs/screenshots/.
| Category | Highlights | Docs |
|---|---|---|
| AI Providers | 15 providers (Grok, Claude, GPT, Gemini, Ollama, LM Studio, AWS Bedrock, Azure, Groq, Together, Fireworks, OpenRouter, vLLM, Copilot, Mistral), circuit breaker, model pairs | providers.md |
| Tools | ~110 tools with RAG selection, multi-strategy edit matching, Codex-style apply_patch, streaming, BM25 tool search, code exec sandbox | tools-reference.md |
| Commands | 190+ slash commands, CLI subcommands (/dev, /pr, /lint, /switch, /think, /batch, /watch, /conflicts, /vulns, /replace) |
commands.md |
| Agents | Multi-agent orchestration (5-tool API), 8 specialized agents, SWE agent, planning flow, A2A protocol, batch decomposition, agent teams | agents.md |
| Reasoning | Tree-of-Thought + MCTS (4 depth levels), extended thinking, auto-escalation, /think command |
reasoning.md |
| Security | Guardian Agent (AI risk scoring), OS/Docker/OpenShell sandbox, SSRF guard, secrets vault, write policy, exec policy, loop detection, omission detection, output sanitizer | security.md |
| Channels | 20+ messaging channels (Telegram, Discord, Slack, WhatsApp, Signal, Teams, Matrix, IRC, and more), DM pairing, send policy | channels.md |
| Context Engine | Smart compression, tool output masking, image pruning, transcript repair, pre-compaction flush, restorable compression, JIT context, importance-weighted window | context-engine.md |
| Infrastructure | HTTP server (OpenAI-compatible), WebSocket gateway, daemon mode, cron, device nodes, canvas/A2UI, 6 cloud deploy configs, MCP, plugins | infrastructure.md |
| Configuration | Env vars, TOML config with profiles, model-aware limits, per-agent params, i18n (6 locales), personas | configuration.md |
| Development | TypeScript strict, Vitest (27,334 tests), ESM, middleware pipeline, facade architecture | development.md |
- Voice: 7 TTS providers, wake word detection, voice-to-code pipeline, hands-free conversation
- Memory: Persistent + semantic + prospective + decision + coding style memory, ICM cross-session memory
- Knowledge: Knowledge base injection, 40 bundled skills, self-authoring skills at runtime
- Git Workflow: Auto-commit (Aider-style),
/prcreation, merge conflict resolver, ghost snapshots - Code Intelligence: LSP rename/refactor, auto-import, bug finder (25+ patterns, 6 langs), OpenAPI generator, log analyzer
- IDE Integration: VS Code extension (diff view, inline edit, model switch), JetBrains plugin, LSP server
- Inline Context:
@web,@git,@terminalmentions for contextual references - Workflows: Lobster typed DAG engine with approval gates, pause/resume tokens
| Document | Description |
|---|---|
| Getting Started | Prerequisites, install, first run, headless mode, session management |
| Providers | All 15 providers, connection profiles, model pairs, circuit breaker |
| Tools Reference | Tool categories, RAG selection, edit matching, apply_patch, streaming |
| Commands | All slash commands, CLI subcommands, global flags |
| Agents | Multi-agent orchestration, roles, SWE agent, planning flow, A2A |
| Reasoning | Extended thinking, Tree-of-Thought, MCTS, /think command |
| Security | Permission modes, Guardian Agent, sandboxing, SSRF, secrets vault |
| Channels | 20+ messaging channels, DM pairing, send policy |
| Context Engine | Compression, tool output masking, JIT context, pre-compaction flush |
| Infrastructure | HTTP server, WebSocket gateway, daemon, cron, deploy, plugins |
| Fleet Guide | Multi-AI hub β /fleet listen + /fleet send peer.chat, env-driven multi-provider auto-detect, Tailscale lab examples |
| Configuration | Environment variables, TOML config, project settings, model limits |
| Development | Build, test, architecture, coding conventions, adding tools |
git clone https://github.com/phuetz/code-buddy.git
cd code-buddy
npm install
npm run dev # Development mode
npm test # Run all tests
npm run validate # Lint + typecheck + test (run before committing)See Development for architecture details and coding conventions.
MIT License - see LICENSE for details.
Report Bug | Request Feature | Star on GitHub
Multi-AI: Grok | Claude | ChatGPT | Gemini | LM Studio | Ollama | AWS Bedrock | Azure | Groq | Together | Fireworks | OpenRouter | vLLM | Copilot | Mistral


