Skip to content

CLI Interactive Chat

Quick Reference

  • Who: Developer
  • Where: Terminal → codebuff command
  • Time: ~2 minutes to start
  • Prerequisites: npm, Node.js 18+ or Bun
  • Installed Codebuff CLI (npm install -g codebuff)
  • Have a project directory to work in
  • Internet connection (for LLM API calls)
  1. Install Codebuff globally:

    Terminal window
    npm install -g codebuff
  2. Navigate to your project:

    Terminal window
    cd your-project
  3. Launch Codebuff:

    Terminal window
    codebuff
  1. Type your request in natural language:

    Add error handling to all API endpoints
  2. 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
  3. Review the changes shown in the terminal

Codebuff supports different modes for different needs:

ModeFlagDescriptionBest For
Default(none)Balanced performanceMost tasks
Free--freeCost-optimizedSimple tasks
Max--maxMaximum capabilityComplex refactors
Plan--planPlanning onlyArchitecture planning
Terminal window
# Use max mode for complex tasks
codebuff --max
# Use free mode for simple changes
codebuff --free
# Planning mode
codebuff --plan

Inside the CLI, use these commands:

CommandDescription
/initInitialize agent configuration
/helpShow available commands
/imageAnalyze an image
/referralView referral code
/usageCheck credit usage
Terminal window
# Continue last conversation
codebuff --continue
# Continue a specific conversation
codebuff --continue <conversation-id>

(cli/src/index.tsx:100-152)

  • ✅ 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
🔴 Error: Authentication required

Cause: No valid auth token found.

Solution:

  1. Run codebuff login to authenticate via GitHub
  2. 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:

  1. Check usage: /usage command
  2. Upgrade your plan at codebuff.com/pricing
  3. 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.