Skip to main content
ByteRover CLI (brv) is a command-line tool for managing your AI development workflow with ByteRover. Use it to authenticate, retrieve memories from your knowledge base, manage projects and spaces, and maintain your context tree. For help with any command, run brv --help or brv <command> --help.

Installation

Install ByteRover CLI globally using npm:
npm install -g byterover-cli
Verify the installation:
brv --version

Prerequisites

  • Node.js: Version 20.0.0 or higher
  • Supported platforms: macOS, Windows, Linux

Getting Started

ByteRover CLI offers two ways to interact: Interactive REPL mode (recommended) and traditional CLI commands. Start the interactive terminal UI by running brv with no arguments:
brv
This launches a persistent session with a React/Ink-based terminal interface where you can use slash commands:
/status                 # Show auth, config, and context tree state
/curate [context] [@paths]  # Curate context to the context tree
/query <query>          # Query information from context tree (alias: /q)
/connector              # Manage coding agent connectors (alias: /connectors)
/provider               # Connect to an LLM provider (aliases: /providers, /connect)
/model                  # Select a model from the active provider (alias: /models)
/push [-b branch] [-y]  # Push context tree to ByteRover memory storage
/pull [-b branch]       # Pull context tree from ByteRover memory storage
/space list [-a] [-j]   # List all spaces
/space switch           # Switch to a different space
/reset [-y] [directory] # Reset context tree to an empty state
/new [-y]               # Start fresh session (clears conversation)
/init [-f]              # Initialize project (select team/space)
/login                  # Authenticate with ByteRover
/logout [-y]            # Log out
First-time users will see an interactive onboarding flow. Press Esc at any time to skip onboarding or cancel streaming responses.

Standalone CLI Commands

Several commands are available as standalone CLI commands for scripting, automation, and quick access:
brv status                              # Show CLI and project status
brv query "How is auth implemented?"    # Query context tree
brv curate "JWT tokens expire in 24h"   # Curate context to context tree
brv init --headless --team <id> --space <id>  # Initialize project (headless)
brv login --api-key <key>               # Authenticate with API key
brv push -y                             # Push context tree
brv pull                                # Pull context tree

CLI Commands

CommandDescriptionExample
brvStart interactive REPL mode (recommended)brv
brv init [--headless] [--team] [--space]Initialize project with ByteRoverbrv init --headless --team myteam --space myspace
brv login --api-key <KEY>Authenticate with API keybrv login --api-key brv_xxx
brv status [DIRECTORY]Show CLI status and project informationbrv status
brv query <QUERY>Query information from the context treebrv query "How is auth implemented?"
brv curate [CONTEXT] [--files] [--folder]Curate context to context treebrv curate "JWT tokens expire in 24h" --files src/auth.ts
brv push [--branch] [--yes]Push context tree to cloudbrv push -b feature -y
brv pull [--branch]Pull context tree from cloudbrv pull -b feature
Note: Commands logout, space, connector, provider, model, reset, and new are only available as slash commands in REPL mode. Run brv to start REPL mode.
Important: In interactive mode, the brv query and brv curate commands require a running brv instance in the same directory (start with brv first). In headless mode (--headless flag), these commands run independently.

Command Details

Headless Mode

ByteRover CLI supports headless execution for CI/CD pipelines and automation scripts. Headless mode:
  • Runs without requiring an interactive terminal (no TTY)
  • Outputs structured data in text or JSON format
  • Fails gracefully when interactive prompts would be required
Supported Commands
CommandHeadless SupportRequired Flags
brv initYes--team, --space
brv statusYesNone
brv queryYesNone
brv curateYesNone
brv pushYes-y (skip confirmation)
brv pullYesNone
brv loginNoUse --api-key instead
Common Flags
FlagDescriptionDefault
--headlessRun without interactive promptsfalse
--format <option>Output format: text or jsontext
Examples
# Initialize project in CI pipeline
brv init --headless --team my-team --space my-space --format json

# Query context tree and get JSON response
brv query "How is auth implemented?" --headless --format json

# Push changes without confirmation
brv push --headless -y --format json

# Get status as JSON for scripting
brv status --headless --format json

