byterover-cli-memory-layer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ByteRover CLI Memory Layer

ByteRover CLI 内存层

Skill by ara.so — Devtools Skills collection.
ByteRover CLI (
brv
) provides AI coding agents with persistent, structured memory. It creates a context tree for project knowledge, supports version control for context, syncs to the cloud, and enables sharing across tools and teammates. This skill teaches you to use ByteRover as a memory layer for autonomous coding workflows.
ara.so提供的技能——开发工具技能合集。
ByteRover CLI(
brv
)为AI编码代理提供持久化的结构化内存。它为项目知识创建上下文树,支持上下文的版本控制,可同步至云端,并能在工具和团队成员间共享。本技能将教你如何把ByteRover作为自主编码工作流的内存层使用。

What ByteRover Does

ByteRover 的功能

ByteRover gives AI agents:
  • Persistent memory across sessions via a local context tree
  • Knowledge curation — store decisions, patterns, and domain knowledge
  • Context retrieval — semantic search over project knowledge
  • Version control — branch, commit, merge, and sync context like code
  • Cloud sync — share context across machines and teammates
  • Multi-LLM support — works with 20+ providers (Anthropic, OpenAI, Google, etc.)
  • Agent tools — 24 built-in tools for file ops, code exec, memory management
  • MCP integration — Model Context Protocol server for agent interop
ByteRover 为AI代理提供:
  • 跨会话持久化内存:通过本地上下文树实现
  • 知识整理——存储决策、模式和领域知识
  • 上下文检索——对项目知识进行语义搜索
  • 版本控制——像代码一样对上下文进行分支、提交、合并和同步
  • 云同步——在多台设备和团队成员间共享上下文
  • 多LLM支持——兼容20+提供商(Anthropic、OpenAI、Google等)
  • 代理工具——24个内置工具,用于文件操作、代码执行、内存管理
  • MCP集成——用于代理互操作的Model Context Protocol服务器

Installation

安装

Shell Script (macOS & Linux)

Shell脚本(macOS & Linux)

No Node.js required:
bash
curl -fsSL https://byterover.dev/install.sh | sh
无需Node.js:
bash
curl -fsSL https://byterover.dev/install.sh | sh

npm (All Platforms)

npm(全平台)

Requires Node.js >= 20:
bash
npm install -g byterover-cli
要求Node.js >= 20:
bash
npm install -g byterover-cli

Verify Installation

验证安装

bash
brv --version
bash
brv --version

Quick Start

快速开始

Initialize in a Project

在项目中初始化

Navigate to your project directory and start the REPL:
bash
cd ~/my-project
brv
On first run, ByteRover auto-configures. You'll see an interactive REPL. Type
/
to list commands.
导航到你的项目目录并启动REPL:
bash
cd ~/my-project
brv
首次运行时,ByteRover会自动配置。你将看到一个交互式REPL,输入
/
可列出命令。

Open the Web Dashboard

打开Web控制台

The primary UI is the web dashboard:
bash
brv webui
This opens a browser interface for curating context, querying knowledge, reviewing changes, and managing sync.
主要UI是Web控制台:
bash
brv webui
这会打开一个浏览器界面,用于整理上下文、查询知识、查看变更和管理同步。

Core Commands

核心命令

Curate Context (Add Knowledge)

整理上下文(添加知识)

Add project knowledge from the REPL:
/curate "Authentication uses JWT with 24h expiry and refresh tokens" @src/auth/jwt.ts
Or from the CLI:
bash
brv curate -m "API rate limiting: 100 req/min per IP, enforced in middleware" -f src/middleware/ratelimit.ts
Curate operations are pending by default and require review.
从REPL添加项目知识:
/curate "认证使用JWT,有效期24小时并支持刷新令牌" @src/auth/jwt.ts
或通过CLI:
bash
brv curate -m "API限流规则:每个IP每分钟100次请求,由中间件强制执行" -f src/middleware/ratelimit.ts
整理操作默认处于待处理状态,需要审核。

Query Knowledge

查询知识

