Skip to content

Commit 8acd61d

Browse files
committed
Document --agent override behavior
1 parent 6746f53 commit 8acd61d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Control how Codebuff runs with these flags:
6161
- `--print, -p` - Print-only mode, run once and exit (for scripts/CI)
6262

6363
**Agent Control**:
64-
- `--agent <id>` - Run specific agent (e.g., `--agent file-picker`)
64+
- `--agent <id>` - Run specific agent (skips loading local `.agents` overrides)
6565
- `--spawn <id>` - Spawn agent directly (e.g., `--spawn reviewer`)
6666
- `--params <json>` - Pass JSON parameters to agent
6767

cli/src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function parseArgs(): ParsedArgs {
9999
.version(loadPackageVersion(), '-v, --version', 'Print the CLI version')
100100
.option(
101101
'--agent <agent-id>',
102-
'Specify which agent to use (e.g., "base", "ask", "file-picker")',
102+
'Run a specific agent id (skips loading local .agents overrides)',
103103
)
104104
.option('--clear-logs', 'Remove any existing CLI log files before starting')
105105
.option(
@@ -180,7 +180,8 @@ async function main(): Promise<void> {
180180
const showProjectPicker =
181181
projectRoot === '/' || projectRoot === homeDir || gitRoot === null
182182

183-
// Initialize agent registry (loads user agents via SDK)
183+
// Initialize agent registry (loads user agents via SDK).
184+
// When --agent is provided, skip local .agents to avoid overrides.
184185
if (isPublishCommand || !hasAgentOverride) {
185186
await initializeAgentRegistry()
186187
}

common/src/templates/initial-agents-dir/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Create specialized agent workflows that coordinate multiple AI agents to tackle
55
## Getting Started
66

77
1. **Edit an existing agent**: Start with `my-custom-agent.ts` and modify it for your needs
8-
2. **Test your agent**: Run `codebuff --agent your-agent-name`
8+
2. **Test your agent**: Run `codebuff` without `--agent` so local `.agents` load, then invoke your agent from a prompt
99
3. **Publish your agent**: Run `codebuff publish your-agent-name`
1010

1111
## Need Help?
@@ -228,7 +228,7 @@ async *handleSteps() {
228228

229229
## Testing Your Agent
230230

231-
1. **Local Testing**: `codebuff --agent your-agent-name`
231+
1. **Local Testing**: Run `codebuff` without `--agent` so local `.agents` load, then invoke your agent from a prompt
232232
2. **Debug Mode**: Add logging to your `handleSteps` function
233233
3. **Unit Testing**: Test individual functions in isolation
234234
4. **Integration Testing**: Test agent coordination workflows

0 commit comments

Comments
 (0)