brv

Start the interactive REPL mode with a React/Ink-based terminal UI. This is the recommended way to use ByteRover CLI for an enhanced user experience. Arguments None Flags None Examples
# Start interactive REPL mode
brv
Features
  • Persistent session: Stay in the CLI and run multiple commands without restarting
  • Slash commands: Use /command syntax for all operations (e.g., /login, /push, /query)
  • Interactive onboarding: First-time users get a guided setup flow (press Esc to skip)
  • Real-time feedback: See streaming responses and progress indicators
  • Escape to cancel: Press Esc to cancel streaming responses and long-running commands
  • Tab completion: Auto-complete slash commands as you type
Available Slash Commands
CommandDescription
/statusShow CLI status and project information
/curate [context] [@paths]Curate context to the context tree (use @path for file or folder references)
/query <query> (alias: /q)Query and retrieve information from context tree
/connector (alias: /connectors)Manage coding agent connectors (skill, mcp, rules, hook)
/provider (aliases: /providers, /connect)Connect to an LLM provider (e.g., OpenRouter)
/model (alias: /models)Select a model from the active provider
/push [-b branch] [-y]Push context tree to ByteRover memory storage
/pull [-b branch]Pull context tree from ByteRover memory storage
/space list [-a] [-j] [-l n] [-o n]List all spaces for current team
/space switchSwitch to a different space
/reset [-y] [directory]Reset context tree to an empty state
/new [-y]Start a fresh session (ends current, clears conversation)
/init [-f]Initialize a project with ByteRover
/loginAuthenticate with ByteRover using OAuth 2.0 + PKCE
/logout [-y]Log out of ByteRover CLI and clear authentication
Notes
  • REPL mode is the primary way to use ByteRover CLI for an interactive experience
  • Commands like logout, space, connector, provider, model, reset, and new are only available in REPL mode
  • Press Esc to cancel streaming responses or long-running commands
  • Use Ctrl+C to exit REPL mode

Slash Command Details

/status

Show CLI status including authentication state, project configuration, and context tree state. Flags: None

/curate

Curate context to the context tree using interactive or autonomous mode.
ArgumentTypeRequiredDescription
contextstringNoKnowledge context (triggers autonomous mode if provided)
File and Folder References: Use @path syntax to include files or folders (up to 5 references total). Folders are packed into a structured format. Examples
# Interactive mode (manually choose domain/topic)
/curate

# Autonomous mode with AI classification
/curate "Authentication uses JWT with 24h expiry"

# Include file references
/curate "Session handling logic" @src/auth/session.ts @src/middleware/auth.ts

# Include folder reference
/curate "Authentication module overview" @src/auth/

/query (alias: /q)

Query and retrieve information from the context tree using natural language.
ArgumentTypeRequiredDescription
querystringYesNatural language question about your codebase
Examples
/query "How is user authentication implemented?"
/q "What testing strategies are used?"

/push

Push context tree to ByteRover memory storage.
FlagDescriptionDefault
-b, --branch <name>ByteRover branch name (not Git branch)main
-y, --yesSkip confirmation prompt-
Examples
/push                    # Push to main branch
/push -b feature-auth    # Push to feature-auth branch
/push -y                 # Push without confirmation

/pull

Pull context tree from ByteRover memory storage.
FlagDescriptionDefault
-b, --branch <name>ByteRover branch name (not Git branch)main
Examples
/pull                    # Pull from main branch
/pull -b feature-auth    # Pull from feature-auth branch

/space list

List all spaces for the current team.
FlagDescriptionDefault
-a, --allFetch all spaces (may be slow for large teams)-
-j, --jsonOutput in JSON format-
-l, --limit <n>Maximum number of spaces to fetch50
-o, --offset <n>Number of spaces to skip0

/space switch

Switch to a different space. Interactive mode only - prompts you to select from available options. Flags: None

/connector (alias: /connectors)