Search the context tree:
/query How is authentication implemented?
Or:
bash
brv query "What rate limiting rules are in place?"
搜索上下文树:
/query 认证是如何实现的?
或:
bash
brv query "当前有哪些限流规则?"

Review Pending Changes

审核待处理变更

List pending curate operations:
bash
brv review pending
Approve a specific operation:
bash
brv review approve <operation-id>
Reject an operation:
bash
brv review reject <operation-id>
列出待处理的整理操作:
bash
brv review pending
批准特定操作:
bash
brv review approve <operation-id>
拒绝操作:
bash
brv review reject <operation-id>

View Curate History

查看整理历史

bash
brv curate view
bash
brv curate view

Check Status

检查状态

bash
brv status
Shows project location, daemon status, active model, and sync state.
bash
brv status
显示项目位置、守护进程状态、活跃模型和同步状态。

Version Control for Context

上下文版本控制

ByteRover supports Git-like version control for the context tree.
ByteRover支持类Git的上下文树版本控制。

Initialize Version Control

初始化版本控制

bash
brv vc init
This creates
.brv/vc/
and sets up version tracking.
bash
brv vc init
这会创建
.brv/vc/
并设置版本跟踪。

Stage and Commit Changes

暂存并提交变更

bash
brv vc add .                          # Stage all changes
brv vc commit -m "Add auth context"   # Commit staged changes
bash
brv vc add .                          # 暂存所有变更
brv vc commit -m "添加认证上下文"   # 提交暂存的变更

View Commit History

查看提交历史

bash
brv vc log
bash
brv vc log

Branching

分支管理

bash
brv vc branch feature-auth            # Create a branch
brv vc checkout feature-auth          # Switch to it
brv vc branch                         # List branches
bash
brv vc branch feature-auth            # 创建分支
brv vc checkout feature-auth          # 切换分支
brv vc branch                         # 列出分支

Merge Branches

合并分支

bash
brv vc checkout main
brv vc merge feature-auth
bash
brv vc checkout main
brv vc merge feature-auth

Push and Pull from Cloud

向云端推送和拉取

Push commits to ByteRover Cloud:
bash
brv vc push
Pull commits from cloud:
bash
brv vc pull
Clone a shared space repository:
bash
brv vc clone <space-id>
将提交推送到ByteRover Cloud:
bash
brv vc push
从云端拉取提交:
bash
brv vc pull
克隆共享空间仓库:
bash
brv vc clone <space-id>

Cloud Sync (Legacy)

云同步(旧版)

The original push/pull commands create snapshots (not version-controlled):
bash
brv push    # Snapshot context to cloud
brv pull    # Restore context from cloud
Prefer
brv vc push
/
brv vc pull
for version-controlled sync.
原始的push/pull命令用于创建快照(无版本控制):
bash
brv push    # 将上下文快照上传至云端
brv pull    # 从云端恢复上下文
推荐使用
brv vc push
/
brv vc pull
进行带版本控制的同步。

LLM Provider Configuration

LLM提供商配置

List Available Providers

列出可用提供商

bash
brv providers list
Supported: Anthropic, OpenAI, Google, Groq, Mistral, xAI, Cerebras, Cohere, DeepInfra, DeepSeek, OpenRouter, Perplexity, TogetherAI, Vercel, Minimax, Moonshot, GLM, OpenAI-Compatible, ByteRover.
bash
brv providers list
支持的提供商:Anthropic、OpenAI、Google、Groq、Mistral、xAI、Cerebras、Cohere、DeepInfra、DeepSeek、OpenRouter、Perplexity、TogetherAI、Vercel、Minimax、Moonshot、GLM、OpenAI-Compatible、ByteRover。

Connect a Provider

连接提供商

bash
brv providers connect
Follow the prompts to enter your API key (stored securely in
.brv/config.json
).
Or set environment variables:
bash
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
bash
brv providers connect
按照提示输入API密钥(安全存储在
.brv/config.json
中)。
或设置环境变量:
bash
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...

Switch Active Provider

切换活跃提供商

bash
brv providers switch
bash
brv providers switch

List and Switch Models

列出并切换模型

bash
brv model list
brv model switch
bash
brv model list
brv model switch

