Skip to content

Commit 1c247d8

Browse files
陈家名陈家名
authored andcommitted
docs: add advanced usage guide to README
- Add custom agent workflows section - Add multi-model support examples - Add multi-agent orchestration examples - Add CI/CD integration examples - Add environment variables documentation - Add keyboard shortcuts reference
1 parent a7f995e commit 1c247d8

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,74 @@ Learn more about the SDK [here](https://www.npmjs.com/package/@codebuff/sdk).
157157

158158
**SDK**: Build Codebuff into your applications. Create custom tools, integrate with CI/CD, or embed coding assistance into your products.
159159

160+
## Advanced Usage
161+
162+
### Custom Agent Workflows
163+
164+
Create your own agents with specialized workflows using the `/init` command:
165+
166+
```bash
167+
codebuff
168+
/init
169+
```
170+
171+
This creates a custom agent structure in `.agents/` that you can customize.
172+
173+
### Using Different Models
174+
175+
Codebuff supports any model on OpenRouter. Override the default model per task:
176+
177+
```typescript
178+
const result = await client.run({
179+
agent: 'editor',
180+
prompt: 'Refactor this function',
181+
model: 'deepseek/deepseek-chat', // Use DeepSeek for this task
182+
})
183+
```
184+
185+
### Multi-Agent Orchestration
186+
187+
Codebuff's strength is coordinating multiple specialized agents:
188+
189+
```typescript
190+
const result = await client.run({
191+
agent: 'commander', // The orchestrator agent
192+
prompt: 'Add authentication to the API - use file-picker to find relevant files, planner to plan changes, editor to make edits, and reviewer to validate',
193+
})
194+
```
195+
196+
### CI/CD Integration
197+
198+
Integrate Codebuff into your CI pipeline for automated code reviews:
199+
200+
```bash
201+
# In your CI script
202+
codebuff "Review the changes in this PR for security issues"
203+
```
204+
205+
### Environment Variables
206+
207+
Configure Codebuff behavior via environment variables:
208+
209+
```bash
210+
# Use a specific OpenRouter API key
211+
export OPENROUTER_API_KEY=sk-or-v1-xxxx
212+
213+
# Set default model
214+
export CODEBUFF_MODEL=anthropic/claude-3.5-sonnet
215+
216+
# Enable debug mode
217+
export DEBUG=codebuff*
218+
```
219+
220+
### Keyboard Shortcuts (Interactive Mode)
221+
222+
- `Ctrl+C` - Cancel current operation
223+
- `Ctrl+L` - Clear screen
224+
- `Ctrl+U` - Clear current input
225+
- `Ctrl+P/N` - Navigate command history
226+
- `Tab` - Autocomplete
227+
160228
## Contributing to Codebuff
161229

162230
We ❤️ contributions from the community - whether you're fixing bugs, tweaking our agents, or improving documentation.

0 commit comments

Comments
 (0)