Manage agent connectors for integrating ByteRover with AI coding assistants. Supports four connector types:
  • Skill: Writes comprehensive documentation files (SKILL.md, TROUBLESHOOTING.md, WORKFLOWS.md) to agent-specific directories. Default for Claude Code and Cursor.
  • MCP: Uses Model Context Protocol for direct tool integration (brv-query, brv-curate). Default for most other agents.
  • Rules: Generates markdown rule files that agents read for instructions. Fallback option for all agents.
  • Hook: Uses agent-specific hook systems for tighter integration (Claude Code only, legacy)
Skill Connector The skill connector creates comprehensive documentation files for AI coding assistants:
  • SKILL.md: Quick reference with command examples and best practices
  • TROUBLESHOOTING.md: Common errors, required user actions, and diagnostics
  • WORKFLOWS.md: Step-by-step patterns for 6 common scenarios (Research, Debug, Multi-file changes, etc.)
Each skill directory contains all three files and is installed in agent-specific locations:
  • Claude Code: .claude/skills/byterover/ (project-level)
  • Cursor: .cursor/skills/byterover/ (project-level)
  • Github Copilot: .github/skills/byterover/ (project-level)
  • Codex: ~/.codex/skills/byterover/ (global)
Supported Agents
AgentDefaultSupportedRules FileSkill FilesMCP Config
AmpMCPrules, mcpAGENTS.md-.vscode/settings.json
AntigravityRulesrules.agent/rules/agent-context.md--
Augment CodeMCPrules, mcp.augment/rules/agent-context.md-Manual setup
Claude CodeSkillrules, hook, mcp, skillCLAUDE.md.claude/skills/byterover/.mcp.json
ClineMCPrules, mcp.clinerules/agent-context.md-Manual setup
CodexMCPrules, mcp, skillAGENTS.md~/.codex/skills/byterover/~/.codex/config.toml
CursorSkillrules, mcp, skill.cursor/rules/agent-context.mdc.cursor/skills/byterover/.cursor/mcp.json
Gemini CLIMCPrules, mcpGEMINI.md-.gemini/settings.json
GitHub CopilotMCPrules, mcp, skill.github/copilot-instructions.md.github/skills/byterover/.vscode/mcp.json
JunieMCPrules, mcp.junie/guidelines.md-.junie/mcp/mcp.json
Kilo CodeMCPrules, mcp.kilocode/rules/agent-context.md-.kilocode/mcp.json
KiroMCPrules, mcp.kiro/steering/agent-context.md-.kiro/settings/mcp.json
QoderMCPrules, mcp.qoder/rules/agent-context.md-Manual setup
Qwen CodeMCPrules, mcpQWEN.md-Manual setup
Roo CodeMCPrules, mcp.roo/rules/agent-context.md-.roo/mcp.json
Trae.aiMCPrules, mcpproject_rules.md-Manual setup
WarpMCPrules, mcpWARP.md-Manual setup
WindsurfMCPrules, mcp.windsurf/rules/agent-context.md-~/.codeium/windsurf/mcp_config.json
ZedMCPrules, mcpagent-context.rules-.zed/settings.json
MCP Setup Modes
  • Auto setup: ByteRover automatically writes the MCP config file (most agents)
  • Manual setup: User must manually configure per agent’s documentation (Augment Code, Cline, Qoder, Qwen Code, Trae.ai, Warp)
Flags: None

/provider (aliases: /providers, /connect)

Connect to an external LLM provider for use with ByteRover’s built-in chat. Opens an interactive selection prompt. Flags: None Available Providers
ProviderDescriptionAPI Key Required
ByteRoverInternal ByteRover LLM (default, always available)No
OpenRouterAccess 200+ models from multiple providersYes
Behavior
  • Displays a selection prompt listing all available providers with connection status indicators
  • If the selected provider is already connected, it is set as the active provider immediately
  • If the selected provider requires an API key, prompts for the key and validates it before connecting
  • API keys are stored securely in the system keychain
Examples
# Open provider selection dialog
/provider

# Also accessible via aliases
/providers
/connect

/model (alias: /models)

Select a model from the currently active LLM provider. Requires a provider to be connected first via /provider. Flags: None Behavior
  • Requires an active external provider (ByteRover uses an internal model with no selection)
  • Fetches available models from the active provider’s API
  • Displays models sorted by: favorites first, then recently used, then by provider and model name
  • Shows pricing information (input/output cost per million tokens), context window size, and status indicators (Current, Favorite, Free)
  • Selected model is saved as the active model for the provider