Real-World Usage Patterns

实际使用模式

Pattern 1: Curate API Design Decisions

模式1:整理API设计决策

When you make a design decision, record it immediately:
bash
brv curate -m "User endpoints: POST /users (create), GET /users/:id (read), PATCH /users/:id (update). All require JWT auth except public profile GET /users/:id/profile." -f src/routes/users.ts
Then query later:
bash
brv query "What are the user endpoints and their auth requirements?"
当你做出设计决策时,立即记录:
bash
brv curate -m "用户端点:POST /users(创建)、GET /users/:id(读取)、PATCH /users/:id(更新)。除公开资料接口GET /users/:id/profile外,所有接口都需要JWT认证。" -f src/routes/users.ts
之后可查询:
bash
brv query "用户端点有哪些,各自的认证要求是什么?"

Pattern 2: Document Complex Business Logic

模式2:记录复杂业务逻辑

bash
brv curate -m "Order processing: validate inventory -> reserve stock -> charge payment -> fulfill. Rollback if payment fails. Stock reservation expires after 15 minutes." -f src/services/orders.ts
bash
brv curate -m "订单处理流程:验证库存 -> 预留库存 -> 收取款项 -> 发货。如果付款失败则回滚。库存预留15分钟后过期。" -f src/services/orders.ts

Pattern 3: Record Configuration Patterns

模式3:记录配置模式

bash
brv curate -m "Database: Postgres 14, connection pool max 20, timeout 30s. Migrations via Prisma. Replica for read-heavy queries in production." -f prisma/schema.prisma
bash
brv curate -m "数据库:Postgres 14,连接池最大20个连接,超时30秒。通过Prisma执行迁移。生产环境中读密集型查询使用副本。" -f prisma/schema.prisma

Pattern 4: Share Context with Team

模式4:与团队共享上下文

After curating knowledge locally:
bash
brv vc add .
brv vc commit -m "Add order processing and DB config context"
brv vc push
Teammate pulls:
bash
brv vc pull
They now have the same context tree.
在本地整理知识后:
bash
brv vc add .
brv vc commit -m "添加订单处理和数据库配置上下文"
brv vc push
团队成员拉取:
bash
brv vc pull
他们现在拥有相同的上下文树。

Pattern 5: Query Before Implementing

模式5:实现前先查询

Before writing new code, check existing patterns:
bash
brv query "How do we handle error logging and monitoring?"
Use the answer to stay consistent with established patterns.
编写新代码前,检查现有模式:
bash
brv query "我们如何处理错误日志和监控?"
使用查询结果保持与现有模式一致。

Worktrees and Knowledge Sources

工作树与知识源

What Are Worktrees?

什么是工作树?

A worktree is a subdirectory link to a parent project. It avoids creating nested
.brv/
directories.
Use case: Monorepo with multiple packages, each needs ByteRover but should share one context tree.
工作树是指向父项目的子目录链接。它避免创建嵌套的
.brv/
目录。
使用场景:包含多个包的单体仓库,每个包需要ByteRover但应共享同一个上下文树。

Add a Worktree

添加工作树

From the project root:
bash
brv worktree add ./packages/api
This creates
.brv
pointer file in
./packages/api
that redirects to the parent
.brv/
.
从项目根目录执行:
bash
brv worktree add ./packages/api
这会在
./packages/api
中创建
.brv
指针文件,指向父目录的
.brv/

List Worktrees

列出工作树

bash
brv worktree list
bash
brv worktree list

Remove a Worktree

删除工作树

bash
brv worktree remove ./packages/api
bash
brv worktree remove ./packages/api

What Are Sources?

什么是知识源?

A source is a read-only reference to another project's knowledge.
Use case: Frontend app wants to query the backend's context tree without duplicating it.
知识源是对另一个项目知识的只读引用。
使用场景:前端应用想要查询后端的上下文树但不想重复复制。

Add a Source

添加知识源

bash
brv source add ../backend-project
Now
brv query
searches both local and source knowledge.
bash
brv source add ../backend-project
现在
brv query
会同时搜索本地和知识源的知识。

