Skip to main content
In ByteRover CLI v2.0.0, the daemon-first architecture means every CLI command runs headless by default. The background daemon handles all execution — the TUI is just another optional client. There is no special flag to enable headless mode. Run any 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

1

Connect a provider

To use the built-in ByteRover provider, authenticate first with brv login --api-key $BYTEROVER_API_KEY. Since v3.8.3, brv login defaults to a browser OAuth flow; in CI, SSH, or other non-interactive shells, always pass --api-key (SSH and non-interactive shells are auto-detected and will skip the browser, but passing --api-key explicitly is clearer). To use a third-party provider instead (no ByteRover login needed):
2

(Optional) Install a connector for your coding agent

3

Run commands with structured output

The daemon auto-starts on the first command — no manual setup needed. It shuts down automatically after 30 minutes of inactivity.

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. All commands listed below support --format json.

Supported Commands

Commands marked “No” under Auth Required work entirely locally — no account, no internet (when using a local or third-party LLM provider). Exception: brv providers connect byterover and brv providers switch byterover require a logged-in ByteRover account. See Local vs Cloud for a full breakdown.
For full command syntax, flags, and examples, see the CLI Reference. For detailed provider and model management, see External LLM Providers. For the skills and bundles registry, see BRV Hub.

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 like status, vc push, vc pull, and vc status emit a single JSON line:

Streaming Commands

Commands like query and curate emit multiple JSON lines as the task progresses. Each line includes a data.event field: Example stream for a query:

Error Responses

Errors set success: false and include error details in data:
Use jq to extract specific fields from JSON output:

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

The MCP server connects to the running daemon (auto-starting it if needed) and exposes ByteRover’s context management as tools that the coding agent can call.

Available MCP Tools

If the running daemon was started by a different brv build than the one spawning brv mcp, the text responses from both tools end with a daemon-version drift footer, and brv mcp logs a one-line drift notice to stderr on connect/reconnect. This matters for headless and CI agents where stderr is the only signal that the new release isn’t actually serving requests yet — run brv restart to align the daemon.

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.
Pass an entry ID as the first argument to view a single entry in detail. Examples:

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):
  1. Install ByteRover CLI
  2. Connect a provider (or use the built-in — requires brv login first)
  3. Run commands (query, curate, status)
Cloud sync (auth required):
  1. Install ByteRover CLI
  2. Authenticate with an API key
  3. Set up space for the project
  4. Run commands (query, curate, push, pull)

Workflow Examples

No ByteRover authentication needed when using your own API key. To use the built-in ByteRover provider in CI/CD, add a brv login step first.
The cloud sync examples above use brv login, brv vc clone, brv vc push, and brv vc pull — these require authentication. If you only need local operations (curate, query, status), skip the authentication and clone steps.
Store your API key in your CI/CD platform’s secret manager. Never commit keys to version control.

Authentication for Cloud Sync

Authentication is only required for cloud features: vc push, vc pull, vc clone, vc remote, 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

  1. Go to ByteRover Dashboard
  2. Click Create API Key
  3. Copy the key (starts with brv_)
  4. Store securely in your CI/CD secrets

Secure Storage

Never commit API keys to version control. Use environment variables or secret managers.
CI/CD Secret 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: If storage fails due to permissions, ensure the directory exists and is writable:

Proxy Configuration

CI/CD runners and enterprise build environments often route traffic through a corporate proxy. ByteRover CLI (v2.4.0+) respects standard proxy environment variables — set them in your pipeline and ByteRover’s internal service traffic (cloud sync, hub, authentication) will route through the proxy automatically. Traffic to external LLM providers is not proxied. GitHub Actions:
GitLab CI:
If your CI runners use SSL inspection, set NODE_EXTRA_CA_CERTS to the path of your corporate CA certificate bundle. Without this, TLS handshakes with external services will fail.

Troubleshooting

Short answer: Only for cloud sync features and the ByteRover built-in provider.Local operations (status, query, curate, connectors) work without authentication. Provider and model commands also work without authentication when using third-party providers.Requires authentication:
  • ByteRover built-in providerbrv providers connect byterover and brv providers switch byterover require brv login --api-key.
  • Cloud operationsvc push, vc pull, vc clone, vc remote, space list require brv login --api-key.
See Local vs Cloud for a full breakdown.
Cause: Container restrictions, port access issues, or stale lock files.Solution: Force a clean restart:
Check daemon logs for details:
Cause: Running cloud commands without setting up a space first.Solution: Clone a space before running cloud commands:
Use brv space list --format json to see available teams and spaces.
Cause: brv query or brv curate fails with “No provider connected”.Solution: Connect a provider:
Cause: Errors are written to stderr, not stdout.Solution: Redirect both streams when capturing output:
Or capture them separately:
Cause: Keychain unavailable, token expired, or incorrect API key.Solution:
  1. Verify the API key is correct and not expired
  2. Ensure the BYTEROVER_API_KEY secret is properly configured in your CI/CD platform
  3. Re-run brv login --api-key $BYTEROVER_API_KEY
  4. Check that the secret is not masked in a way that corrupts special characters
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