CLI Reference¶
Complete reference for the Brat command-line interface.
Global Flags¶
Available on all commands:
| Flag | Description |
|---|---|
--json | Output in JSON format |
--quiet | Suppress human-readable output |
--repo <path> | Target a specific repository |
--no-daemon | Don't auto-start the daemon |
--verbose | Verbose output |
--help | Show help |
--version | Show version |
Initialization¶
brat init¶
Initialize Brat harness in the current repository.
| Option | Description |
|---|---|
--no-daemon | Don't start daemon |
--no-tmux | Don't create tmux session |
--no-config | Don't create config file |
Behavior:
- Initializes Grite ledger (
grite init) - Creates
.brat/config.toml(unless--no-config) - Starts daemon (unless
--no-daemon)
Status¶
brat status¶
View convoys, tasks, and sessions.
| Option | Description |
|---|---|
--json | JSON output |
--all-repos | Aggregate across repos |
--convoy <id> | Filter by convoy |
--watch | Watch for updates |
Convoy Commands¶
brat convoy create¶
Create a new convoy.
| Option | Description |
|---|---|
--title <text> | Convoy title (required) |
--goal <text> | Convoy goal (required) |
--mirror | Create mirror convoy |
--repos <paths> | Comma-separated repo paths (with --mirror) |
--workflow <name> | Use workflow template |
--var <key=value> | Workflow variable |
brat convoy list¶
List all convoys.
| Option | Description |
|---|---|
--json | JSON output |
--all-repos | Include all repos |
brat convoy show¶
Show convoy details.
| Option | Description |
|---|---|
--json | JSON output |
brat convoy add-repo¶
Add a repository to a convoy.
Task Commands¶
brat task add¶
Add a task.
| Option | Description |
|---|---|
--convoy <id> | Parent convoy |
--solo | Create single-task convoy |
--title <text> | Task title (required) |
--paths <paths> | Comma-separated paths |
--priority <P0\|P1\|P2> | Task priority |
--repo <path> | Target repo (multi-repo) |
--engine <name> | Override engine |
brat task list¶
List tasks.
| Option | Description |
|---|---|
--json | JSON output |
--all-repos | Include all repos |
--label <label> | Filter by label |
brat task show¶
Show task details.
| Option | Description |
|---|---|
--json | JSON output |
brat task assign¶
Assign a task to an actor.
brat task comment¶
Add a comment to a task.
brat task close¶
Close a task.
Mayor Commands¶
brat mayor start¶
Start the Mayor session.
brat mayor ask¶
Send a prompt to the Mayor.
brat mayor status¶
Check Mayor session status.
brat mayor stop¶
Stop the Mayor session.
Session Commands¶
brat session list¶
List active sessions.
| Option | Description |
|---|---|
--json | JSON output |
brat session tail¶
View session output.
| Option | Description |
|---|---|
--lines <n> | Number of lines (default: 50) |
--json | JSON output |
brat session stop¶
Stop a session.
Role Commands¶
brat witness run¶
Run the Witness to spawn agents.
| Option | Description |
|---|---|
--once | Run once and exit |
brat refinery run¶
Run the Refinery to process merge queue.
| Option | Description |
|---|---|
--once | Run once and exit |
brat deacon run¶
Run the Deacon for cleanup.
| Option | Description |
|---|---|
--once | Run once and exit |
Swarm Commands¶
brat swarm start¶
Start multiple agents for a convoy.
| Option | Description |
|---|---|
--n <count> | Number of agents |
--convoy <id> | Target convoy |
brat swarm stop¶
Stop agents for a convoy.
Lock Commands¶
brat lock status¶
View lock status.
| Option | Description |
|---|---|
--json | JSON output |
brat lock acquire¶
Acquire a lock.
| Option | Description |
|---|---|
--resource <r> | Resource identifier |
--ttl <duration> | Lock duration (e.g., "15m") |
brat lock renew¶
Renew a lock.
brat lock release¶
Release a lock.
| Option | Description |
|---|---|
--force | Force release |
Daemon Commands¶
brat daemon start¶
Start the daemon.
| Option | Description |
|---|---|
--port <port> | HTTP port (default: 3000) |
--idle-timeout <secs> | Idle shutdown timeout |
--foreground | Run in foreground |
brat daemon stop¶
Stop the daemon.
brat daemon status¶
Check daemon status.
| Option | Description |
|---|---|
--json | JSON output |
brat daemon restart¶
Restart the daemon.
brat daemon logs¶
View daemon logs.
| Option | Description |
|---|---|
-n <lines> | Number of lines |
Utility Commands¶
brat doctor¶
Health check and repair.
| Option | Description |
|---|---|
--check | Read-only health check |
--rebuild | Rebuild state |
--json | JSON output |
brat sync¶
Sync with remote.
| Option | Description |
|---|---|
--pull | Pull from remote |
--push | Push to remote |
brat export¶
Export data.
brat config validate¶
Validate configuration.
brat feed¶
View event feed.
| Option | Description |
|---|---|
--once | Run once |
--follow | Follow updates |
--timeout <ms> | Timeout |
Examples¶
Full Workflow¶
# Initialize
brat init
# Create convoy
brat convoy create --title "Bug fixes" --goal "Fix P0 bugs"
# Add tasks
brat task add --convoy <id> --title "Fix crash" --paths src/app.rs
# Run agents
brat witness run --once
# Monitor
brat status --watch
# Merge
brat refinery run --once
Using the Mayor¶
# Start Mayor
brat mayor start
# Analyze and create work
brat mayor ask "Analyze src/ and create tasks for bugs"
# View results
brat status
# Run agents
brat witness run --once