List and Remove Sources

列出并删除知识源

bash
brv source list
brv source remove ../backend-project
bash
brv source list
brv source remove ../backend-project

MCP Server (Model Context Protocol)

MCP服务器(Model Context Protocol)

ByteRover implements MCP for agent interop.
ByteRover实现了MCP以支持代理互操作。

Start the MCP Server

启动MCP服务器

bash
brv mcp
This runs a JSON-RPC server that exposes ByteRover tools (curate, query, file ops, etc.) to MCP clients.
bash
brv mcp
这会运行一个JSON-RPC服务器,向MCP客户端暴露ByteRover工具(整理、查询、文件操作等)。

Configure MCP Client

配置MCP客户端

Example
claude_desktop_config.json
:
json
{
  "mcpServers": {
    "byterover": {
      "command": "brv",
      "args": ["mcp"]
    }
  }
}
Claude Desktop can now call ByteRover tools directly.
示例
claude_desktop_config.json
json
{
  "mcpServers": {
    "byterover": {
      "command": "brv",
      "args": ["mcp"]
    }
  }
}
Claude Desktop现在可以直接调用ByteRover工具。

Hub and Connectors

Hub与连接器

ByteRover Hub hosts reusable skills and bundles.
ByteRover Hub托管可复用的技能和包。

List Available Packages

列出可用包

bash
brv hub list
bash
brv hub list

Install a Package

安装包

bash
brv hub install <package-name>
bash
brv hub install <package-name>

Add a Custom Registry

添加自定义注册表

bash
brv hub registry add my-registry https://registry.example.com
bash
brv hub registry add my-registry https://registry.example.com

List and Remove Registries

列出并删除注册表

bash
brv hub registry list
brv hub registry remove my-registry
bash
brv hub registry list
brv hub registry remove my-registry

Connectors

连接器

Connectors extend ByteRover with integrations (e.g., GitHub, Slack).
bash
brv connectors list
brv connectors install github-connector
连接器为ByteRover扩展集成功能(如GitHub、Slack)。
bash
brv connectors list
brv connectors install github-connector

Configuration

配置

ByteRover stores config in
.brv/config.json
at the project root.
ByteRover将配置存储在项目根目录的
.brv/config.json
中。

Typical Config Structure

典型配置结构

json
{
  "projectId": "abc123",
  "spaceId": "space-xyz",
  "providers": {
    "anthropic": {
      "apiKey": "sk-ant-..."
    },
    "openai": {
      "apiKey": "sk-..."
    }
  },
  "activeProvider": "anthropic",
  "activeModel": "claude-3-5-sonnet-20241022",
  "reviewEnabled": true
}
json
{
  "projectId": "abc123",
  "spaceId": "space-xyz",
  "providers": {
    "anthropic": {
      "apiKey": "sk-ant-..."
    },
    "openai": {
      "apiKey": "sk-..."
    }
  },
  "activeProvider": "anthropic",
  "activeModel": "claude-3-5-sonnet-20241022",
  "reviewEnabled": true
}

Environment Variables

环境变量

Override config with env vars:
bash
export BRV_ANTHROPIC_API_KEY=sk-ant-...
export BRV_OPENAI_API_KEY=sk-...
export BRV_ACTIVE_PROVIDER=openai
export BRV_ACTIVE_MODEL=gpt-4o
使用环境变量覆盖配置:
bash
export BRV_ANTHROPIC_API_KEY=sk-ant-...
export BRV_OPENAI_API_KEY=sk-...
export BRV_ACTIVE_PROVIDER=openai
export BRV_ACTIVE_MODEL=gpt-4o

Enable/Disable Review Workflow

启用/禁用审核工作流

By default, curate operations are pending. Disable review to auto-approve:
bash
undefined
默认情况下,整理操作处于待处理状态。禁用审核可自动批准:
bash
undefined

Edit .brv/config.json

编辑.brv/config.json

{ "reviewEnabled": false }

Or via env:

```bash
export BRV_REVIEW_ENABLED=false
{ "reviewEnabled": false }

或通过环境变量:

```bash
export BRV_REVIEW_ENABLED=false

