What is the Codebuff CLI?
The Codebuff CLI is a standalone binary that runs in your terminal and provides:- Interactive chat interface - Conversational AI agent that understands your codebase
- Real-time streaming - See agent responses and tool executions as they happen
- Multi-agent orchestration - Automatic spawning of specialized agents for different tasks
- Direct file manipulation - Agents can read, write, and edit files in your project
- Git integration - Automatic detection of repository context
- Custom agent support - Load your own agents from
.agents/directories
CLI vs SDK
Codebuff offers two ways to interact with AI agents:CLI
Best for interactive development sessions, rapid prototyping, and learning how agents work.Use when you want to:
- Work interactively with AI agents
- See real-time agent reasoning
- Quickly test and iterate on code
- Create custom agents with
/init
SDK
Best for integrating AI into applications, automating workflows, and building custom tools.Use when you want to:
- Embed AI in your application
- Build automated workflows
- Create custom integrations
- Control agents programmatically
Basic Usage Patterns
Starting the CLI
Simply runcodebuff in your project directory:
- Detect your current directory as the project root
- Load custom agents from
.agents/directories (if present) - Start an interactive chat session
Sending Prompts
Type your coding request and press Enter:Using Commands
Commands start with/ and provide special functionality:
Quick Bash Execution
Prefix commands with! to run them directly:
Interactive Mode Features
Agent Modes
Codebuff offers different agent modes optimized for different use cases:DEFAULT - Balanced performance
DEFAULT - Balanced performance
The standard mode with a good balance of speed, cost, and capability. Suitable for most coding tasks.
FREE - Fast and economical
FREE - Fast and economical
Uses lightweight models for quick responses. Great for simple tasks and rapid iteration.
MAX - Maximum capability
MAX - Maximum capability
Uses the most powerful models available. Best for complex refactoring and architectural changes.
PLAN - Planning and strategy
PLAN - Planning and strategy
Focused on planning and strategic thinking before implementation.
Input Modes
The CLI has special input modes for different tasks:- Default - Normal chat with the agent
- Bash mode (
!or/bash) - Execute shell commands - Image mode (
/image) - Attach images to your prompts - Referral mode (
/refer-friends) - Enter referral codes - Help mode (
/help) - View keyboard shortcuts
Escape or Backspace (when input is empty) to exit most special modes.
Keyboard Shortcuts
Stop the current agent execution
Exit the CLI
Search command history
Exit special input modes
Autocomplete commands and paths
Navigate command history
Real-time Streaming
As agents work, you’ll see:- Agent reasoning - The agent’s thought process in
<think>blocks - Tool executions - Real-time output from file operations, searches, and bash commands
- Spawned agents - Sub-agents automatically created for specialized tasks
- Progress indicators - Visual feedback for long-running operations
Conversation History
View and continue previous conversations:Project Context
Knowledge Files
Create aknowledge.md file in your project root to give agents context:
knowledge.md- Project-specific context and conventions.agents/- Directory for custom agent definitions.agents/types/- TypeScript type definitions for agent development
Git Integration
Codebuff automatically detects Git repositories and provides:- Context about uncommitted changes
- Awareness of .gitignore rules
- Branch information
Custom Agents
Load custom agents from:{project}/.agents/- Project-specific agents{project}/../.agents/- Monorepo shared agents~/.agents/- Global user agents
CLI Options
Configure the CLI with command-line flags:--agent <agent-id>- Run a specific agent (skips local overrides)--clear-logs- Remove existing log files before starting--continue [id]- Continue a previous conversation--cwd <directory>- Set working directory--free- Start in FREE mode--max- Start in MAX mode--plan- Start in PLAN mode-v, --version- Print CLI version-h, --help- Show help message
Next Steps
Commands
Learn all available CLI commands
Configuration
Configure API keys and settings
Workflows
Common CLI workflow patterns
Custom Agents
Create your own custom agents