Examples
# Open model selection dialog (requires active external provider)
/model

# Also accessible via alias
/models
Notes
  • If no external provider is connected, run /provider first
  • If the active provider is ByteRover, the command will prompt you to switch to an external provider
  • Model list depends on the connected provider (e.g., OpenRouter provides 200+ models)

/init

Initialize a project with ByteRover. Guides you through team and space selection and creates the context tree.
FlagDescription
-f, --forceForce re-initialization without confirmation prompt

/login

Authenticate with ByteRover using OAuth 2.0 + PKCE. Opens your default browser for secure authentication. Flags: None

/logout

Log out of ByteRover CLI and clear authentication credentials from the system keychain.
FlagDescription
-y, --yesSkip confirmation prompt

/reset

Reset the current context tree to an empty state. This is a destructive operation.
ArgumentTypeRequiredDescription
directorystringNoProject directory (defaults to current directory)
FlagDescription
-y, --yesSkip confirmation prompt
Examples
/reset                       # Reset with confirmation
/reset -y                    # Reset without confirmation
/reset -y /path/to/project   # Reset specific project

/new

Start a fresh session. This ends the current session and clears conversation history but does NOT affect the context tree (use /reset for that).
FlagDescription
-y, --yesSkip confirmation prompt
Examples
/new                         # Start new session with confirmation
/new -y                      # Start new session without confirmation

brv init

Initialize a project with ByteRover. Sets up team and space selection and creates the context tree. Arguments None Flags
FlagDescriptionDefault
-f, --forceForce re-initialization without confirmationfalse
--headlessRun in headless mode (no TTY required)false
--team <id>Team ID or name (required for headless mode)-
--space <id>Space ID or name (required for headless mode)-
--format <option>Output format: text or jsontext
Examples
# Interactive initialization
brv init

# Force re-initialization
brv init --force

# Headless initialization for CI/CD
brv init --headless --team my-team --space my-space
brv init --headless --team team-abc123 --space space-xyz789 --format json

brv login

Authenticate with ByteRover using an API key. Arguments None Flags
FlagDescriptionDefault
-k, --api-key <key>API key for authentication (required)-
Examples
# Authenticate with API key
brv login --api-key brv_your_api_key_here
Notes
  • Get your API key from https://app.byterover.dev/settings/keys
  • This command uses API key authentication, different from the OAuth-based /login slash command in REPL mode
  • The API key is stored securely in the system keychain

brv status

Show CLI status and project information. Displays local context tree managed by ByteRover CLI. Arguments
ArgumentTypeRequiredDescription
DIRECTORYstringNoProject directory (defaults to current directory)
Flags
FlagDescriptionDefault
-f, --format <option>Output format: text or jsontext
--headlessRun in headless mode (no TTY required)false
Examples
# Show status for current directory
brv status

# Show status for a specific directory
brv status /path/to/project

# Output status as JSON
brv status --format json

# Headless mode for CI/CD
brv status --headless --format json
Output The status command displays:
  • CLI version
  • Authentication status (logged in user or “Not logged in”)
  • Current directory
  • Project initialization status (team and space info if initialized)
  • Context tree changes (git-style diff showing modified/added/deleted files)

brv query

Query and retrieve information from the context tree using natural language. Arguments
ArgumentTypeRequiredDescription
QUERYstringYesNatural language question about your project
Flags
FlagDescriptionDefault
--headlessRun in headless mode (no TTY required)false
--format <option>Output format: text or jsontext
Examples
# Query about implementation details
brv query "How is user authentication implemented?"
brv query "What are the API rate limits and where are they enforced?"

# Query about project structure
brv query "What testing strategies are used?"

# Headless mode for scripting
brv query "What are the API endpoints?" --headless --format json
Notes
  • Interactive mode: Requires a running brv instance in the same directory (start with brv in another terminal)
  • Headless mode: Runs independently without requiring a separate instance
  • Context tree must exist (run /init or brv init first)
  • Uses AI to search and analyze your context tree
  • Best results with specific, detailed questions
  • Avoid vague queries like “auth” or “show me code”