Authentication to ByteRover Cloud

ByteRover Cloud认证

Login

登录

Get an API key from app.byterover.dev/settings/keys, then:
bash
brv login
Enter your API key when prompted.
app.byterover.dev/settings/keys获取API密钥,然后执行:
bash
brv login
按提示输入API密钥。

Logout

登出

bash
brv logout
bash
brv logout

Troubleshooting

故障排除

Daemon Not Running

守护进程未运行

If
brv status
shows "Daemon not running":
bash
brv restart
如果
brv status
显示“Daemon not running”:
bash
brv restart

API Key Not Recognized

API密钥未被识别

Ensure the key is set:
bash
brv providers list  # Check if provider is connected
brv providers connect  # Re-enter API key
Or verify env var:
bash
echo $ANTHROPIC_API_KEY
确保密钥已设置:
bash
brv providers list  # 检查提供商是否已连接
brv providers connect  # 重新输入API密钥
或验证环境变量:
bash
echo $ANTHROPIC_API_KEY

Curate Operations Not Appearing

整理操作未显示

Check if review is enabled. If so, operations are pending:
bash
brv review pending
brv review approve <operation-id>
检查是否启用了审核。如果启用,操作处于待处理状态:
bash
brv review pending
brv review approve <operation-id>

Query Returns No Results

查询无结果返回

  • Ensure you've curated knowledge first
  • Check that files are indexed:
    brv status
  • Verify active model supports embeddings
  • 确保已先整理知识
  • 检查文件是否已索引:
    brv status
  • 验证活跃模型支持嵌入功能

Version Control Conflicts

版本控制冲突

If
brv vc pull
fails due to conflicts:
bash
brv vc status           # See conflicting files
如果
brv vc pull
因冲突失败:
bash
brv vc status           # 查看冲突文件

Manually resolve conflicts in .brv/vc/

手动解决.brv/vc/中的冲突

brv vc add . brv vc commit -m "Resolve merge conflicts"
undefined
brv vc add . brv vc commit -m "解决合并冲突"
undefined

Push Fails (Not Authenticated)

推送失败(未认证)

bash
brv login
brv vc push
bash
brv login
brv vc push

Worktree Not Recognized

工作树未被识别

Ensure
.brv
pointer file exists in the worktree directory and points to the correct parent:
bash
cat packages/api/.brv
确保工作树目录中存在
.brv
指针文件,且指向正确的父目录:
bash
cat packages/api/.brv

Should contain: gitdir: ../../.brv

应包含:gitdir: ../../.brv


If missing, re-add:

```bash
brv worktree add ./packages/api

如果缺失,重新添加:

```bash
brv worktree add ./packages/api

TypeScript API Usage (Advanced)

TypeScript API使用(进阶)

ByteRover is primarily a CLI, but you can use its internal APIs in TypeScript projects.
ByteRover主要是CLI工具,但你也可以在TypeScript项目中使用其内部API。

Install as Dependency

安装为依赖

bash
npm install byterover-cli
bash
npm install byterover-cli

Example: Programmatic Curate

示例:程序化整理

typescript
import { BrvClient } from 'byterover-cli';

const client = new BrvClient({
  projectRoot: process.cwd(),
});

await client.curate({
  message: "User service uses bcrypt for password hashing, cost factor 12",
  files: ['src/services/user.ts'],
});

console.log('Context curated');
typescript
import { BrvClient } from 'byterover-cli';

const client = new BrvClient({
  projectRoot: process.cwd(),
});

await client.curate({
  message: "用户服务使用bcrypt进行密码哈希,成本因子为12",
  files: ['src/services/user.ts'],
});

console.log('上下文已整理');

Example: Programmatic Query

示例:程序化查询

typescript
import { BrvClient } from 'byterover-cli';

const client = new BrvClient({
  projectRoot: process.cwd(),
});

const results = await client.query({
  query: "How is password hashing implemented?",
});

console.log(results.answer);
typescript
import { BrvClient } from 'byterover-cli';

const client = new BrvClient({
  projectRoot: process.cwd(),
});

