b0

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Box0 (
b0
) Multi-Agent Platform

Box0 (
b0
) 多Agent平台

Run 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 --version
If this succeeds, skip to Step 3.
bash
b0 --version
如果命令执行成功,跳至步骤3。

Step 2: Install

步骤2:安装Box0

bash
npm install -g @box0/cli@latest
If 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 status
If 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 server
On first start, Box0 creates an admin account and auto-configures
~/.b0/config.toml
.
Option 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
b0 status
shows a remote server (not
localhost
or
127.0.0.1
), check if this machine is registered:
bash
b0 machine ls
If no machines are listed, or if agent creation later fails with "no local machine", register this machine. Read
server_url
and
api_key
from
~/.b0/config.toml
, then run:
bash
b0 machine join <server-url> --name <hostname> --key <api-key>
Replace
<server-url>
with the server URL,
<hostname>
with this machine's hostname, and
<api-key>
with the API key from the config file.
If the server is local (localhost or 127.0.0.1), skip this step - the local machine is registered automatically.
b0 status
显示连接的是远程服务器(非
localhost
127.0.0.1
),检查本机是否已注册:
bash
b0 machine ls
若未列出任何机器,或后续创建Agent时出现“no local machine”错误,请注册本机。从
~/.b0/config.toml
中读取
server_url
api_key
,然后运行:
bash
b0 machine join <server-url> --name <hostname> --key <api-key>
<server-url>
替换为服务器URL,
<hostname>
替换为本机主机名,
<api-key>
替换为配置文件中的API密钥。
若连接的是本地服务器(localhost或127.0.0.1),可跳过此步骤——本机会自动注册。

Step 6: Install the skill

步骤6:安装技能

bash
npx skills add risingwavelabs/skills --skill b0
bash
npx skills add risingwavelabs/skills --skill b0

Step 7: Verify

步骤7:验证

bash
b0 agent ls
This 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.
b0 agent temp "<task>"
is the default for everything. No setup, no cleanup, no
b0 agent add
. Even if the user says "find 3 agents" or "use multiple agents", create 3 temp agents with
b0 agent temp
.
Only use
b0 agent add
when:
  • 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
b0 delegate <name>
when:
  • b0 agent ls
    shows an existing agent that matches the task
  • The user mentions an agent by name ("ask the reviewer")
除非用户明确指定现有Agent名称,否则始终使用临时Agent。
b0 agent temp "<task>"
是所有场景的默认方式,无需配置、无需清理,也无需执行
b0 agent add
。即使用户要求“找3个Agent”或“使用多个Agent”,也通过
b0 agent temp
创建3个临时Agent。
仅在以下情况使用
b0 agent add
  • 用户明确说明“创建永久Agent”或“添加可重复使用的Agent”
  • 绝不要用于一次性任务、讨论、研究、审查或任何当日完成的任务
仅在以下情况使用
b0 delegate <name>
  • b0 agent ls
    显示存在匹配任务的现有Agent
  • 用户提到了具体的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 task
bash
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:
  1. Gather context first - read relevant files, run
    git diff
    , check the branch
  2. Include specifics - file paths, line numbers, branch names, what changed and why
  3. 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添加了超时处理逻辑。
重点检查正确性、边缘情况和错误处理。
若发现问题,请标注对应的行号。"
步骤:
  1. 先收集上下文 - 阅读相关文件、执行
    git diff
    、检查分支
  2. 包含具体信息 - 文件路径、行号、分支名称、变更内容及原因
  3. 明确交付物 - 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 --all
All three run in parallel.
b0 wait --all
blocks until all complete.
可同时委派任务给多个Agent,然后统一收集结果:
bash
b0 delegate reviewer "审查feature-timeout分支的变更..."
b0 delegate security "检查src/handler.rs是否存在OWASP十大漏洞..."
b0 delegate doc-writer "更新README以反映新的超时配置选项..."
b0 wait --all
三个任务会并行执行,
b0 wait --all
会阻塞直到所有任务完成。

Handling agent questions

处理Agent的问题

During
b0 wait
, an agent may ask a question:
reviewer asks (thread thread-abc): "Is the timeout change on line 42 intentional?"
  -> Use: b0 reply thread-abc "<your answer>"
Answer with
b0 reply
, then run
b0 wait
again to continue collecting results.
在执行
b0 wait
时,Agent可能会提出问题:
reviewer 提问(线程ID:thread-abc):“第42行的超时变更是有意的吗?”
  -> 执行:b0 reply thread-abc "<你的回答>"
使用
b0 reply
回复后,再次执行
b0 wait
以继续收集结果。

Proactive status checks

主动检查状态

Before responding to a new user message, run
b0 status
to check if any previously delegated tasks have completed. Report results to the user if any are ready.
在响应用户新消息前,先执行
b0 status
检查之前委派的任务是否已完成。若有结果就绪,将其告知用户。

Error handling

错误处理

If an agent fails,
b0 wait
reports it. Decide whether to:
  • 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 wait
The agent remembers all previous turns.
要与Agent继续对话,需传递第一轮对话的线程ID:
bash
b0 delegate --thread <thread-id> <agent> "<后续问题>"
b0 wait
Agent会记住之前所有的对话内容。

Troubleshooting

故障排查

SymptomFix
b0: command not found
Run
npm install -g @box0/cli@latest
b0 status
shows no connection
Start the server with
b0 server
b0 delegate
hangs
Check that the daemon is running (it starts with the server)
Agent returns empty resultCheck agent instructions with
b0 agent info <name>
"no local machine" errorRun
b0 machine join <url> --name <hostname> --key <key>
to register this machine
Timeout errorsDefault is 300s. Check if the task needs more time.
症状解决方法
b0: command not found
执行
npm install -g @box0/cli@latest
重新安装
b0 status
显示无连接
执行
b0 server
启动服务器
b0 delegate
执行后挂起
检查守护进程是否在运行(随服务器一同启动)
Agent返回空结果执行
b0 agent info <name>
查看Agent的指令配置
出现“no local machine”错误执行
b0 machine join <url> --name <hostname> --key <key>
注册本机
超时错误默认超时时间为300秒,检查任务是否需要更长时间