Quick Start with SDK
The Codebuff SDK allows you to run AI coding agents programmatically in your Node.js applications.Installation
Basic SDK Usage
Here’s a simple example of running the base Codebuff agent:Continuing a Conversation
You can continue a session by passing the previous run state:CLI Usage
Installation
Running Codebuff CLI
- “Fix the SQL injection vulnerability in user registration”
- “Add rate limiting to all API endpoints”
- “Refactor the database connection code for better performance”
Initialize Custom Agents
Start Codebuff and run the/init command to set up custom agent development:
Handling Events
ThehandleEvent callback receives every event during execution:
Streaming Output
You can stream the agent’s output in real-time:Error Handling
Always check the output type to handle errors:Configuration Options
TheCodebuffClient constructor accepts several options:
Next Steps
- Create a custom agent to specialize behavior
- Build custom tools to extend functionality
- Set up multi-step workflows for complex tasks
- Automate git workflows with intelligent commits