const results = await client.query({
  query: "密码哈希是如何实现的?",
});

console.log(results.answer);

Example: Start REPL Programmatically

示例:程序化启动REPL

typescript
import { startRepl } from 'byterover-cli';

await startRepl({
  projectRoot: process.cwd(),
  provider: 'anthropic',
  model: 'claude-3-5-sonnet-20241022',
});
typescript
import { startRepl } from 'byterover-cli';

await startRepl({
  projectRoot: process.cwd(),
  provider: 'anthropic',
  model: 'claude-3-5-sonnet-20241022',
});

Best Practices

最佳实践

  1. Curate Early and Often — Don't wait until the end of a feature. Curate decisions as you make them.
  2. Use Specific File References — Always attach relevant files to curate operations for better context linking.
  3. Enable Review in Team Settings — Prevent accidental or low-quality context pollution.
  4. Commit Context Like Code — Use
    brv vc commit
    with meaningful messages for traceability.
  5. Sync Regularly — Push and pull context changes daily in team environments.
  6. Query Before Coding — Check existing patterns and decisions before implementing new features.
  7. Use Worktrees for Monorepos — Avoid nested
    .brv/
    directories by linking packages to a single root.
  8. Add Sources for Cross-Project References — Link related projects to search their knowledge without duplication.
  9. Leverage MCP for Agent Interop — Let other AI tools (Claude Desktop, etc.) access ByteRover's memory.
  10. Document Configuration in Context — Curate environment setup, deployment steps, and config patterns so agents can reproduce them.
  1. 尽早且经常整理 — 不要等到功能开发完成再整理,做出决策后立即记录。
  2. 使用特定文件引用 — 始终为整理操作关联相关文件,以实现更好的上下文链接。
  3. 团队环境启用审核 — 防止意外或低质量的上下文污染。
  4. 像代码一样提交上下文 — 使用
    brv vc commit
    并添加有意义的消息,便于追溯。
  5. 定期同步 — 在团队环境中,每天推送和拉取上下文变更。
  6. 编码前先查询 — 实现新功能前,检查现有模式和决策。
  7. 单体仓库使用工作树 — 通过链接包到单个根目录,避免嵌套
    .brv/
    目录。
  8. 添加跨项目知识源 — 关联相关项目,无需复制即可搜索其知识。
  9. 利用MCP实现代理互操作 — 让其他AI工具(如Claude Desktop)访问ByteRover的内存。
  10. 在上下文中记录配置 — 整理环境设置、部署步骤和配置模式,以便代理可以重现。

Common Workflows

常见工作流

Workflow 1: Solo Developer, Daily Usage

工作流1:独立开发者日常使用

bash
cd ~/my-project
brv                                   # Start REPL
bash
cd ~/my-project
brv                                   # 启动REPL

In REPL:

在REPL中:

/curate "Redis caching: 1h TTL for user sessions, 5m for API responses" @src/cache.ts /query "What are the caching rules?"
/curate "Redis缓存:用户会话TTL为1小时,API响应TTL为5分钟" @src/cache.ts /query "缓存规则是什么?"

Exit REPL

退出REPL

brv vc add . brv vc commit -m "Add caching context" brv vc push # Backup to cloud
undefined
brv vc add . brv vc commit -m "添加缓存上下文" brv vc push # 备份到云端
undefined

Workflow 2: Team Collaboration

工作流2:团队协作

Developer A:
bash
brv curate -m "API versioning: v1 in /api/v1, v2 in /api/v2. Deprecate v1 endpoints after 6 months." -f src/routes/index.ts
brv review approve $(brv review pending --json | jq -r '.[0].id')
brv vc add .
brv vc commit -m "Document API versioning policy"
brv vc push
Developer B:
bash
brv vc pull
brv query "What is the API versioning policy?"
开发者A:
bash
brv curate -m "API版本控制:v1在/api/v1,v2在/api/v2。v1端点将在6个月后弃用。" -f src/routes/index.ts
brv review approve $(brv review pending --json | jq -r '.[0].id')
brv vc add .
brv vc commit -m "记录API版本控制策略"
brv vc push
开发者B:
bash
brv vc pull
brv query "API版本控制策略是什么?"

