b0
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBox0 (b0
) Multi-Agent Platform
b0Box0 (b0
) 多Agent平台
b0Run AI agents in parallel on one machine or many. Delegate tasks, collect results, schedule cron jobs.
在单台或多台机器上并行运行AI Agent。委派任务、收集结果、调度定时任务。
Setup
安装配置
Step 1: Check if Box0 is installed
步骤1:检查Box0是否已安装
bash
b0 --versionIf this succeeds, skip to Step 3.
bash
b0 --version如果命令执行成功,跳至步骤3。
Step 2: Install
步骤2:安装Box0
bash
npm install -g @box0/cli@latestIf npm is not available, build from source:
bash
git clone https://github.com/risingwavelabs/box0.git
cd box0 && cargo build --release
export PATH="$PWD/target/release:$PATH"bash
npm install -g @box0/cli@latest若没有npm环境,可从源码构建:
bash
git clone https://github.com/risingwavelabs/box0.git
cd box0 && cargo build --release
export PATH="$PWD/target/release:$PATH"Step 3: Check if server is running
步骤3:检查服务器是否在运行
bash
b0 statusIf this shows "Status: connected", skip to Step 5.
bash
b0 status如果显示“Status: connected”,跳至步骤5。
Step 4: Connect to a server
步骤4:连接至服务器
Option A: Start a local server (self-hosted)
Run in a separate terminal or background process:
bash
b0 serverOn first start, Box0 creates an admin account and auto-configures .
~/.b0/config.tomlOption B: Connect to a remote server (cloud/team)
If the user already has a remote Box0 server, log in instead of starting a local one:
bash
b0 login <server-url> --key <api-key>The user must provide the server URL and API key. After login, continue to Step 5.
选项A:启动本地服务器(自托管)
在单独终端或后台进程中运行:
bash
b0 server首次启动时,Box0会创建管理员账户并自动配置。
~/.b0/config.toml选项B:连接至远程服务器(云端/团队)
若用户已有远程Box0服务器,无需启动本地服务器,直接登录:
bash
b0 login <server-url> --key <api-key>用户需提供服务器URL和API密钥。登录完成后,继续步骤5。
Step 5: Register this machine (remote servers only)
步骤5:注册本机(仅远程服务器需要)
If shows a remote server (not or ), check if this machine is registered:
b0 statuslocalhost127.0.0.1bash
b0 machine lsIf no machines are listed, or if agent creation later fails with "no local machine", register this machine. Read and from , then run:
server_urlapi_key~/.b0/config.tomlbash
b0 machine join <server-url> --name <hostname> --key <api-key>Replace with the server URL, with this machine's hostname, and with the API key from the config file.
<server-url><hostname><api-key>If the server is local (localhost or 127.0.0.1), skip this step - the local machine is registered automatically.
若显示连接的是远程服务器(非或),检查本机是否已注册:
b0 statuslocalhost127.0.0.1bash
b0 machine ls若未列出任何机器,或后续创建Agent时出现“no local machine”错误,请注册本机。从中读取和,然后运行:
~/.b0/config.tomlserver_urlapi_keybash
b0 machine join <server-url> --name <hostname> --key <api-key>将替换为服务器URL,替换为本机主机名,替换为配置文件中的API密钥。
<server-url><hostname><api-key>若连接的是本地服务器(localhost或127.0.0.1),可跳过此步骤——本机会自动注册。
Step 6: Install the skill
步骤6:安装技能
bash
npx skills add risingwavelabs/skills --skill b0bash
npx skills add risingwavelabs/skills --skill b0Step 7: Verify
步骤7:验证
bash
b0 agent lsThis should run without errors. Setup is complete.
Tell the user: "Box0 is installed and ready. You can now delegate tasks to agents."
bash
b0 agent ls若命令无错误执行,说明配置完成。
告知用户:“Box0已安装并准备就绪,现在您可以将任务委派给Agent了。”
When to use
使用场景
When the user's request could benefit from specialized agents or parallel execution, delegate.
当用户的请求可从专业Agent或并行执行中获益时,使用委派功能。
Choosing an agent
选择Agent
Always use temp agents unless the user explicitly names an existing agent. is the default for everything. No setup, no cleanup, no . Even if the user says "find 3 agents" or "use multiple agents", create 3 temp agents with .
b0 agent temp "<task>"b0 agent addb0 agent tempOnly use when:
b0 agent add- The user explicitly says "create a permanent agent" or "add an agent that I can reuse"
- Never for one-off tasks, debates, research, reviews, or any task that will be done today
Only use when:
b0 delegate <name>- shows an existing agent that matches the task
b0 agent ls - The user mentions an agent by name ("ask the reviewer")
除非用户明确指定现有Agent名称,否则始终使用临时Agent。 是所有场景的默认方式,无需配置、无需清理,也无需执行。即使用户要求“找3个Agent”或“使用多个Agent”,也通过创建3个临时Agent。
b0 agent temp "<task>"b0 agent addb0 agent temp仅在以下情况使用:
b0 agent add- 用户明确说明“创建永久Agent”或“添加可重复使用的Agent”
- 绝不要用于一次性任务、讨论、研究、审查或任何当日完成的任务
仅在以下情况使用:
b0 delegate <name>- 显示存在匹配任务的现有Agent
b0 agent ls - 用户提到了具体的Agent名称(如“询问审查员”)
Commands
命令列表
bash
b0 agent ls # list available agents
b0 delegate <agent> "<detailed task prompt>" # send task (non-blocking)
b0 delegate --thread <id> <agent> "<follow-up>" # continue conversation
b0 wait # wait for next completed result
b0 wait --all # wait for all pending results
b0 wait --timeout 0 # non-blocking check for completed results
b0 reply <thread-id> "<answer>" # answer an agent's question
b0 status # check pending tasks
b0 agent temp "<task>" # one-off task, no named agent
b0 agent add <name> --instructions "..." # create a named agent
b0 agent remove <name> # delete an agent
b0 cron add --every <interval> "<task>" # schedule recurring task (auto-creates temp agent)
b0 cron add --agent <name> --every <interval> "<task>" # schedule with existing agent
b0 cron ls # list scheduled tasks
b0 cron remove <id> # remove a scheduled taskbash
b0 agent ls # 列出可用的Agent
b0 delegate <agent> "<detailed task prompt>" # 发送任务(非阻塞)
b0 delegate --thread <id> <agent> "<follow-up>" # 继续对话
b0 wait # 等待下一个完成的结果
b0 wait --all # 等待所有待处理结果完成
b0 wait --timeout 0 # 非阻塞式检查已完成的结果
b0 reply <thread-id> "<answer>" # 回复Agent的问题
b0 status # 检查待处理任务
b0 agent temp "<task>" # 一次性任务,无需命名Agent
b0 agent add <name> --instructions "..." # 创建命名Agent
b0 agent remove <name> # 删除Agent
b0 cron add --every <interval> "<task>" # 调度周期性任务(自动创建临时Agent)
b0 cron add --agent <name> --every <interval> "<task>" # 使用现有Agent调度周期性任务
b0 cron ls # 列出已调度的任务
b0 cron remove <id> # 删除已调度的任务How to write delegation prompts
如何撰写委派提示词
This is critical. Do NOT forward the user's words. Compose a complete, actionable prompt.
Bad:
b0 delegate reviewer "review this PR"Good:
b0 delegate reviewer "Review the changes on branch feature-timeout in this repo.
The PR adds timeout handling to src/handler.rs.
Focus on correctness, edge cases, and error handling.
Cite line numbers for any issues found."Steps:
- Gather context first - read relevant files, run , check the branch
git diff - Include specifics - file paths, line numbers, branch names, what changed and why
- State the deliverable - what the agent should produce (a list of issues, a summary, a fix)
For large content (diffs, file contents), pipe via stdin:
git diff main..HEAD | b0 delegate reviewer "Review the following diff. Focus on correctness."这一点至关重要。不要直接转发用户的原话,需撰写完整、可执行的提示词。
错误示例:
b0 delegate reviewer "review this PR"正确示例:
b0 delegate reviewer "审查此仓库中feature-timeout分支的变更。
该PR为src/handler.rs添加了超时处理逻辑。
重点检查正确性、边缘情况和错误处理。
若发现问题,请标注对应的行号。"步骤:
- 先收集上下文 - 阅读相关文件、执行、检查分支
git diff - 包含具体信息 - 文件路径、行号、分支名称、变更内容及原因
- 明确交付物 - Agent需要产出的内容(问题列表、总结、修复方案等)
对于大体积内容(如代码差异、文件内容),可通过标准输入管道传递:
git diff main..HEAD | b0 delegate reviewer "审查以下代码差异,重点关注正确性。"Concurrent tasks
并发任务
Delegate to multiple agents, then collect all results:
bash
b0 delegate reviewer "Review the changes on branch feature-timeout..."
b0 delegate security "Check src/handler.rs for OWASP top 10 vulnerabilities..."
b0 delegate doc-writer "Update README to reflect the new timeout config option..."
b0 wait --allAll three run in parallel. blocks until all complete.
b0 wait --all可同时委派任务给多个Agent,然后统一收集结果:
bash
b0 delegate reviewer "审查feature-timeout分支的变更..."
b0 delegate security "检查src/handler.rs是否存在OWASP十大漏洞..."
b0 delegate doc-writer "更新README以反映新的超时配置选项..."
b0 wait --all三个任务会并行执行,会阻塞直到所有任务完成。
b0 wait --allHandling agent questions
处理Agent的问题
During , an agent may ask a question:
b0 waitreviewer asks (thread thread-abc): "Is the timeout change on line 42 intentional?"
-> Use: b0 reply thread-abc "<your answer>"Answer with , then run again to continue collecting results.
b0 replyb0 wait在执行时,Agent可能会提出问题:
b0 waitreviewer 提问(线程ID:thread-abc):“第42行的超时变更是有意的吗?”
-> 执行:b0 reply thread-abc "<你的回答>"使用回复后,再次执行以继续收集结果。
b0 replyb0 waitProactive status checks
主动检查状态
Before responding to a new user message, run to check if any previously delegated tasks have completed. Report results to the user if any are ready.
b0 status在响应用户新消息前,先执行检查之前委派的任务是否已完成。若有结果就绪,将其告知用户。
b0 statusError handling
错误处理
If an agent fails, reports it. Decide whether to:
b0 wait- Retry with a clearer prompt
- Try a different agent
- Handle the task yourself
- Report the failure to the user
若Agent执行失败,会报告错误。此时可选择:
b0 wait- 使用更清晰的提示词重试
- 尝试使用其他Agent
- 自行处理任务
- 向用户报告执行失败
Multi-turn conversations
多轮对话
To continue a conversation with an agent, pass the thread ID from the first round:
bash
b0 delegate --thread <thread-id> <agent> "<follow-up>"
b0 waitThe agent remembers all previous turns.
要与Agent继续对话,需传递第一轮对话的线程ID:
bash
b0 delegate --thread <thread-id> <agent> "<后续问题>"
b0 waitAgent会记住之前所有的对话内容。
Troubleshooting
故障排查
| Symptom | Fix |
|---|---|
| Run |
| Start the server with |
| Check that the daemon is running (it starts with the server) |
| Agent returns empty result | Check agent instructions with |
| "no local machine" error | Run |
| Timeout errors | Default is 300s. Check if the task needs more time. |
| 症状 | 解决方法 |
|---|---|
| 执行 |
| 执行 |
| 检查守护进程是否在运行(随服务器一同启动) |
| Agent返回空结果 | 执行 |
| 出现“no local machine”错误 | 执行 |
| 超时错误 | 默认超时时间为300秒,检查任务是否需要更长时间 |