CLI Interactive Chat
CLI Interactive Chat
Section titled “CLI Interactive Chat”Quick Reference
- Who: Developer
- Where: Terminal →
codebuffcommand- Time: ~2 minutes to start
- Prerequisites: npm, Node.js 18+ or Bun
Prerequisites
Section titled “Prerequisites”- Installed Codebuff CLI (
npm install -g codebuff) - Have a project directory to work in
- Internet connection (for LLM API calls)
Step-by-Step Guide
Section titled “Step-by-Step Guide”Step 1: Install & Launch
Section titled “Step 1: Install & Launch”-
Install Codebuff globally:
Terminal window npm install -g codebuff -
Navigate to your project:
Terminal window cd your-project -
Launch Codebuff:
Terminal window codebuff
Step 2: Chat with the Agent
Section titled “Step 2: Chat with the Agent”-
Type your request in natural language:
Add error handling to all API endpoints -
Watch as Codebuff:
- Scans your codebase with the File Explorer agent
- Plans changes with the Thinker agent
- Makes edits with the Editor agent
- Reviews results with the Reviewer agent
-
Review the changes shown in the terminal
Step 3: Use Agent Modes
Section titled “Step 3: Use Agent Modes”Codebuff supports different modes for different needs:
| Mode | Flag | Description | Best For |
|---|---|---|---|
| Default | (none) | Balanced performance | Most tasks |
| Free | --free | Cost-optimized | Simple tasks |
| Max | --max | Maximum capability | Complex refactors |
| Plan | --plan | Planning only | Architecture planning |
# Use max mode for complex taskscodebuff --max
# Use free mode for simple changescodebuff --free
# Planning modecodebuff --planStep 4: Use Slash Commands
Section titled “Step 4: Use Slash Commands”Inside the CLI, use these commands:
| Command | Description |
|---|---|
/init | Initialize agent configuration |
/help | Show available commands |
/image | Analyze an image |
/referral | View referral code |
/usage | Check credit usage |
Step 5: Continue Previous Sessions
Section titled “Step 5: Continue Previous Sessions”# Continue last conversationcodebuff --continue
# Continue a specific conversationcodebuff --continue <conversation-id>(cli/src/index.tsx:100-152)
Expected Results
Section titled “Expected Results”- ✅ Terminal UI renders with chat interface
- ✅ Agent processes your request and makes file changes
- ✅ Changes are applied directly to your codebase
- ✅ Summary of all modifications displayed
Troubleshooting
Section titled “Troubleshooting”🔴 Error: Authentication required
Cause: No valid auth token found.
Solution:
- Run
codebuff loginto authenticate via GitHub - Or provide an API key:
codebuff --api-key=your-key
Source: (cli/src/index.tsx:189-192)
🔴 Error: Credit limit reached
Cause: Insufficient credits for the operation.
Solution:
- Check usage:
/usagecommand - Upgrade your plan at codebuff.com/pricing
- Enable auto top-up in your profile settings
Q: Which LLM models does Codebuff use?
A: Codebuff uses OpenRouter to access any model — Claude, GPT, DeepSeek, Qwen, and more. The model is selected based on your agent mode (Free/Default/Max/Plan).
Q: Can I use my own API key?
A: Yes, Codebuff supports Bring-Your-Own-Key (BYOK) for Anthropic, OpenAI, and Google Gemini. Configure in your profile settings.
Related
Section titled “Related”- Custom Agents — Create your own agents
- SDK Integration — Use Codebuff programmatically
- Architecture — How the multi-agent system works