Gets the answer immediately

立即得到答案

undefined
undefined

Workflow 3: Onboarding New Team Members

工作流3:新团队成员入职

New developer clones the repo and context:
bash
git clone https://github.com/myteam/myproject.git
cd myproject
brv vc clone <space-id>               # Clone shared context
brv query "How do I set up the development environment?"
新开发者克隆仓库和上下文:
bash
git clone https://github.com/myteam/myproject.git
cd myproject
brv vc clone <space-id>               # 克隆共享上下文
brv query "如何搭建开发环境?"

ByteRover returns curated setup instructions

ByteRover返回整理好的安装说明

undefined
undefined

Workflow 4: Multi-Project Reference

工作流4:跨项目引用

Frontend project references backend context:
bash
cd ~/frontend-app
brv source add ../backend-api
brv query "What are the available API endpoints?"
前端项目引用后端上下文:
bash
cd ~/frontend-app
brv source add ../backend-api
brv query "有哪些可用的API端点?"

Searches both frontend and backend context

同时搜索前端和后端上下文

undefined
undefined

Integration with AI Coding Agents

与AI编码代理集成

ByteRover works with 22+ AI coding agents. Here's how to integrate:
ByteRover兼容22+AI编码代理。以下是集成方法:

Cursor

Cursor

Add to
.cursorrules
or workspace settings:
When working on this project, use ByteRover CLI (brv) to query and curate context.
Before implementing features, run: brv query "relevant question"
After making architectural decisions, run: brv curate -m "decision" -f <files>
添加到
.cursorrules
或工作区设置:
处理此项目时,使用ByteRover CLI(brv)查询和整理上下文。
实现功能前,运行:brv query "相关问题"
做出架构决策后,运行:brv curate -m "决策内容" -f <文件路径>

Claude Code / Cline

Claude Code / Cline

In system prompt or project instructions:
This project uses ByteRover for persistent memory. Use `brv query` to search project knowledge before coding. Use `brv curate` to record important decisions and patterns.
在系统提示或项目说明中添加:
本项目使用ByteRover作为持久化内存。编码前使用`brv query`搜索项目知识。使用`brv curate`记录重要决策和模式。

Windsurf

Windsurf

Add to project docs or cascade rules:
undefined
添加到项目文档或级联规则:
undefined

ByteRover Memory Layer

ByteRover内存层

  • Query context:
    brv query "<question>"
  • Add context:
    brv curate -m "<knowledge>" -f <files>
  • Sync with team:
    brv vc push
    after curating
undefined
  • 查询上下文:
    brv query "<问题>"
  • 添加上下文:
    brv curate -m "<知识内容>" -f <文件路径>
  • 与团队同步:整理后运行
    brv vc push
undefined

MCP-Compatible Agents

MCP兼容代理

Configure MCP client (e.g., Claude Desktop):
json
{
  "mcpServers": {
    "byterover": {
      "command": "brv",
      "args": ["mcp"]
    }
  }
}
Agent can now call ByteRover tools directly without shell commands.
配置MCP客户端(如Claude Desktop):
json
{
  "mcpServers": {
    "byterover": {
      "command": "brv",
      "args": ["mcp"]
    }
  }
}
代理现在无需shell命令即可直接调用ByteRover工具。

Summary

总结

ByteRover CLI is a memory layer for AI coding agents. It stores project knowledge in a version-controlled context tree, syncs to the cloud, and enables semantic search across team and project boundaries. Use
brv curate
to add knowledge,
brv query
to retrieve it, and
brv vc push/pull
to collaborate. Integrate with AI agents via shell commands or MCP for autonomous, context-aware coding workflows.
ByteRover CLI是AI编码代理的内存层。它将项目知识存储在带版本控制的上下文树中,可同步至云端,并支持跨团队和项目边界的语义搜索。使用
brv curate
添加知识,
brv query
检索知识,
brv vc push/pull
进行协作。通过shell命令或MCP与AI代理集成,实现自主的上下文感知编码工作流。