brv curate

Curate context to the context tree using interactive or autonomous mode. Arguments
ArgumentTypeRequiredDescription
CONTEXTstringNoKnowledge context (triggers autonomous mode if provided)
Flags
FlagDescriptionDefault
-f, --files <paths>Include specific file paths for critical context (max 5 files). Use multiple -f flags for multiple pathsNone
-d, --folder <paths>Folder path to pack and analyze (triggers folder pack flow). Use multiple -d flags for multiple foldersNone
--headlessRun in headless mode (no TTY required)false
--format <option>Output format: text or jsontext
Examples
# Interactive mode (manually choose domain/topic)
brv curate

# Autonomous mode with AI classification
brv curate "User authentication uses JWT tokens with 24h expiry"
brv curate "React components follow atomic design pattern"

# Include file references for context
brv curate "This module handles user sessions" -f src/auth/session.ts
brv curate "JWT authentication implementation" --files src/auth/jwt.ts --files docs/auth.md
brv curate "Auth logic" -f src/auth.ts -f src/middleware/auth.ts

# Folder pack - analyze and curate entire folder
brv curate "Authentication module overview" --folder src/auth/
brv curate --folder src/auth/
brv curate "Analyze authentication module" -d src/auth/

# Headless mode for CI/CD
brv curate "Auth uses JWT tokens" --headless --format json
Notes
  • Interactive mode: Requires a running brv instance in the same directory (start with brv in another terminal)
  • Headless mode: Runs independently without requiring a separate instance
  • Context tree must exist (run /init or brv init first)
  • Interactive mode (without context): Navigate context tree, select domain/topic, creates markdown file with descriptive name
  • Autonomous mode (with context): ByteRover agent automatically determines best location and adds content
  • File references: Up to 5 files with --files / -f flag in CLI mode, or @path syntax in REPL mode. Files must be text files within the project directory
  • Folder references: Use --folder / -d flag in CLI mode, or @folder/ syntax in REPL mode. Folder contents are packed into a structured format for analysis

brv push

Push context tree to ByteRover memory storage. Arguments None Flags
FlagDescriptionDefault
-b, --branch <name>ByteRover branch name (not Git branch)main
-y, --yesSkip confirmation promptfalse
--headlessRun in headless mode (no TTY required)false
--format <option>Output format: text or jsontext
Examples
# Push to main branch with confirmation
brv push

# Push to feature branch
brv push --branch feature-auth

# Push without confirmation (for scripts)
brv push -y

# Headless mode for CI/CD
brv push --headless -y --format json

brv pull

Pull context tree from ByteRover memory storage. Arguments None Flags
FlagDescriptionDefault
-b, --branch <name>ByteRover branch name (not Git branch)main
--headlessRun in headless mode (no TTY required)false
--format <option>Output format: text or jsontext
Examples
# Pull from main branch
brv pull

# Pull from feature branch
brv pull --branch feature-auth

# Headless mode for CI/CD
brv pull --headless --format json

Global Options

ByteRover CLI provides these global options:
FlagDescriptionExample
--helpShow help for commandbrv --help, brv status --help
--versionShow CLI versionbrv --version

File Structure

ByteRover CLI creates the following directory structure in your project:
.brv/
├── config.json                # Project configuration (team/space)
└── context-tree/              # Your knowledge base (starts empty)
    └── .snapshot.json         # Latest context tree snapshot
Key Files and Directories
  • config.json: Stores your team ID, space ID, and project metadata
  • context-tree/: Hierarchical structure organizing project knowledge by domains and topics (created as you curate)
  • .snapshot.json: Version control snapshot tracking context tree changes over time
Example structure after curating:
.brv/context-tree/
├── code_style/
│   └── error_handling/
│       └── custom_error_classes.md
├── design/
│   └── components/
│       └── button_variants.md
├── structure/
│   └── api_endpoints/
│       └── rest_api_structure.md
└── testing/
    └── integration_tests/
        └── api_testing_patterns.md
Each topic folder contains markdown files with descriptive names based on their content.