brv command from a script, pipeline, or SSH session and it works out of the box.
Daemon-first headless execution requires ByteRover CLI v2.0.0 or later.
Quick Start
Connect a provider
The free built-in provider works out of the box — no API key needed. To bring your own:
The --format json Flag
The --format json flag is the key to automation. It produces structured JSON output on every command, making it easy to parse results in scripts and pipelines.
| Flag | Description | Default |
|---|---|---|
--format <text|json> | Output format: text for human-readable, json for structured | text |
--format json.
Supported Commands
| Command | Key Flags | Auth Required | Description |
|---|---|---|---|
brv status | — | No | Show CLI and project status |
brv query "<question>" | — | No | Query the context tree |
brv curate "<context>" | --files, --folder, --detach | No | Curate context to the tree |
brv curate view [id] | --status, --since, --before, --limit, --detail | No | View curate history and audit trail |
brv providers connect <provider> | --api-key, --model, --base-url | No | Connect an LLM provider |
brv providers list | — | No | List available providers and connection status |
brv providers switch <provider> | — | No | Switch the active provider |
brv providers disconnect <provider> | — | No | Disconnect an LLM provider |
brv model | — | No | Show active model and provider |
brv model list | --provider | No | List available models |
brv model switch <model> | --provider | No | Switch the active model |
brv connectors | — | No | List installed agent connectors |
brv connectors install <agent> | --type | No | Install a coding agent connector |
brv hub list | — | No | List available skills and bundles |
brv hub install <id> | --agent, --scope, --registry | No | Install a skill or bundle from the hub |
brv login --api-key <key> | — | — | Authenticate for cloud sync |
brv push | --branch | Yes | Push context tree to cloud |
brv pull | --branch | Yes | Pull context tree from cloud |
brv space switch | --team, --name | Yes | Switch to a team and space |
brv space list | — | Yes | List available teams and spaces |
Commands marked “No” under Auth Required work entirely locally — no account, no internet (when using a local LLM provider). See Local vs Cloud for a full breakdown.
JSON Output Format
When using--format json, every command outputs one or more JSON lines to stdout. Each line follows the same envelope structure.
Response Envelope
Single-Response Commands
Commands likestatus, push, pull, and space switch emit a single JSON line:
Streaming Commands
Commands likequery and curate emit multiple JSON lines as the task progresses. Each line includes a data.event field:
| Event | Description |
|---|---|
thinking | LLM reasoning started |
toolCall | Tool invoked (includes toolName, args) |
toolResult | Tool completed (includes success) |
response | LLM final answer content |
completed | Task finished (includes result, status) |
error | Task failed (includes message, status) |
Error Responses
Errors setsuccess: false and include error details in data:
Coding Agent Integration (brv mcp)
The brv mcp command starts an MCP (Model Context Protocol) server that coding agents use to access your project’s context tree.
It is a hidden command — coding agents spawn it automatically; you don’t run it directly.
How It Works
Available MCP Tools
| Tool | Parameters | Description |
|---|---|---|
brv-query | query (required) | Query the context tree for project knowledge |
brv-curate | context, files, folder | Store context to the context tree |
Setup
The easiest way to configure MCP integration is through the TUI’s/connectors command, which sets up the MCP configuration for your coding agent automatically.
For manual setup and supported agents, see Coding Agent Connectors. For details on how the MCP server connects to the daemon and reuses the agent pool, see Daemon-First Architecture.
Curate History (brv curate view)
The brv curate view command lets you inspect curate operation history — useful for CI/CD audit trails, debugging failed curations, and verifying what was curated.
| Flag | Description | Default |
|---|---|---|
--status <status> | Filter by status: cancelled, completed, error, processing (repeatable) | All |
--since <time> | Show entries after this time (ISO date or relative: 1h, 24h, 7d) | — |
--before <time> | Show entries before this time (ISO date or relative) | — |
--limit <n> | Maximum number of entries to return | 10 |
--detail | Include operations for each entry | false |
CI/CD Integration
All CLI commands work in CI/CD environments out of the box. The daemon auto-starts, handles execution, and shuts down after 30 minutes of inactivity — no cleanup step needed.Common Patterns
Local-only (no auth needed):- Install ByteRover CLI
- Connect a provider (or use the free built-in)
- Run commands (query, curate, status)
- Install ByteRover CLI
- Authenticate with an API key
- Set up space for the project
- Run commands (query, curate, push, pull)
Workflow Examples
- Local-Only
- GitHub Actions (Cloud Sync)
- GitLab CI (Cloud Sync)
No authentication needed — uses the built-in provider or your own API key for local operations only.
The cloud sync examples above use
brv login, brv push, and brv pull — these require authentication. If you only need local operations (curate, query, status), skip the authentication and space setup steps.Authentication for Cloud Sync
Authentication is only required for cloud features:push, pull, space switch, and space list. Local operations — status, query, curate, providers, connectors, model — work without any authentication.
CI/CD and automation environments use API key authentication instead of browser-based OAuth.
Generate an API Key
- Go to ByteRover Dashboard
- Click Create API Key
- Copy the key (starts with
brv_) - Store securely in your CI/CD secrets
Secure Storage
- GitHub Actions: Repository secrets (
Settings > Secrets > Actions) - GitLab CI: CI/CD variables (
Settings > CI/CD > Variables, masked) - Jenkins: Credentials plugin with secret text
Environment & Token Storage
ByteRover stores authentication tokens as AES-256-GCM encrypted files in a platform-specific data directory:| Platform | Storage Location |
|---|---|
| macOS | ~/Library/Application Support/brv/ |
| Linux / CI runners | ~/.local/share/brv/ |
| Windows | %LOCALAPPDATA%/brv/ |
Troubleshooting
Do I need to authenticate?
Do I need to authenticate?
Short answer: Only for cloud sync features.Local operations (
status, query, curate, providers, connectors, model) work without authentication.Cloud operations (push, pull, space switch, space list) require brv login --api-key.See Local vs Cloud for a full breakdown.Daemon fails to start in CI/CD
Daemon fails to start in CI/CD
Cause: Container restrictions, port access issues, or stale lock files.Solution: Force a clean restart:Check daemon logs for details:
Space not configured
Space not configured
Cause: Running cloud commands without setting up a space first.Solution: Switch to a space before running cloud commands:Use
brv space list --format json to see available teams and spaces.Provider not configured
Provider not configured
Cause:
brv query or brv curate fails with “No provider connected”.Solution: Connect a provider:JSON output not appearing
JSON output not appearing
Cause: Errors are written to stderr, not stdout.Solution: Redirect both streams when capturing output:Or capture them separately:
Authentication fails in CI/CD
Authentication fails in CI/CD
Cause: Keychain unavailable, token expired, or incorrect API key.Solution:
- Verify the API key is correct and not expired
- Ensure the
BYTEROVER_API_KEYsecret is properly configured in your CI/CD platform - Re-run
brv login --api-key $BYTEROVER_API_KEY - Check that the secret is not masked in a way that corrupts special characters
Permission denied for token storage
Permission denied for token storage
Cause: Cannot write to
~/.local/share/brv/ directory.Solution: Ensure the directory exists and is writable:Next Steps
Daemon-First Architecture
How the background daemon powers instant startup, agent pool reuse, and shared state
Coding Agent Connectors
Connect coding agents like Cursor, Claude Code, and Windsurf via MCP
CLI Reference
Complete command reference for all ByteRover CLI commands
Troubleshooting
Common issues and solutions for ByteRover CLI