5dive-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

5dive-cli

5dive-cli

This skill teaches you to drive the
5dive
command on a 5dive runtime VM. You are running inside one such VM. You can spawn additional agents on the same host by shelling out to
sudo 5dive ...
and parsing the JSON envelope it emits when you pass
--json
.
本技能将教你在5dive运行时虚拟机上操作
5dive
命令。你当前正运行在这样一台虚拟机中。你可以通过执行
sudo 5dive ...
命令在同一主机上生成额外的代理,并解析其传递
--json
参数时输出的JSON包。

When to use this skill

何时使用本技能

Use it whenever the work in front of you would benefit from a second pair of hands — for example:
  • The user asks for a "worker", "sub-agent", "another agent", or "side task".
  • The user names a specific sibling agent — "redirect to marketing", "ask scout", "ping ops", "tell research", "coordinate with X", "hand off to X". First confirm the agent exists via
    sudo 5dive agent list --json
    , then
    agent send
    (and pass chat context if the request came from a channel — see "Delegating a request that came in over a channel" below).
  • A long task could fan out into independent pieces (e.g. audit each route in parallel, run a different model on the same prompt, A/B two implementations).
  • You need to keep one agent on a hot context while a second one investigates something orthogonal.
  • The user wants to inspect / restart / pair / tear down an agent that already exists on the host.
  • You need a machine-readable health check of the host's coding-CLI stack.
  • You're coordinating work across several agents and want a shared to-do list or a reporting structure (
    5dive task
    ,
    5dive org
    ).
  • Work should recur on a schedule (
    task add --recurring
    ) or an agent should be woken only when it has queued work (
    5dive heartbeat
    ).
  • You want to chain agents into a loop that hands off step to step (with optional human gates), or set up an independent maker→verifier review — including building or editing one for the user on request (
    task loop
    ).
  • You're blocked on something only a human can provide — a decision, a secret, an approval (
    5dive task need
    ), or a task should quietly wait until a date (
    task park --wake
    ).
  • You want to recall what the team already knows — past decisions, gotchas, research — before re-deriving it (
    5dive memory search
    ).
  • You need a read on the fleet: who's burning tokens (
    5dive usage
    ), is any agent stuck/drifting (
    5dive supervisor
    ), what shipped in the last 24h (
    5dive digest
    ).
If the user just wants you to do the work yourself, do not spawn an agent.
当你手头的工作需要额外的协助时,即可使用本技能,例如:
  • 用户要求“工作代理”“子代理”“另一个代理”或“辅助任务”。
  • 用户指定了某个具体的兄弟代理——比如“转交给营销代理”“询问Scout代理”“Ping运维代理”“告知研究代理”“与X协作”“转交X”。首先通过
    sudo 5dive agent list --json
    确认该代理存在,再执行
    agent send
    (如果请求来自聊天频道,需传递聊天上下文——详见下方“转交来自频道的请求”章节)。
  • 一项长任务可以拆分为多个独立的子任务并行处理(例如,并行审核每个路由、对同一提示使用不同模型、对两种实现进行A/B测试)。
  • 你需要让一个代理保持在活跃上下文,同时让另一个代理处理无关的任务。
  • 用户需要检查/重启/配对/销毁主机上已有的代理。
  • 你需要主机编码CLI栈的机器可读健康检查报告。
  • 你需要在多个代理间协调工作,并希望使用共享待办事项列表或汇报结构(
    5dive task
    5dive org
    )。
  • 任务需要按计划周期性执行(
    task add --recurring
    ),或者仅当有排队任务时才唤醒代理(
    5dive heartbeat
    )。
  • 你希望将代理串联成自动转交的循环(可选人工审核环节),或者设置独立的“创作者→审核者”审查流程——包括根据用户请求构建或编辑此类循环(
    task loop
    )。
  • 你因只能由人工提供的内容而受阻——比如决策、密钥、审批(
    5dive task need
    ),或者任务需要在指定日期前暂停(
    task park --wake
    )。
  • 你希望回顾团队已有的知识——过往决策、潜在问题、研究成果——避免重复推导(
    5dive memory search
    )。
  • 你需要了解集群状态:哪些代理在消耗令牌(
    5dive usage
    )、是否有代理卡住/偏离任务(
    5dive supervisor
    )、过去24小时交付了哪些内容(
    5dive digest
    )。
如果用户只是希望你直接完成工作,则无需生成代理。

Mental model

核心模型

Everything the CLI does maps onto these resources on the host:
  • One agent = one Linux user (
    agent-<name>
    ) + one systemd unit (
    5dive-agent@<name>.service
    ) + one tmux session (
    agent-<name>
    ) running the chosen CLI in a restart loop.
  • Auth is decoupled. You authenticate a type once; every agent of that type inherits the credentials via
    EnvironmentFile
    .
  • A channel (
    telegram
    /
    discord
    /
    dashboard
    /
    none
    , comma-listable) is the inbound message surface. All agent types support channels; each agent needs its own bot token.
    dashboard
    (claude-only, token-free) is web-dashboard chat and is folded into every claude create by default —
    --channels=none
    opts out.
  • The CLI is idempotent and safe to call from another agent, but
    sudo
    is gated by isolation tier
    (DIVE-1002). New agents default to
    standard
    — zero sudo. Only the first agent on a fresh box, or one created with
    --isolation=admin
    , gets a scoped grant: the
    5dive
    CLI plus non-paging
    systemctl start|stop|restart
    of
    5dive-*
    units — NOT
    NOPASSWD:ALL
    . So the no-sudo surfaces (
    5dive task
    ,
    org
    ,
    memory
    ,
    usage
    ) run from any agent; the root surfaces (
    agent create
    /
    config
    /
    pair
    ,
    heartbeat on/off
    ,
    doctor
    ) need an admin agent.
    agent restart <name> --defer
    runs the deferred self-restart internally so an admin never needs a raw grant. For manual unit lifecycle there's a scoped primitive,
    sudo 5dive agent _svc <start|stop|restart> <5dive-unit>
    — 5dive-owned units only, no eval/pager (the admin sudoers dropped its raw
    systemctl
    lines because sudo-rs on Ubuntu 26.04 rejects wildcards inside command arguments, DIVE-1088).
Agent types on a current host:
antigravity codex claude openclaw hermes grok opencode
. Run
sudo 5dive agent types --json
for what's actually installed — the set changes between releases.
CLI的所有操作都对应主机上的以下资源:
  • 一个agent(代理) = 一个Linux用户(
    agent-<name>
    ) + 一个systemd单元(
    5dive-agent@<name>.service
    ) + 一个tmux会话(
    agent-<name>
    ),该会话以重启循环运行选定的CLI。
  • 身份验证是解耦的。你只需对一种代理类型进行一次身份验证;该类型的所有代理都会通过
    EnvironmentFile
    继承凭据。
  • channel(频道)
    telegram
    /
    discord
    /
    dashboard
    /
    none
    ,可逗号分隔列表)是入站消息的入口。所有代理类型都支持频道;每个代理需要独立的机器人令牌。
    dashboard
    (仅Claude可用,无需令牌)是Web仪表板聊天,默认会集成到每个Claude代理中——可通过
    --channels=none
    选择退出。
  • CLI具有幂等性,可从其他代理安全调用,但**
    sudo
    权限受隔离等级限制**(DIVE-1002)。新代理默认使用
    standard
    等级——无sudo权限。只有新主机上的第一个代理,或通过
    --isolation=admin
    创建的代理,才能获得受限权限:可使用
    5dive
    CLI,以及对
    5dive-*
    单元执行非分页的
    systemctl start|stop|restart
    操作——并非
    NOPASSWD:ALL
    。因此,无需sudo的功能(
    5dive task
    org
    memory
    usage
    )可从任何代理运行;需要root权限的功能(
    agent create
    /
    config
    /
    pair
    heartbeat on/off
    doctor
    )需要管理员代理。
    agent restart <name> --defer
    会在内部执行延迟自重启,因此管理员永远不需要原始权限授予。对于手动单元生命周期管理,有一个受限原语:
    sudo 5dive agent _svc <start|stop|restart> <5dive-unit>
    ——仅针对5dive所属单元,无eval/分页功能(Ubuntu 26.04上的sudo-rs拒绝命令参数中的通配符,因此管理员sudoers删除了原始
    systemctl
    命令行,DIVE-1088)。
当前主机上的代理类型:
antigravity codex claude openclaw hermes grok opencode
。执行
sudo 5dive agent types --json
查看实际已安装的类型——该集合会随版本更新而变化。

Output contract — always pass
--json

输出约定——始终传递
--json

Pass
--json
as a global flag (anywhere on the command line). Stdout becomes a stable envelope; progress lines stay on stderr.
bash
sudo 5dive agent create scout --type=claude --json
Success:
json
{ "ok": true, "data": { "name": "scout", "type": "claude", "created": true } }
Failure (exit code matches
error.code
):
json
{ "ok": false, "error": { "code": 6, "class": "auth_required", "message": "..." } }
Branch on
error.class
, not on the human message.
Classes:
ok
,
usage
,
validation
,
not_found
,
conflict
,
auth_required
,
not_installed
,
not_running
,
pairing
,
permission
,
timeout
,
generic
.
See
references/exit-codes.md
for the full table.
--json
作为全局标志传递(可放在命令行任意位置)。标准输出将变为稳定的JSON包;进度信息将输出到标准错误流。
bash
sudo 5dive agent create scout --type=claude --json
成功输出:
json
{ "ok": true, "data": { "name": "scout", "type": "claude", "created": true } }
失败输出(退出码与
error.code
匹配):
json
{ "ok": false, "error": { "code": 6, "class": "auth_required", "message": "..." } }
**根据
error.class
进行分支判断,而非人工可读消息。**错误类别包括:
ok
,
usage
,
validation
,
not_found
,
conflict
,
auth_required
,
not_installed
,
not_running
,
pairing
,
permission
,
timeout
,
generic
完整列表请查看
references/exit-codes.md

Recipes

使用示例

Spawn a worker for a side task

生成辅助代理处理任务

bash
undefined
bash
undefined

1. Pick a unique name (lowercase letters/digits/hyphens, ≤16 chars,

1. 选择一个唯一名称(小写字母/数字/连字符,最多16个字符,必须以字母开头)。如果在意名称是否已使用,先检查注册表:

must start with a letter). Check the registry first if you care:

sudo 5dive agent list --json | jq -r '.data[].name' # data is an ARRAY of agents
sudo 5dive agent list --json | jq -r '.data[].name' # data是代理数组

2. Create the worker. --workdir scopes its tmux cwd; default is

2. 创建辅助代理。--workdir指定其tmux工作目录;默认是/home/claude/projects。

/home/claude/projects.

sudo 5dive agent create worker-1
--type=claude
--workdir=/home/claude/projects/myrepo
--json
sudo 5dive agent create worker-1
--type=claude
--workdir=/home/claude/projects/myrepo
--json

3. Send it the task. tmux send-keys + Enter, so the text appears

3. 向其发送任务。使用tmux send-keys + Enter,让文本显示在辅助代理的运行CLI提示符中。

in the worker's running CLI prompt.

sudo 5dive agent send worker-1
"audit the auth middleware for OWASP A01 issues; report back as a markdown bullet list"
sudo 5dive agent send worker-1
"审核身份验证中间件是否存在OWASP A01问题;以Markdown项目符号列表形式返回报告"

4. Poll its output until it goes idle. --tmux dumps the scrollback.

4. 轮询其输出直到空闲。--tmux会输出滚动缓冲区内容。

sudo 5dive agent logs worker-1 --tmux --lines=80
sudo 5dive agent logs worker-1 --tmux --lines=80

5. Tear it down when you're done — frees the systemd unit + Linux user.

5. 完成任务后销毁代理——释放systemd单元和Linux用户。

sudo 5dive agent rm worker-1 --json
sudo 5dive agent rm worker-1 --json

5dive fire worker-1
/
agent fire
are aliases of
agent rm
(same guarded

5dive fire worker-1
/
agent fire
agent rm
的别名(同样是受管控的销毁操作)——与
5dive hire
相对应。

teardown) — the counterpart to
5dive hire
.


`agent clone <src> <dst>` copies an existing agent's type/config into a new
one — handy when you want a second worker shaped like the first.

`5dive hire <name> [--role="CTO"] [--title=...]` is sugar for `agent create`
(defaults `--type=claude`, forwards every create flag) plus an `org set` when
`--role`/`--title` are given — one call to "hire a teammate" with an org-chart
entry.

`agent clone <src> <dst>`会将现有代理的类型/配置复制到新代理中——当你需要第二个与第一个配置相同的辅助代理时非常有用。

`5dive hire <name> [--role="CTO"] [--title=...]`是`agent create`的简化命令(默认`--type=claude`,可传递所有create标志),如果指定了`--role`/`--title`,还会同时执行`org set`——一次调用即可“雇佣团队成员”并添加到组织架构图中。

Hire a ready-made persona from the agent market

从代理市场雇佣现成角色代理

Beyond a blank teammate, you can hire a ready-made persona off the agent market (character-pack registry, DIVE-993/1020):
bash
5dive market                          # browse every pack, rarity-first
5dive market <keyword> [--role=<r>] [--rarity=<tier>] [--seasoned]  # --seasoned = ships trained memory
5dive market show <slug>              # preview: tier, model, skills, card, DID

5dive hire <role> --from-market --dry-run --json          # resolve + show disclosure, create NOTHING
5dive hire <role> --from-market [--as=<name>] --yes --json  # provision the top match
--from-market
provisions a REAL teammate and is gated (DIVE-1013):
--dry-run
creates nothing; a TTY requires an interactive
y/N
; non-interactive needs an explicit
--yes
or it aborts after the disclosure. It provisions via
agent import
under the hood.
除了空白的团队成员,你还可以从代理市场(角色包注册表,DIVE-993/1020)雇佣现成的角色代理
bash
5dive market                          # 浏览所有角色包,按稀有度排序
5dive market <keyword> [--role=<r>] [--rarity=<tier>] [--seasoned]  # --seasoned = 附带训练后的记忆
5dive market show <slug>              # 预览:等级、模型、技能、卡片、DID

5dive hire <role> --from-market --dry-run --json          # 解析并显示披露信息,不创建任何代理
5dive hire <role> --from-market [--as=<name>] --yes --json  # 配置匹配度最高的角色代理
--from-market
配置真实的团队成员,且受权限限制(DIVE-1013):
--dry-run
不创建任何内容;TTY环境需要交互式
y/N
确认;非交互式环境需要显式
--yes
参数,否则在显示披露信息后中止。它会通过
agent import
在底层完成配置。

Inspect / import a persona pack

检查/导入角色包

agent import
is also the path to clone an exact persona — from a market slug or a local
.tar.gz
. Always
inspect
an untrusted pack first (read-only, no root):
bash
5dive agent inspect <slug|pack.tar.gz> --json        # what shell/hooks/skills it would run
sudo 5dive agent import <slug|pack.tar.gz> --as=<name> [--allow-hooks] --json
A pack's hooks are arbitrary shell that auto-runs on the new agent's tool events (the agentjacking surface), so
import
is deny-by-default on hooks — stripped unless you pass
--allow-hooks
(DIVE-995/1009) — and refuses any member with a
..
/absolute path or a symlink (zip-slip + link-escape guards, DIVE-1010/1012).
agent import
也是克隆精确角色代理的途径——可从市场slug或本地
.tar.gz
文件导入。对于不受信任的包,务必先执行
inspect
(只读,无需root权限):
bash
5dive agent inspect <slug|pack.tar.gz> --json        # 查看该包会运行哪些shell/钩子/技能
sudo 5dive agent import <slug|pack.tar.gz> --as=<name> [--allow-hooks] --json
角色包的钩子是任意shell脚本,会在新代理的工具事件中自动运行(存在代理劫持风险),因此
import
默认拒绝钩子——除非传递
--allow-hooks
(DIVE-995/1009),否则钩子会被移除;同时会拒绝包含
..
/绝对路径或符号链接的成员(防止zip-slip和链接逃逸,DIVE-1010/1012)。

Skill inheritance on agent-spawned children

代理生成子代理时的技能继承

When an agent (you,
SUDO_USER=agent-*
) creates another agent of any supported type, the CLI auto-installs the
5dive-cli
skill into the child so it inherits inter-agent comms knowledge. Humans creating from the dashboard don't get this default. Override either way:
  • --with-skills=<spec>[,<spec>...]
    — explicit list. Each spec is a bare id (defaults to
    5dive-ai/skills
    ) or
    <owner/repo>:<id>
    . Example:
    --with-skills=5dive-cli,acme/skills:db-tools
    .
  • --no-skills
    — opt out, even when called from another agent.
  • --inherit-memory=<scope>
    — seed the new hire's recall store from shared knowledge so it boots knowing the company (DIVE-990). Scope is a comma-list:
    wiki
    , a sibling
    <agent-name>
    (its SHAREABLE facts only), or
    all
    /
    team
    .
  • --no-team-bot
    — when the box has a shared team bot, new no-bot agents auto-attach (own forum topic, send-only on the shared token); this opts out.
当一个代理(你,
SUDO_USER=agent-*
)创建任何支持类型的代理时,CLI会自动将
5dive-cli
技能安装到子代理中,使其继承代理间通信知识。从仪表板创建代理的用户不会获得此默认设置。可通过以下方式覆盖默认行为:
  • --with-skills=<spec>[,<spec>...]
    ——显式技能列表。每个spec可以是裸ID(默认来自
    5dive-ai/skills
    )或
    <owner/repo>:<id>
    。示例:
    --with-skills=5dive-cli,acme/skills:db-tools
  • --no-skills
    ——选择退出,即使从其他代理调用也不继承技能。
  • --inherit-memory=<scope>
    ——从共享知识中为新代理初始化记忆存储,使其启动时了解公司情况(DIVE-990)。范围是逗号分隔列表:
    wiki
    、兄弟代理
    <agent-name>
    (仅其可共享的事实)、
    all
    /
    team
  • --no-team-bot
    ——当主机有共享团队机器人时,新的无机器人代理会自动关联(拥有独立论坛主题,使用共享令牌仅发送消息);此参数可选择退出。

Create-then-auth:
--defer-auth

先创建后验证:
--defer-auth

Use when you want the agent registered before its credentials are wired up (e.g. the agent's own first-run UI will handle sign-in). Skips the auth gate on
agent create
; combine with
--auth-profile=<name>
to bind a profile slot that doesn't yet have a
combined.env
.
bash
sudo 5dive agent create draft-bot --type=claude --defer-auth --json
当你希望先注册代理再配置凭据时使用(例如,代理自身的首次运行UI将处理登录)。跳过
agent create
时的身份验证环节;结合
--auth-profile=<name>
绑定尚未配置
combined.env
的配置文件槽位。
bash
sudo 5dive agent create draft-bot --type=claude --defer-auth --json

BYO API key:
--provider
(hermes / openclaw / claude)

自带API密钥:
--provider
(hermes / openclaw / claude)

hermes
and
openclaw
are bring-your-own-model harnesses. Pass the upstream provider and key at create time (mutually exclusive with
--defer-auth
):
bash
sudo 5dive agent create cheap-bot --type=openclaw \
  --provider=openrouter --api-key=- --json   # key on stdin
Providers:
openrouter google minimax moonshot huggingface anthropic deepseek qwen nous openai zai
.
Since 0.8.0,
--provider
also works on
--type=claude
— real Claude Code pointed at a BYO endpoint — for the subset with an Anthropic-compatible API:
openrouter deepseek moonshot zai
. It requires
--auth-profile=<name>
(the creds are profile-scoped) and wires
ANTHROPIC_BASE_URL
/
ANTHROPIC_AUTH_TOKEN
plus safe per-tier model defaults into that profile. Override any tier with
--model=<slug>
at create, or
agent config set model=<slug>
later (DIVE-1103). OpenRouter's Anthropic-skin endpoint translates, so any OpenRouter slug works (
openai/*
,
google/*
,
z-ai/*
,
deepseek/*
, …) — but keep the background HAIKU slot on a prompt-caching-capable model or every background call pays full price.
hermes
openclaw
是自带模型的框架。创建时传递上游服务提供商和密钥(与
--defer-auth
互斥):
bash
sudo 5dive agent create cheap-bot --type=openclaw \
  --provider=openrouter --api-key=- --json   # 从标准输入读取密钥
支持的服务提供商:
openrouter google minimax moonshot huggingface anthropic deepseek qwen nous openai zai
从0.8.0版本开始,
--provider
也适用于
--type=claude
——指向自带端点的真实Claude Code,适用于具有Anthropic兼容API的子集:
openrouter deepseek moonshot zai
。需要
--auth-profile=<name>
(凭据与配置文件绑定),并将
ANTHROPIC_BASE_URL
/
ANTHROPIC_AUTH_TOKEN
以及安全的按等级模型默认值写入该配置文件。创建时可通过
--model=<slug>
覆盖任何等级,或之后通过
agent config set model=<slug>
修改(DIVE-1103)。OpenRouter的Anthropic兼容端点支持翻译,因此任何OpenRouter slug都可使用(
openai/*
google/*
z-ai/*
deepseek/*
等)——但请确保后台HAIKU槽使用支持提示缓存的模型,否则每次后台调用都需支付全额费用。

Tune a running claude agent: model + effort

调整运行中Claude代理的模型和算力

bash
sudo 5dive agent config worker-1 set model=claude-opus-4-8
sudo 5dive agent config worker-1 set effort=high
bash
sudo 5dive agent config worker-1 set model=claude-opus-4-8
sudo 5dive agent config worker-1 set effort=high

effort: low|medium|high|xhigh|max — claude only; xhigh/max are Opus-tier.

effort选项:low|medium|high|xhigh|max — 仅Claude支持;xhigh/max为Opus等级。

model= also works for codex/grok/antigravity agents, and for BYO-provider

model=也适用于codex/grok/antigravity代理,对于自带服务提供商的Claude代理,可使用服务提供商支持的任何slug(DIVE-1103)。

claude agents it takes any slug the provider serves (DIVE-1103).


`sudo 5dive agent info <name>` shows the resolved type, CLI version, model
and channel state for one agent.

`sudo 5dive agent info <name>`会显示单个代理的解析类型、CLI版本、模型和频道状态。

Fan out: same prompt, three different types

扇出任务:同一提示,三种不同代理类型

Useful for "let me see how Claude/Codex/opencode each approach this".
bash
for type in claude codex opencode; do
  sudo 5dive agent create "fan-${type}" --type="${type}" --json
  sudo 5dive agent send "fan-${type}" "$PROMPT"
done
适用于“查看Claude/Codex/opencode分别如何处理此任务”的场景。
bash
for type in claude codex opencode; do
  sudo 5dive agent create "fan-${type}" --type="${type}" --json
  sudo 5dive agent send "fan-${type}" "$PROMPT"
done

Wait, then collect the last 200 lines of each:

等待完成,然后收集每个代理最后200行输出:

for type in claude codex opencode; do echo "=== ${type} ===" sudo 5dive agent logs "fan-${type}" --tmux --lines=200 done
for type in claude codex opencode; do echo "=== ${type} ===" sudo 5dive agent logs "fan-${type}" --tmux --lines=200 done

Cleanup.

清理资源。

for type in claude codex opencode; do sudo 5dive agent rm "fan-${type}" --json done
undefined
for type in claude codex opencode; do sudo 5dive agent rm "fan-${type}" --json done
undefined

Declarative fleets: compose + team templates

声明式集群:组合与团队模板

For more than a couple of agents, declare the fleet in a
5dive.yaml
and let the CLI reconcile, docker-compose style:
bash
sudo 5dive up         # bring up everything declared in ./5dive.yaml (idempotent)
sudo 5dive ps         # declared agents' state
sudo 5dive down       # tear down declared agents
sudo 5dive export     # dump the LIVE fleet to a v2 5dive.yaml (reverse direction)
当需要管理多个代理时,可在
5dive.yaml
中声明集群,让CLI像docker-compose一样协调:
bash
sudo 5dive up         # 启动./5dive.yaml中声明的所有代理(幂等操作)
sudo 5dive ps         # 查看已声明代理的状态
sudo 5dive down       # 销毁已声明的代理
sudo 5dive export     # 将当前运行的集群导出为v2版本的5dive.yaml(反向操作)

Bundled multi-agent company templates:

预定义的多代理公司模板:

sudo 5dive team ls sudo 5dive team import startup --json

Spec keys per agent: `type, channels, telegram_token, discord_token,
workdir, skills, no_skills, defer_auth, isolation, auth_profile, provider,
api_key`. Strings expand `${ENV_VAR}` from the process env and fail loudly
when missing.
sudo 5dive team ls sudo 5dive team import startup --json

每个代理的配置键包括:`type, channels, telegram_token, discord_token, workdir, skills, no_skills, defer_auth, isolation, auth_profile, provider, api_key`。字符串会从进程环境中展开`${ENV_VAR}`,如果变量缺失会报错。

Host a CrewAI crew:
5dive crew

托管CrewAI团队:
5dive crew

The box can run a CrewAI crew as a first-class workload (DIVE-787): its own venv, BYO LLM key stored owner-600, durable memory on the box disk (
CREWAI_STORAGE_DIR
), and a co-signed receipt per run.
bash
sudo 5dive crew install <git-url> --as=<name> [--entry=<module:Crew>]
sudo 5dive crew secret set <name> KEY=VALUE [KEY=VALUE ...]
sudo 5dive crew run <name>          # also: show <name> | list | uninstall <name>
主机可将CrewAI团队作为一等工作负载运行(DIVE-787):拥有独立的venv、存储在主机磁盘上的自带LLM密钥(权限owner-600)、持久化内存(
CREWAI_STORAGE_DIR
),以及每次运行的共同签署回执。
bash
sudo 5dive crew install <git-url> --as=<name> [--entry=<module:Crew>]
sudo 5dive crew secret set <name> KEY=VALUE [KEY=VALUE ...]
sudo 5dive crew run <name>          # 其他命令:show <name> | list | uninstall <name>

Recover from
auth_required

auth_required
错误中恢复

bash
undefined
bash
undefined

If create fails with error.class=auth_required, the type isn't authenticated.

如果创建代理时出现error.class=auth_required错误,说明该类型未通过身份验证。

Two paths — pick by what credentials you have:

有两种解决方式——根据你拥有的凭据选择:

A) Static API key in $KEY (preferred for automation)

A) 使用$KEY中的静态API密钥(自动化场景首选)

echo "$KEY" | sudo 5dive agent auth set claude --api-key=- --json
echo "$KEY" | sudo 5dive agent auth set claude --api-key=- --json

B) Device-code flow (when only a human can complete login)

B) 设备码流程(仅当人工可完成登录时使用)

sudo 5dive agent auth start claude --json
sudo 5dive agent auth start claude --json

-> session id; give the URL from
auth poll
to the user; they paste the

-> 会话ID;将
auth poll
返回的URL提供给用户;用户通过
auth submit
粘贴回调码。

callback code back via
auth submit
.


Never call `5dive agent auth login <type>` from your own process — it
hands the TTY off to the upstream CLI's interactive flow and hangs your
agent. Use `auth start` / `auth set` instead.

永远不要从你的进程中调用`5dive agent auth login <type>`——它会将TTY控制权交给上游CLI的交互式流程,导致你的代理挂起。请改用`auth start` / `auth set`。

Multi-account: the
account
noun

多账户:
account
命令

A 5dive account is a named auth profile — one bag of credentials that any number of agents can share via
--auth-profile=<name>
. Use it when the host has more than one human / billing identity (e.g. work + personal Anthropic sign-ins) and different agents should use different ones.
5dive account ...
is the user-facing surface; the lower-level
agent auth start|poll|submit|cancel
verbs are still what the dashboard's device-code flow uses, and what you should use from a script.
bash
undefined
5dive的**account(账户)**是命名的身份验证配置文件——一组凭据,可通过
--auth-profile=<name>
被任意数量的代理共享。当主机有多个用户/计费身份(例如,工作和个人Anthropic登录)且不同代理应使用不同身份时使用。
5dive account ...
是面向用户的命令;底层的
agent auth start|poll|submit|cancel
命令仍被仪表板的设备码流程使用,也是你在脚本中应使用的命令。
bash
undefined

Inventory: which named accounts exist, what types each is signed into,

查看清单:存在哪些命名账户,每个账户已登录哪些类型,有多少代理绑定到每个账户。

and how many agents are bound to each.

sudo 5dive account list --json
sudo 5dive account list --json

Per-account rate-limit headroom (5h + 7d windows) — check BEFORE moving

每个账户的速率限制余量(5小时+7天窗口)——在移动代理或因“配额”问题排查失败前务必检查。

agents around or blaming "quota" for a failure.

sudo 5dive account usage --json
sudo 5dive account usage --json

Detail for one account, including which env keys are populated.

查看单个账户的详细信息,包括已填充的环境变量键。

sudo 5dive account show acme-prod --json
sudo 5dive account show acme-prod --json

Provision a new empty account, then sign it in (TTY-only — humans).

创建新的空账户,然后登录(仅TTY环境可用——人工操作)。

sudo 5dive account add acme-prod sudo 5dive account login acme-prod --type=claude
sudo 5dive account add acme-prod sudo 5dive account login acme-prod --type=claude

Rebind an existing agent to a different account. Restarts the agent so

将现有代理重新绑定到不同账户。会重启代理使新的EnvironmentFile生效。

the new EnvironmentFile takes effect.

sudo 5dive agent set-account worker-1 acme-prod --json sudo 5dive agent set-account worker-1 default --json # clears the override
sudo 5dive agent set-account worker-1 acme-prod --json sudo 5dive agent set-account worker-1 default --json # 清除覆盖设置

Rename / remove.
remove
refuses while any agents are still bound.

重命名/删除账户。删除时如果仍有代理绑定到该账户会拒绝操作。

sudo 5dive account rename acme-prod acme-staging --json sudo 5dive account remove acme-staging --json
sudo 5dive account rename acme-prod acme-staging --json sudo 5dive account remove acme-staging --json

Flip which BYO provider a profile's hermes uses, when several are signed in.

当配置文件已登录多个服务提供商时,切换其hermes使用的默认服务提供商。

(hermes-only for now.)

(目前仅适用于hermes。)

sudo 5dive account set-active-provider acme-prod hermes openrouter --json

The reserved name `default` is rejected by `account add` / `rename` — at the
agent level, `auth-profile=default` already means "no override, use the shared
`/etc/5dive/connectors/<type>.env`".
sudo 5dive account set-active-provider acme-prod hermes openrouter --json

保留名称`default`无法用于`account add` / `rename`——在代理层面,`auth-profile=default`已表示“不使用覆盖设置,使用共享的`/etc/5dive/connectors/<type>.env`”。

Pair a Telegram channel without a bot reply

无需机器人回复即可配对Telegram频道

agent pair
accepts three input shapes:
bash
undefined
agent pair
支持三种输入形式:
bash
undefined

A) Classic — return a pairing code, user DMs the bot, paste the bot reply.

A) 经典方式——返回配对码,用户向机器人发送私信,粘贴机器人回复的内容。

sudo 5dive agent pair worker-1 --json sudo 5dive agent pair worker-1 --code=AB12CD --json
sudo 5dive agent pair worker-1 --json sudo 5dive agent pair worker-1 --code=AB12CD --json

B) Auto-detect — long-poll Telegram for the next inbound message and

B) 自动检测——长轮询Telegram获取下一条入站消息,并从首次向机器人发送私信的用户那里初始化access.json。适用于用户已打开机器人的入职流程。

seed access.json from whoever DMs the bot first. Useful in onboarding

flows where the user has the bot open already.

sudo 5dive agent telegram-discover --token="$BOT_TOKEN" --poll-secs=60 --json
sudo 5dive agent telegram-discover --token="$BOT_TOKEN" --poll-secs=60 --json

-> {found:true, userId, chatId, ...}; re-poll on {found:false}.

-> {found:true, userId, chatId, ...}; 当{found:false}时重新轮询。

sudo 5dive agent pair worker-1 --user-id=<userId> --chat-id=<chatId> --json
sudo 5dive agent pair worker-1 --user-id=<userId> --chat-id=<chatId> --json

C) Bot identity for deep links — fast getMe lookup so the dashboard can

C) 用于深度链接的机器人身份——快速执行getMe查询,以便仪表板在“发送/start”提示旁渲染可点击的t.me/<bot>链接。

render a tappable t.me/<bot> link alongside the "send /start" prompt.

sudo 5dive agent telegram-getme --token="$BOT_TOKEN" --json
sudo 5dive agent telegram-getme --token="$BOT_TOKEN" --json

-> {ok:true, data:{botId, username, firstName}}

-> {ok:true, data:{botId, username, firstName}}


`telegram-discover` and `telegram-getme` are read-only (no registry mutation,
no audit log) and do not require a bound agent. A few more read/write
telegram helpers round out the surface:

```bash
sudo 5dive agent telegram-info worker-1 [--refresh] --json

`telegram-discover`和`telegram-getme`是只读命令(不修改注册表,不生成审计日志),无需绑定代理。还有一些额外的Telegram读写辅助命令:

```bash
sudo 5dive agent telegram-info worker-1 [--refresh] --json

name-based getMe; reads the token from /etc/5dive/connectors and caches

根据名称执行getMe;从/etc/5dive/connectors读取令牌,并在注册表中缓存botUsername(为在此字段存在前创建的代理补全@句柄)。--refresh强制重新获取。

botUsername on the registry (backfills @handles for agents created before

that field existed). --refresh forces a re-fetch.

sudo 5dive agent telegram-pending-ignore worker-1 <code> --json
sudo 5dive agent telegram-pending-ignore worker-1 <code> --json

drop a pending pairing without approving it (dashboard inbox action).

拒绝待处理的配对请求,不进行批准(仪表板收件箱操作)。

sudo 5dive agent telegram-resolve-handle worker-1 @someuser --json
sudo 5dive agent telegram-resolve-handle worker-1 @someuser --json

getChat for @handle via the agent's own bot token -> {id, isBot,

通过代理自身的机器人令牌获取@句柄的getChat信息 -> {id, isBot, displayName}; 使仪表板可通过句柄而非数字ID添加机器人。

displayName}; lets the dashboard add a bot by handle instead of numeric id.


To attach a bot to an agent **after** create:

```bash
sudo 5dive agent config worker-1 set telegram.token=<bot-token>
sudo 5dive agent config worker-1 set channels=telegram
sudo 5dive agent config worker-1 set telegram.home-channel=<chat-id>

要在创建代理**之后**为其绑定机器人:

```bash
sudo 5dive agent config worker-1 set telegram.token=<bot-token>
sudo 5dive agent config worker-1 set channels=telegram
sudo 5dive agent config worker-1 set telegram.home-channel=<chat-id>

hermes only — chat id the gateway posts unsolicited messages to;

仅hermes支持——网关将主动消息发送到的聊天ID;claude/openclaw会忽略此设置。

ignored by claude/openclaw.


**Token hygiene: prefer stdin over argv.** Any token/key flag accepts the
sentinel `-` to read the value from stdin, so it never lands in
`/proc/<pid>/cmdline` or audit/access logs:

```bash
echo "$BOT_TOKEN" | sudo 5dive agent config worker-1 set telegram.token=-
echo "$BOT_TOKEN" | sudo 5dive agent telegram-getme --token=-
echo "$KEY"       | sudo 5dive agent auth set claude --api-key=-
Only one
=-
key can be read per invocation, and
=-
without anything piped blocks on stdin until your timeout — always actually pipe the value.
For non-channel credentials there's a root-only drop primitive:
5dive secret write <KEY> --connector=<name>
reads the value from stdin and writes it into root-owned
/etc/5dive/connectors/
without the secret ever touching argv or the audit log (DIVE-930/932).
Who may talk to the bot is governed by the agent's
access.json
. Read / write it without touching the file by hand (the plugin re-reads per message, no restart needed):
bash
sudo 5dive agent telegram-access get worker-1 --json
echo '{"dmPolicy":"allowlist","allowFrom":[433634012],"groups":{}}' \
  | sudo 5dive agent telegram-access set worker-1

**令牌安全:优先使用标准输入而非命令行参数。**任何令牌/密钥标志都接受哨兵值`-`从标准输入读取值,这样令牌永远不会出现在`/proc/<pid>/cmdline`或审计/访问日志中:

```bash
echo "$BOT_TOKEN" | sudo 5dive agent config worker-1 set telegram.token=-
echo "$BOT_TOKEN" | sudo 5dive agent telegram-getme --token=-
echo "$KEY"       | sudo 5dive agent auth set claude --api-key=-
每次调用只能读取一个
=-
密钥,如果未传递值则会阻塞在标准输入直到超时——务必确保实际传递了值。
对于非频道凭据,有一个仅root可用的写入原语:
5dive secret write <KEY> --connector=<name>
从标准输入读取值并写入root拥有的
/etc/5dive/connectors/
目录,密钥永远不会接触命令行参数或审计日志(DIVE-930/932)。
谁可以与机器人通信由代理的
access.json
控制。无需手动编辑文件即可读写该文件(插件会在每次消息时重新读取,无需重启):
bash
sudo 5dive agent telegram-access get worker-1 --json
echo '{"dmPolicy":"allowlist","allowFrom":[433634012],"groups":{}}' \
  | sudo 5dive agent telegram-access set worker-1

Shortcut at config level: seed the allowlist without the pair-code gate.

配置层面的快捷方式:无需配对码即可初始化允许列表。

sudo 5dive agent config worker-1 set telegram.allowed-users=433634012,5551234

A group chat the bot should reply in must be present in `groups{}` — without
it, replies into that group are dropped.
sudo 5dive agent config worker-1 set telegram.allowed-users=433634012,5551234

机器人应回复的群组聊天必须存在于`groups{}`中——否则发送到该群组的回复会被丢弃。

Shared team bot: one bot, every agent

共享团队机器人:一个机器人,所有代理共用

Instead of one bot token per agent, a box can run a shared team bot: every agent posts into one Telegram forum group (its own topic per agent) on a single token, and a root listener service (
5dive-team-bot-listener
) is the sole
getUpdates
consumer. Per-agent bridges go send-only (
TELEGRAM_SEND_ONLY
, propagated into every bridge's env on boot), which kills the one-consumer-per-token 409 races (DIVE-1087); the listener also handles gate approval-button taps itself, re-reading the live gate before answering (DIVE-1093), so
task need
gates stay tappable in team-bot mode.
bash
sudo 5dive agent team-bot status|provision|shared|intercom|discover|refresh-listener
sudo 5dive agent team-group discover|provision|shared|status [--group=<chat_id>]
sudo 5dive agent topic get|set <name> [--thread-id=N --chat-id=N]  # per-agent forum topic
refresh-listener
re-materializes the listener from the current CLI bundle and restarts it (no-op on boxes without a team bot);
self-update
and the nightly host update run it automatically (DIVE-1095), so listener fixes no longer sit dormant until someone re-runs
team-bot shared
.
无需每个代理使用独立的机器人令牌,主机可运行共享的团队机器人:所有代理使用单个令牌发布到一个Telegram论坛群组(每个代理拥有独立主题),且有一个root监听器服务(
5dive-team-bot-listener
)是唯一的
getUpdates
消费者。每个代理的桥接器设置为仅发送(
TELEGRAM_SEND_ONLY
,在启动时传播到每个桥接器的环境中),这消除了每个令牌一个消费者的409冲突(DIVE-1087);监听器还会自行处理审核按钮的点击,在回复前重新读取当前审核状态(DIVE-1093),因此
task need
审核在团队机器人模式下仍可点击。
bash
sudo 5dive agent team-bot status|provision|shared|intercom|discover|refresh-listener
sudo 5dive agent team-group discover|provision|shared|status [--group=<chat_id>]
sudo 5dive agent topic get|set <name> [--thread-id=N --chat-id=N]  # 每个代理的论坛主题
refresh-listener
会从当前CLI包重新生成监听器并重启(无团队机器人的主机上为无操作);
self-update
和夜间主机更新会自动执行此命令(DIVE-1095),因此监听器修复无需等待有人重新运行
team-bot shared

Talking to other agents (inter-agent comms)

与其他代理通信(代理间通信)

agent send
and
agent ask
work as a tiny message bus between agents on the same host. There is no separate channel — messages land in the receiver's running CLI as if a human had typed them.
agent send
agent ask
可作为同一主机上代理间的小型消息总线。无需独立频道——消息会直接显示在接收方的运行CLI中,就像人工输入一样。

Sending: attribution is automatic

发送:自动添加来源标识

When you (an agent) shell out to
sudo 5dive agent send <name> "..."
, the CLI sees that
$SUDO_USER
is
agent-<you>
and wraps the payload as:
[5dive-msg from=<you> id=<8-hex>] <your text>
so the receiver can tell it's being pinged by a peer agent and which one. Override the inferred name with
--from=<label>
. Skip wrapping with
--raw
(useful when you're piping a prompt that already has its own structure).
Humans running
sudo 5dive agent send
directly never get auto-wrapped — only sends from
agent-*
users do.
Quote the body in single quotes and keep backticks /
$()
out of it
— the message passes through a shell, so unquoted substitutions execute on your side and mangle the payload.
当你(一个代理)执行
sudo 5dive agent send <name> "..."
时,CLI会检测到
$SUDO_USER
agent-<you>
,并将消息内容包装为:
[5dive-msg from=<you> id=<8-hex>] <your text>
这样接收方可以识别出是来自对等代理的消息,以及具体是哪个代理。可通过
--from=<label>
覆盖推断的名称。使用
--raw
跳过包装(当你传递的提示已有自身结构时非常有用)。
人工直接运行
sudo 5dive agent send
永远不会自动包装——只有
agent-*
用户发送的消息才会被包装。
请用单引号包裹消息内容,并避免在其中使用反引号/
$()
——消息会通过shell传递,未加引号的替换会在你的代理端执行,导致消息内容被损坏。

Receiving: recognise the envelope and reply by name

接收:识别消息包并按名称回复

When a line like
[5dive-msg from=scout id=ab12cd34] please summarise the auth middleware audit
appears as your input, treat it as an inter-agent request. To reply, send back to the named sender:
bash
sudo 5dive agent send scout "[re=ab12cd34] auth middleware looks clean except for ..."
The
[re=<id>]
prefix is convention, not enforced — it lets the original sender match your reply to their question when they're juggling several at once. Drop it for casual back-and-forth.
当出现如下内容作为你的输入时:
[5dive-msg from=scout id=ab12cd34] please summarise the auth middleware audit
将其视为代理间请求。回复时,发送消息给指定的来源代理:
bash
sudo 5dive agent send scout "[re=ab12cd34] auth middleware looks clean except for ..."
[re=<id>]
前缀是约定俗成的,并非强制要求——它让原始发送方在处理多个请求时可以将你的回复与对应的问题匹配。非正式的双向通信可省略该前缀。

One-shot synchronous calls:
agent ask

一次性同步调用:
agent ask

If you want a request/response in one CLI call (no manual polling of
agent logs
), use
ask
:
bash
sudo 5dive agent ask scout \
  "list the OWASP A01 issues you found, one per line" \
  --timeout=180 --json
It sends the wrapped envelope, then watches
tmux capture-pane
after the marker line and returns once the scrollback has been quiet for
--idle-secs
(default 5s). Stdout (text mode) is just the reply body; in
--json
mode the envelope is
{ok:true, data:{name, from, msg_id, reply}}
.
Caveats — read these before leaning on
ask
:
  1. Idle-by-stability is heuristic. A receiver that streams progress continuously will keep
    ask
    awake until
    --timeout
    fires. If you're asking for something the receiver might narrate (long agentic work), prompt it for a terse final summary or use plain
    send
    +
    logs
    .
  2. The reply is whatever was on screen. It includes any chrome the receiver CLI prints (cursor lines, status hints) — don't expect a clean JSON body unless the prompt asks for one.
  3. No retries, no delivery confirmation. If the receiver crashed mid- reply you'll get a partial slice or a timeout, nothing in between.
如果你希望通过一次CLI调用完成请求/响应(无需手动轮询
agent logs
),请使用
ask
bash
sudo 5dive agent ask scout \
  "list the OWASP A01 issues you found, one per line" \
  --timeout=180 --json
它会发送包装后的消息包,然后在标记行之后监控
tmux capture-pane
,当滚动缓冲区安静
--idle-secs
(默认5秒)后返回结果。文本模式下的标准输出仅包含回复内容;
--json
模式下的消息包为
{ok:true, data:{name, from, msg_id, reply}}
注意事项——在依赖
ask
前请阅读以下内容:
  1. **基于稳定性判断空闲状态是启发式的。**持续输出进度信息的接收方会让
    ask
    保持活跃直到
    --timeout
    触发。如果你请求的内容可能会被接收方详细描述(长耗时的代理任务),请提示其返回简洁的最终摘要,或使用普通的
    send
    +
    logs
  2. **回复内容是屏幕上显示的所有内容。**它包括接收方CLI输出的任何装饰信息(光标行、状态提示)——除非提示要求,否则不要期望得到干净的JSON内容。
  3. **无重试,无交付确认。**如果接收方在回复过程中崩溃,你会得到部分内容或超时,不会有中间状态。

Delegating a request that came in over a channel

转交来自频道的请求

If a user pings you on a Telegram/Discord chat where the target agent's bot is also a member, do not relay the answer yourself. Hand the target agent the chat context and tell it to post directly via its own bot — attribution stays clean, the conversation reads naturally, and you stop being a middleman.
The CLI has structural support for this:
--reply-to-chat=<id>
(and optional
--reply-to-msg=<id>
for thread replies) stamps the envelope so the receiver gets a machine-readable hint instead of relying on you describing the chat in prose.
Where the chat_id and message_id come from. When the user's request arrives via the channel plugin (Telegram or Discord), it's surfaced to you wrapped in a
<channel>
tag whose attributes already carry exactly what the flags want:
<channel source="plugin:telegram:telegram" chat_id="433634012" message_id="4671" user="..." ts="...">
redirect to marketing
</channel>
The mapping is one-for-one:
  • chat_id
    attribute →
    --reply-to-chat=<chat_id>
  • message_id
    attribute →
    --reply-to-msg=<message_id>
    (optional; threads the reply)
So the handoff looks like:
bash
sudo 5dive agent send marketing \
  --reply-to-chat=433634012 --reply-to-msg=4671 \
  "User @alice asked your take on the Q3 launch copy. Reply in the chat
   via your own bot — do not reply back to me."
Receiver-side, the inbound envelope looks like:
[5dive-msg from=ops id=ab12cd34 reply-to-chat=433634012 reply-to-msg=4671] ...
When you see
reply-to-chat=<id>
on an incoming message, post your answer directly in that chat via your own Telegram/Discord tool. Use
reply-to-msg=<id>
as the threaded
reply_to
so the message lands as a quote-reply. Do not also send a peer reply back to the sender — they have opted out of being a relay.
If the target agent's bot is not in the chat, omit the flag, relay the reply yourself, and tell the user the bot needs to be added.
如果用户在Telegram/Discord聊天中Ping你,且目标代理的机器人也是该聊天成员,请不要自行中转回复。将聊天上下文交给目标代理,让其通过自身机器人直接回复——这样归属关系清晰,对话自然,你也无需再作为中间方。
CLI对此提供了结构化支持:
--reply-to-chat=<id>
(可选
--reply-to-msg=<id>
用于线程回复)会标记消息包,让接收方获得机器可读的提示,而非依赖你用文字描述聊天信息。
**chat_id和message_id的来源。**当用户的请求通过频道插件(Telegram或Discord)到达时,会以
<channel>
标签的形式呈现给你,该标签的属性已包含标志所需的信息:
<channel source="plugin:telegram:telegram" chat_id="433634012" message_id="4671" user="..." ts="...">
redirect to marketing
</channel>
映射关系一一对应:
  • chat_id
    属性 →
    --reply-to-chat=<chat_id>
  • message_id
    属性 →
    --reply-to-msg=<message_id>
    (可选;用于回复线程)
因此转交操作如下:
bash
sudo 5dive agent send marketing \
  --reply-to-chat=433634012 --reply-to-msg=4671 \
  "User @alice asked your take on the Q3 launch copy. Reply in the chat
   via your own bot — do not reply back to me."
接收方收到的消息包如下:
[5dive-msg from=ops id=ab12cd34 reply-to-chat=433634012 reply-to-msg=4671] ...
当你看到入站消息包含
reply-to-chat=<id>
时,请通过自身的Telegram/Discord工具直接在该聊天中回复。使用
reply-to-msg=<id>
作为线程化的
reply_to
,使消息作为引用回复显示。不要同时向发送方回复对等消息——他们已选择退出中转。
如果目标代理的机器人未加入该聊天,请省略这些标志,自行中转回复,并告知用户需要添加机器人。

Rules of thumb

经验法则

  • For "fire-and-forget delegate, I'll check later":
    agent send
    + poll
    agent logs --tmux
    when it suits you.
  • For "I need an answer to continue":
    agent ask
    .
  • For broadcast / fan-out across N agents: loop
    agent send
    (or
    agent ask
    in parallel via
    &
    +
    wait
    ). Each call is independent.
  • Don't reuse
    --from
    labels for unrelated agents — pick a label that names you, so receivers can address replies correctly.
  • When a request originates from a chat the target agent can post to, prefer direct reply over relay (see above).
  • 对于“发送后不管,稍后再检查”的场景:使用
    agent send
    + 在合适的时候轮询
    agent logs --tmux
  • 对于“需要答案才能继续”的场景:使用
    agent ask
  • 对于向N个代理广播/扇出任务:循环执行
    agent send
    (或通过
    &
    +
    wait
    并行执行
    agent ask
    )。每个调用都是独立的。
  • 不要为无关代理重复使用
    --from
    标签——选择能标识你身份的标签,以便接收方正确回复。
  • 当请求来自目标代理可回复的聊天时,优先选择直接回复而非中转(见上文)。

Track shared work: the task queue + org chart

跟踪共享工作:任务队列 + 组织架构图

When you fan work out across several agents, the host has a shared task queue and an org chart so the team works off one source of truth. Both live in a group-writable sqlite store (
/var/lib/5dive/tasks
), so no sudo is needed — any
agent-*
user can read and write directly.
bash
undefined
当你将工作扇出到多个代理时,主机有一个共享任务队列和组织架构图,让团队基于单一事实来源协作。两者都存储在可组写入的sqlite数据库中(
/var/lib/5dive/tasks
),因此无需sudo权限——任何
agent-*
用户都可直接读写。
bash
undefined

Queue a unit of work and hand it to a worker. Tasks get a DIVE-N ident (or a project's prefix — see Projects below);

将一项工作加入队列并交给辅助代理。任务会获得DIVE-N标识(或项目前缀——见下方“项目”章节);

--from defaults to your agent name, so created_by is attributed for you.

--from默认是你的代理名称,因此会自动归属创建者。

5dive task add "audit the auth middleware for OWASP A01"
--assignee=worker-1 --priority=high --json
5dive task add "audit the auth middleware for OWASP A01"
--assignee=worker-1 --priority=high --json

--assignee also takes org-routing tokens (role:<r> / charter:<kw>); omit it to

--assignee也可接受组织路由令牌(role:<r> / charter:<kw>);省略该参数会路由到组织负责人/协调员。

route to the org lead/coordinator.

--task-budget=<tokens|$cost> 限制该任务在主机循环中的花费(DIVE-824):纯数字表示令牌数量,以$开头表示美元成本(例如$3)。它会附加到任务行中,并通过Messages-API的task_budget强制执行——这是真实的每次运行限制,而非建议值。务必为周期性或自主任务设置该参数,以免无人值守的循环失控。

--task-budget=<tokens|$cost> caps the on-host loop's spend for that task

查看未完成任务、人员分配情况(按优先级排序);--mine筛选出分配给你的任务。

(DIVE-824): a bare number is a token count, a leading '$' is a dollar cost

(e.g. $3). It rides on the task row and is enforced via the Messages-API

task_budget — a real per-run cap, not advisory. ALWAYS set one on recurring

or autonomous tasks so an unattended loop can't run away.

What's open, who's on what (priority-ordered); --mine filters to you.

5dive task ls --json 5dive task ls --mine --json
5dive task ls --json 5dive task ls --mine --json

Drive status as work moves. block/unblock express dependencies.

随着工作推进更新状态。block/unblock表示依赖关系。

5dive task start DIVE-7 --json # -> in_progress 5dive task done DIVE-7 --result="one-line summary first; detail below" --json 5dive task block DIVE-9 --by=DIVE-7 --json # DIVE-9 waits on DIVE-7
5dive task start DIVE-7 --json # -> in_progress 5dive task done DIVE-7 --result="one-line summary first; detail below" --json 5dive task block DIVE-9 --by=DIVE-7 --json # DIVE-9等待DIVE-7完成

Express who coordinates whom. --manager=default puts an agent at the top.

设置协调关系。--manager=default将代理置于顶层。

5dive org set worker-1 --manager=lead --title="Auth audit" --json 5dive org tree --json

On `done`/`cancel`, `--result` captures your outcome on the record and the
**first line** is what gets pinged to the owner's phone — lead with a terse
one-line summary, detail after the first newline.

A receiver that's assigned a task sees it via `5dive task ls --mine`; pair this
with `agent send` to actually nudge them. `task init` is a one-time root
bootstrap done at provision — never call it.
5dive org set worker-1 --manager=lead --title="Auth audit" --json 5dive org tree --json

执行`done`/`cancel`时,`--result`会将你的结果记录在案,**第一行**会被推送到所有者的手机——请先写简洁的一行摘要,详细内容放在第一行之后。

被分配任务的接收方可通过`5dive task ls --mine`查看任务;结合`agent send`可实际提醒他们。`task init`是配置时一次性的root初始化操作——永远不要调用它。

Projects: group a multi-task effort under its own ident namespace

项目:将多任务工作归到独立的标识命名空间下

Don't file a sprawl of loose
DIVE-N
tasks for one initiative — open a project. A project is a named task workspace with its own ident prefix (e.g.
FROG-1
,
FROG-2
) and an optional lead; tasks filed into it are numbered in that namespace instead of the shared
DIVE-N
backlog. The default
dive
project (prefix
DIVE
) is that shared backlog and is always present.
bash
undefined
不要为一个计划创建大量零散的
DIVE-N
任务——请创建一个项目。项目是命名的任务工作区,拥有独立的标识前缀(例如
FROG-1
FROG-2
)和可选负责人;归入项目的任务会使用该命名空间编号,而非共享的
DIVE-N
待办事项。默认的
dive
项目(前缀
DIVE
)是共享待办事项,始终存在。
bash
undefined

Open a project. prefix defaults to the upper-cased key (frog -> FROG).

创建项目。prefix默认是键的大写形式(frog -> FROG)。

5dive project add frog --name="Frog migration" --goal="port the parser"
--lead-agent=worker-1 --json 5dive project ls --json # key, prefix, task count, lead, status 5dive project show frog --json
5dive project add frog --name="Frog migration" --goal="port the parser"
--lead-agent=worker-1 --json 5dive project ls --json # 键、前缀、任务数量、负责人、状态 5dive project show frog --json

File work into it — the task gets the project's prefix (FROG-1, FROG-2, ...).

将工作归入项目——任务会获得项目的前缀(FROG-1、FROG-2等)。

5dive task add "port the lexer" --project=frog --assignee=worker-1 --json 5dive task ls --project=frog --json # everything in that project

Open a project when the work is a multi-task initiative with its own identity
and (often) a lead; use a plain `task add` (it lands in `dive`/`DIVE-N`) for a
one-off. Everything else — `start`/`done`/`need`/`block`/`loop`/`heartbeat` —
works identically on a project's tasks (`task loop start --project=frog` too).
5dive task add "port the lexer" --project=frog --assignee=worker-1 --json 5dive task ls --project=frog --json # 该项目下的所有任务

当工作是具有独立标识且(通常)有负责人的多任务计划时创建项目;对于一次性任务,使用普通的`task add`(会归入`dive`/`DIVE-N`)。其他所有操作——`start`/`done`/`need`/`block`/`loop`/`heartbeat`——对项目任务的操作方式完全相同(`task loop start --project=frog`也适用)。

Park a question on a human:
task need

将问题提交给人工处理:
task need

When a task is blocked on something only a human can provide, don't sit on it and don't guess — gate it:
bash
5dive task need DIVE-12 --type=decision \
  --ask="Ship behind a flag or straight to prod?" \
  --options="flag|prod" --recommend="flag" --tier=1 --json
当任务因只能由人工提供的内容而受阻时,不要搁置任务或猜测——请设置审核:
bash
5dive task need DIVE-12 --type=decision \
  --ask="Ship behind a flag or straight to prod?" \
  --options="flag|prod" --recommend="flag" --tier=1 --json

--type: decision | secret | approval | manual | access

--type选项:decision | secret | approval | manual | access

-> task goes blocked; the human gets an alert with tap buttons.

-> 任务变为阻塞状态;人工会收到带有点击按钮的提醒。

--type=access: "I'm blocked on a permission/grant I don't have." Pair it with

--type=access:“我因没有权限/授权而受阻。”结合--probe=<cmd>(DIVE-1243)使用——这是当前必须失败的自检;如果自检成功,审核会被拒绝(你已拥有权限),不会无故Ping人工。即使不传递--probe仍会提交,但会提示你确认已测试。

--probe=<cmd> (DIVE-1243) — a self-check that must currently FAIL; if it

succeeds the gate is refused (you already have it) instead of pinging a human

for nothing. No --probe still files, just with a warning to confirm you tested.

5dive task need DIVE-9 --type=access --probe="aws s3 ls s3://prod-bucket"
--ask="Need read access to prod-bucket" --recommend="grant s3:GetObject" --json
5dive task inbox --json # everything currently waiting on a human 5dive task answer DIVE-12 --value="flag" --json # records + unblocks + pings the owner
5dive task need DIVE-9 --type=access --probe="aws s3 ls s3://prod-bucket"
--ask="Need read access to prod-bucket" --recommend="grant s3:GetObject" --json
5dive task inbox --json # 当前等待人工处理的所有任务 5dive task answer DIVE-12 --value="flag" --json # 记录结果 + 解除阻塞 + Ping所有者

You (an agent) can only
task answer
a tier-0/1 DECISION gate. approval /

你(代理)只能
task answer
等级0/1的DECISION审核。approval / secret / manual审核现在仅人工可用(已启用强制限制):它们通过Telegram点击(每个审核的--human-proof随机数,由root生成——你的LLM永远看不到)或非代理SUDO_UID清除,永远不会通过代理会话的
sudo task answer
清除。旧的可伪造--proof证据形式已被移除(DIVE-916/950)。

secret / manual gates are HUMAN-ONLY now (enforcement ON): they clear via a

Telegram tap (per-gate --human-proof nonce, minted as root — your LLM never

sees it) or a non-agent SUDO_UID, never a bare agent-session `sudo task

answer`. The old forgeable --proof evidence form was removed (DIVE-916/950).


Keep `--ask` to ONE crisp question with ~1 line of context; heavy detail
belongs in the task body. Always pass `--recommend` for decision/approval —
the alert leads with your recommendation so the human can one-tap it.

**Risk tiers (`--tier=0|1|2`)** control how hard the gate blocks:

- `0` — auto-clear: the recommendation applies immediately, no ping; the daily
  digest's "Auto-cleared gates" section is the record. Requires `--recommend`.
- `1` — pings normally, but if unanswered for 48h the recommendation is
  auto-applied (provenance `auto:ttl`) and the owner notified. Default for
  `decision`.
- `2` — hard human gate, never auto-applies. Default for approval/secret/manual.

Money, public comms, secrets, destructive and brand asks are **floored to
tier 2** by the CLI regardless of the flag; secret gates are always tier 2.
Use tier 0/1 for low-stakes reversible calls so humans only see gates that
matter.

**Precedent prefill (OSS-11).** When you file a gate with a blank
`--recommend`, the CLI looks for the closest matching answered precedent —
same need type and ask shape, from an equal-or-higher tier, answered within
90 days — and prefills the recommendation from it, citing the precedent on
the alert ("Precedent: you answered X on DIVE-N"). It never changes the
resolved tier, never touches the clear path, and never overrides an explicit
`--recommend`; for a decision gate the precedent answer must also be one of
the current gate's options or only the citation is kept.

**Quiet waits: `task park`.** When a task should sleep without sitting in the
human inbox (revisit-later, waiting on an external date):

```bash
5dive task park DIVE-12 --reason="revisit after launch" --wake=+3d --json

请将`--ask`保持为**一个简洁的问题,附带约一行上下文**;详细内容放在任务主体中。对于decision/approval类型的审核,务必传递`--recommend`——提醒会优先显示你的建议,以便人工一键选择。

**风险等级(`--tier=0|1|2`)**控制审核的阻塞强度:

- `0`——自动清除:建议立即生效,不发送提醒;每日摘要的“自动清除审核”部分会记录。需要传递`--recommend`。
- `1`——正常发送提醒,但如果48小时未回复,建议会自动生效(来源`auto:ttl`)并通知所有者。默认适用于`decision`类型。
- `2`——强制人工审核,永远不会自动生效。默认适用于approval/secret/manual类型。

涉及资金、公共通信、密钥、破坏性操作和品牌相关的请求**无论标志如何都会被强制设为等级2**;密钥审核始终为等级2。对于低风险可逆决策使用等级0/1,这样人工只需关注重要的审核。

**先例预填充(OSS-11)。**当你提交审核时未指定`--recommend`,CLI会查找最匹配的已回复先例——相同需求类型和问题形式、等级相同或更高、90天内回复——并从先例中填充建议,在提醒中引用先例(“先例:你在DIVE-N中回复了X”)。它不会改变解析后的等级,不会影响清除路径,也不会覆盖显式的`--recommend`;对于decision类型的审核,先例回复必须是当前审核选项之一,否则仅保留引用。

--wake=<YYYY-MM-DD[ HH:MM]|+Nd|+Nh> auto-unparks it back to todo

静默等待:
task park

5dive task unpark DIVE-12 --json # wake it early

**Both `--reason` and `--wake` are REQUIRED** (fail-closed since DIVE-1357 —
no more block-graveyard: every park needs a revisit date). If you don't know
one, pick a re-check date; if you're actually waiting on a person, use `task
need` instead. `park` also refuses over a task with a live, unanswered `task
need` gate (DIVE-1453) — answer the gate first, or parking would silently
destroy it with no audit trail.

**Flag for attention: `task escalate <id>`** bumps priority one tier (capped
at urgent) and pings the owning agent + paired human — use it to raise urgency
without filing a gate or reassigning.

**Bulk-clear as the paired human: `task clear-recs`.** DIVE-1305 — from a
verified DM chat, clear every eligible low-risk gate (tier<2, has a
`--recommend`, not lead-routed) in one shot instead of tapping each one:

```bash
5dive task clear-recs --channel-proof=<chat_id> --json         # clear everything eligible
5dive task clear-recs --channel-proof=<chat_id> --only=DIVE-9 --json  # just one
Who fronts the inbox:
task coordinator [--json]
.
Prints the resolved org coordinator (DIVE-333/1568) — the sole agent a surface should pin a needs-you banner to, so multiple paired agents don't each independently ping the same reminder. Empty output means no org or an ambiguous multi-root org — treat that as "nobody pins."
当任务需要休眠但不进入人工收件箱(稍后再处理、等待外部日期)时:
bash
5dive task park DIVE-12 --reason="revisit after launch" --wake=+3d --json

Recurring work + waking workers: heartbeat

--wake=<YYYY-MM-DD[ HH:MM]|+Nd|+Nh> 会在指定时间自动解除暂停,恢复为todo状态

A recurring template materializes into a normal todo on schedule; the heartbeat wakes an enrolled agent only when it actually has queued work. Use these instead of hand-rolling cron +
agent send
.
bash
undefined
5dive task unpark DIVE-12 --json # 提前唤醒任务

**`--reason`和`--wake`都是必填项**(自DIVE-1357起为失败关闭——不再有阻塞墓地:每个暂停任务都需要重新检查日期)。如果你不知道其中一个,请选择一个重新检查日期;如果你实际在等待人工,请改用`task need`。`park`也拒绝暂停带有未处理`task need`审核的任务(DIVE-1453)——请先处理审核,否则暂停会无声无息地销毁审核且无审计记录。

Template: 5-field cron. Inert until it fires (excluded from ls/heartbeat).

标记为紧急:
task escalate <id>
将优先级提升一级(最高为urgent)并Ping所属代理 + 配对的人工——用于提高紧急程度,无需提交审核或重新分配。

作为配对人工批量清除:
task clear-recs
。DIVE-1305——从已验证的DM聊天中,一键清除所有符合条件的低风险审核(等级<2、有
--recommend
、未路由到负责人),无需逐个点击:

5dive task add "rotate the weekly metrics digest"
--recurring="0 9 * * 1" --assignee=worker-1 --json 5dive task ls --recurring --json # list templates
bash
5dive task clear-recs --channel-proof=<chat_id> --json         # 清除所有符合条件的审核
5dive task clear-recs --channel-proof=<chat_id> --only=DIVE-9 --json  # 仅清除指定任务的审核

Enrol the worker so the tick wakes it when tasks land. Default every=30m.

谁负责收件箱:
task coordinator [--json]
。输出解析后的组织协调员(DIVE-333/1568)——是应显示“需要你处理”横幅的唯一代理,这样多个配对代理不会各自独立发送相同的提醒。空输出表示没有组织或组织架构不明确(多根)——视为“无人显示横幅”。

fresh (default on) sends /clear before each task; --no-fresh keeps context.

周期性工作 + 唤醒代理:heartbeat

sudo 5dive heartbeat on worker-1 --every=30m sudo 5dive heartbeat ls # enrolled agents + next wake + queued count sudo 5dive heartbeat off worker-1

`heartbeat tick` is the root cron driver — already wired at provision; never
call it yourself. Enrolment uses the agent's **short name** (`worker-1`),
the same name `task --assignee` expects — not the Linux user `agent-worker-1`.
No catch-up for missed ticks: if the host is down over a scheduled minute,
that occurrence is skipped, so keep schedules coarse (hourly/daily).
周期性模板会按计划生成为普通待办任务;heartbeat仅当代理有排队任务时才唤醒已注册的代理。请使用这些功能代替手动编写cron +
agent send
bash
undefined

Loops: relay work across agents (+ human gates)

模板:5字段cron表达式。在触发前处于惰性状态(不会出现在ls/heartbeat中)。

A loop chains agents into an auto-relay: each step hands off to the next the moment its
task done
lands, and a human gate pauses the chain for a tap. This is the CLI behind the dashboard loop builder — and because it's just the CLI, you can build, edit, and inspect a loop conversationally. "Set up a content pipeline: research → draft → my approval → publish" becomes a
task loop start
; "swap step 3 to Marcus / add a gate before publish / stop the running loop" is just editing the run's tasks. The dashboard can't safely edit a running loop — you can.
bash
undefined
5dive task add "rotate the weekly metrics digest"
--recurring="0 9 * * 1" --assignee=worker-1 --json 5dive task ls --recurring --json # 查看模板列表

Start a relay. --steps is a JSON array; each item is either a work step

注册代理,使其在任务到达时被唤醒。默认每30分钟一次。

{agent,label,handoff?} or a human gate {gate:"approval",label}.

fresh(默认开启)会在每次任务前发送/clear;--no-fresh保留上下文。

5dive task loop start --title="Content pipeline" --steps='[ {"agent":"olivia","label":"Pick the topic and brief the writer","handoff":"briefs"}, {"agent":"theo","label":"Draft the post","handoff":"sends to review"}, {"agent":"dario","label":"Fact-check and tighten","handoff":"sends for approval"}, {"gate":"approval","label":"You approve before it publishes"}, {"agent":"theo","label":"Publish and close"} ]' --json
5dive task loop ls --json # board of loop runs: per-run step progress + status
sudo 5dive heartbeat on worker-1 --every=30m sudo 5dive heartbeat ls # 已注册代理 + 下次唤醒时间 + 排队任务数 sudo 5dive heartbeat off worker-1

`heartbeat tick`是root cron驱动程序——已在配置时设置;永远不要自行调用。注册使用代理的**短名称**(`worker-1`),与`task --assignee`期望的名称相同——而非Linux用户`agent-worker-1`。错过的tick不会补执行:如果主机在计划分钟内宕机,该次任务会被跳过,因此请将计划设置为较粗的粒度(每小时/每天)。

Rows carry the latest grade scorecard per run:
scorecard_json
in --json

循环:在代理间中继工作(+人工审核)

('' when ungraded), a
score
column (84/100 style) on the text board.


The relay creates one subtask per step, chained N+1-blocked-by-N under a run
parent. Step 1's agent is pinged immediately; each `task done` frees the next
step (the heartbeat wakes that agent); a gate step blocks until the human
answers it (`task answer`, or a Telegram tap). To **edit a running loop**, act
on its subtasks (`task ls`, `task assign`, `task block/unblock`, `task rm`, or
slip in a `task need` gate); to stop it, `task rm` the run parent (cascades).
循环会将代理串联成自动中继:每个步骤在其
task done
完成后立即转交至下一个步骤,人工审核会暂停流程等待点击。这是仪表板循环构建器背后的CLI——而且因为它只是CLI,你可以通过对话方式构建、编辑和检查循环。“设置内容流水线:研究→起草→我的审核→发布”只需执行
task loop start
;“将步骤3替换为Marcus / 在发布前添加审核 / 停止运行中的循环”只需编辑运行的任务。仪表板无法安全编辑运行中的循环——但你可以。
bash
undefined

Maker→verifier loops: the writer never grades itself

启动中继。--steps是JSON数组;每个元素要么是工作步骤{agent,label,handoff?},要么是人工审核{gate:"approval",label}。

Verification is on by default (DIVE-969): a non-trivial
task add
auto-derives acceptance criteria and assigns a grader distinct from the maker, so a plain
task done
hands off to grade instead of closing. Trivial chores (bodyless mechanical titles), low-priority tasks and recurring templates auto-skip it;
--no-verify
is the explicit opt-out and
FIVE_VERIFY_DEFAULT=0
is a fleet kill-switch. To pin a specific grader (or add one where it auto-skipped), give a task a verifier different from its assignee:
bash
5dive task add "migrate the auth module to the new SDK" \
  --assignee=dario --verifier=marcus --max-iters=3 \
  --accept="builds clean, tests pass, no public API change" --json
5dive task loop start --title="Content pipeline" --steps='[ {"agent":"olivia","label":"Pick the topic and brief the writer","handoff":"briefs"}, {"agent":"theo","label":"Draft the post","handoff":"sends to review"}, {"agent":"dario","label":"Fact-check and tighten","handoff":"sends for approval"}, {"gate":"approval","label":"You approve before it publishes"}, {"agent":"theo","label":"Publish and close"} ]' --json
5dive task loop ls --json # 循环运行面板:每次运行的步骤进度 + 状态

The maker's
task done
does NOT close it — it hands off to the verifier, who

行中包含每次运行的最新评分卡:--json中的
scorecard_json
(未评分时为空),文本面板中的
score
列(84/100格式)。

grades against --accept and either closes it (their own
task done
) or:

5dive task reject DIVE-7 --feedback="tests pass but the public signature changed" --json

中继会为每个步骤创建一个子任务,在运行父任务下按N+1依赖于N的方式串联。步骤1的代理会立即收到Ping;每个`task done`会释放下一个步骤(heartbeat会唤醒该代理);审核步骤会阻塞直到人工回复(`task answer`或Telegram点击)。要**编辑运行中的循环**,请操作其子任务(`task ls`、`task assign`、`task block/unblock`、`task rm`,或插入`task need`审核);要停止循环,请`task rm`运行父任务(级联删除)。

-> bounces back to the maker for another pass; escalates to a human at --max-iters.

创作者→审核者循环:创作者永远不会自我评分

5dive task loops --json # board of maker→verifier loops (--stuck / --escalate-stuck) 5dive task loops --runs --json # LOOP-7 loop_runs control window: topology/stage/ # iteration/token-ceiling/status; --watch repaints, # --kill <loopId> requests a deferred-safe stop

`--verify="<cmd>"` stores a default command that `5dive task verify <id>` runs
to grade automatically. Writer ≠ grader is the whole point — never set the
verifier to the same agent as the assignee. Once a task is handed to its
verifier, `task done` is refused from anyone but that verifier — even a
second `task done` from the maker itself (DIVE-2007); send corrections to
the verifier instead of re-running `done`. A task can also be attached to
the rail after the fact with `5dive task verifier <id> <agent>
[--accept=<criteria>] [--max-iters=<n>]` (DIVE-1880) if it was filed without
one, or re-pointed to a different grader mid-review.

If the work ships as a PR, use `5dive task deliver <id> --pr=<url>
[--result=<text>]` (DIVE-1830) instead of `task done` — it hands off to the
verifier without closing. `task done` on a task carrying a PR binding (from
`deliver`, `task set-branch`, or `--branch=` on `add`) — or that a scan of
open PRs across the known repos names the task's ident — now refuses to
close until that PR is **merged and green**; `--force-merge-gate` is the
audited override for false positives (e.g. flaky post-merge CI).
验证默认开启(DIVE-969):非琐碎的
task add
会自动派生验收标准,并分配与创作者不同的审核者,因此普通的
task done
转交至审核而非关闭。琐碎的杂务(无内容的机械标题)、低优先级任务和周期性模板会自动跳过验证;
--no-verify
是显式选择退出的参数,
FIVE_VERIFY_DEFAULT=0
是集群级别的关闭开关。要指定特定审核者(或在自动跳过的情况下添加审核者),请为任务设置与受让人不同的verifier
bash
5dive task add "migrate the auth module to the new SDK" \
  --assignee=dario --verifier=marcus --max-iters=3 \
  --accept="builds clean, tests pass, no public API change" --json

LOOP-7: agent-native orchestration verbs

创作者的
task done
不会关闭任务——它会转交至审核者,审核者会根据--accept进行评分,要么关闭任务(审核者自己执行
task done
),要么:

5dive loop
is a lower-level verb family than the
task loop
relay above — JSON in / JSON out, each verb spawns/grades agents directly and honors
--ceiling
(per-loop token budget; self-halts + escalates at the limit). Humans watch/kill via
task loops --kill <loopId>
; they never author a loop.
bash
5dive loop spawn --role=maker|verifier|worker --agent=<type|name> \
  --prompt="…" [--schema=<json>] [--ceiling=<tok>] [--wait[=<sec>]]
5dive loop verify --target=<id> --verifier=<agent> [--accept="…"]
5dive loop grade  --target=<id> --verifier=<agent> [--accept="…"] [--threshold=0-100] [--wait]
5dive loop panel  --n=<k> --lens="correctness,security" --claim="…" --quorum=<m>   # jury
5dive loop map    --over=<json-array> --do=<spawn-spec> [--max-concurrency=<n>]    # fan-out
5dive loop until-dry --round=<spawn-spec> --stop-after=<K> --dedup-key="…"         # drain a queue
5dive loop collect --handles=<id,id,…>       # gather results from spawned handles
5dive loop status  --handle=<loopId>         # read-only single-loop drilldown
5dive loop install <slug> --onto=<agent> [--cron="…"] [--ceiling=<tok>] [--dry-run]
                                             # drop a marketplace loop pack (persona +
                                             # skills + cadence) onto an agent; peek first
                                             # with `loop show <slug>`
5dive task reject DIVE-7 --feedback="tests pass but the public signature changed" --json

Goals: decompose an outcome into a task graph

-> 退回给创作者重新处理;当达到--max-iters时升级至人工处理。

5dive goal add
turns a one-line outcome into a validated, guardrailed task DAG (tasks +
task_deps
edges + assignees under a project) — DIVE-984. A planner agent proposes it; it's checked for DAG acyclicity, size/depth caps, tier-floor and assignability BEFORE anything is created. Over the count checkpoint or carrying any Tier-2 task, ONE decision gate holds the plan and nothing materializes until a human approves.
bash
5dive goal add "ship a public status page" --dry-run --json   # plan + render, create NOTHING
5dive goal add "ship a public status page" --json \
  [--project=<key>] [--planner=<agent>] [--max-tasks=12] [--depth-cap=5] \
  [--checkpoint=6] [--ceiling=40000] [--yes]
5dive task loops --json # 创作者→审核者循环面板(--stuck / --escalate-stuck) 5dive task loops --runs --json # LOOP-7循环运行控制窗口:拓扑/阶段/ # 迭代/令牌上限/状态;--watch会刷新显示, # --kill <loopId> 请求延迟安全停止

`--verify="<cmd>"`存储默认命令,`5dive task verify <id>`会运行该命令自动评分。创作者≠审核者是核心原则——永远不要将verifier设置为与受让人相同的代理。一旦任务转交至审核者,除审核者外任何人都无法执行`task done`——即使创作者再次执行`task done`也会被拒绝(DIVE-2007);请将更正内容发送给审核者,而非重新执行`done`。如果任务未设置verifier,也可在事后通过`5dive task verifier <id> <agent> [--accept=<criteria>] [--max-iters=<n>]`添加(DIVE-1880),或在审核过程中重新指向其他审核者。

如果工作以PR形式交付,请使用`5dive task deliver <id> --pr=<url> [--result=<text>]`(DIVE-1830)代替`task done`——它会将任务转交至审核者而不关闭。如果任务带有PR绑定(来自`deliver`、`task set-branch`或`add`时的`--branch=`)——或扫描已知仓库的开放PR时提到了任务标识——`task done`会拒绝关闭直到该PR**合并且状态正常**;`--force-merge-gate`是针对误报的审核覆盖(例如合并后CI不稳定)。

--yes waives ONLY the count checkpoint; a Tier-2 plan still gates hard.

LOOP-7:代理原生编排命令

5dive goal add --from-gate=<id> --json # materialize a plan a HUMAN answered 'approve' # (the only path that builds a Tier-2 plan)

Always `--dry-run` first to eyeball the plan; the real add is the only thing
that creates work.
5dive loop
是比上述
task loop
中继更底层的命令家族——JSON输入/输出,每个命令直接生成/评分代理并遵守
--ceiling
(每个循环的令牌预算;达到限制时自动停止并升级)。人工通过
task loops --kill <loopId>
监控/终止循环;他们不会创建循环。
bash
5dive loop spawn --role=maker|verifier|worker --agent=<type|name> \
  --prompt="…" [--schema=<json>] [--ceiling=<tok>] [--wait[=<sec>]]
5dive loop verify --target=<id> --verifier=<agent> [--accept="…"]
5dive loop grade  --target=<id> --verifier=<agent> [--accept="…"] [--threshold=0-100] [--wait]
5dive loop panel  --n=<k> --lens="correctness,security" --claim="…" --quorum=<m>   # 评审团
5dive loop map    --over=<json-array> --do=<spawn-spec> [--max-concurrency=<n>]    # 扇出
5dive loop until-dry --round=<spawn-spec> --stop-after=<K> --dedup-key="…"         # 清空队列
5dive loop collect --handles=<id,id,…>       # 收集生成的代理结果
5dive loop status  --handle=<loopId>         # 只读的单个循环详情
5dive loop install <slug> --onto=<agent> [--cron="…"] [--ceiling=<tok>] [--dry-run]
                                             # 将市场循环包(角色 +
                                             # 技能 + 节奏)安装到代理上;先通过
                                             # `loop show <slug>`预览

Objectives: a standing goal bound to a live metric

目标:将结果分解为任务图

5dive objective
(OSS-19) is different from
goal
: not a one-shot task DAG but a standing target tied to a read-only metric command that gets re-measured each
tick
. Use it to track a number you want to move (conversion %, warm-pool size, error rate) rather than to decompose work.
bash
5dive objective add "warm pool >= 1" --metric-cmd="5dive ps --warm --json | jq length" \
  --target=1 --direction=up [--unit=count] [--public]
5dive objective ls | show <name> | tick [<name>] | pause <name> | rm <name>
5dive objective resume <name> [--force]   # --force bypasses an OSS-33 preflight refusal
                                          # (the planner role currently can't do the work)
--metric-cmd
must be read-only (it runs every tick);
--direction
says whether higher or lower is better;
--public
surfaces it on the public scoreboard.
tick
re-measures now;
pause
/
resume
stop/restart measurement;
rm
retires it.
Self-steer it:
objective replan <name>
(OSS-27/OSS-33) drives one cycle — a planner proposes a diff (new/reprioritized/cancelled tasks) toward the target, validated like a
goal add
plan:
bash
5dive objective replan warm-pool --dry-run --json     # see the proposed diff, create nothing
5dive objective replan warm-pool --json \
  [--max-new-per-cycle=3] [--no-progress-limit=3] [--yes] [--from-gate=<id>]
5dive goal add
将一行结果转换为经过验证、受管控的任务DAG(任务 +
task_deps
边 + 项目下的受让人)——DIVE-984。规划代理会提出方案;在创建任何内容之前,会检查DAG的无环性、大小/深度限制、等级下限和可分配性。如果超过数量检查点或包含任何Tier-2任务,会有一个决策审核保留计划,直到人工批准才会生成内容。
bash
5dive goal add "ship a public status page" --dry-run --json   # 规划并渲染,不创建任何内容
5dive goal add "ship a public status page" --json \
  [--project=<key>] [--planner=<agent>] [--max-tasks=12] [--depth-cap=5] \
  [--checkpoint=6] [--ceiling=40000] [--yes]

--yes waives ONLY the count-over-checkpoint gate — a Tier-2 task in the diff

--yes仅豁免数量检查点;包含Tier-2任务的计划仍会强制审核。

still hard-gates, and nothing under --shadow/--propose-only is waivable.

--no-progress-limit=N auto-pauses the objective after N flat/adverse cycles.


Always `--dry-run` a replan first, same discipline as `goal add`.
5dive goal add --from-gate=<id> --json # 生成人工已回复“approve”的计划 # (这是生成Tier-2计划的唯一途径)

请始终先执行`--dry-run`查看计划;真正的add操作才会创建工作。

Governance votes:
5dive council

目标:绑定实时指标的长期目标

For decisions that should be a recorded vote rather than one agent's call — membership motions, constitutional amendments, or routing an open gate to a deliberation — use
5dive council
.
council convene "<question>"
dispatches to the real seated agents (each votes via its own harness, blind first round) and seals an auditable, tamper-evident verdict;
council gate-clear <task>
routes an open tier-1 gate to the council instead of a human (a tier-2 or human-only-type gate is never self-cleared, always bumped up). Writes (
init
,
promote
/
demote
/
expel
,
bench add/rm
) are sudo-gated; reads (
roster
,
log
,
verify
) are not. See
references/commands.md
for the full verb surface — this is a governance primitive, reach for it deliberately, not as a substitute for a normal
task need
gate.
5dive objective
(OSS-19)与
goal
不同:它不是一次性任务DAG,而是与只读指标命令绑定的长期目标,每次
tick
都会重新测量。用于跟踪你希望改变的数值(转化率、热池大小、错误率),而非分解工作。
bash
5dive objective add "warm pool >= 1" --metric-cmd="5dive ps --warm --json | jq length" \
  --target=1 --direction=up [--unit=count] [--public]
5dive objective ls | show <name> | tick [<name>] | pause <name> | rm <name>
5dive objective resume <name> [--force]   # --force绕过OSS-33预检拒绝
                                          # (当前规划角色无法完成工作)
--metric-cmd
必须是只读的(每次
tick
都会运行);
--direction
表示数值越高越好还是越低越好;
--public
会将其显示在公共计分板上。
tick
会立即重新测量;
pause
/
resume
停止/恢复测量;
rm
会终止目标。
自导向:
objective replan <name>
(OSS-27/OSS-33)驱动一个周期——规划代理会提出朝向目标的差异(新任务/重新排序任务/取消任务),像
goal add
计划一样进行验证:
bash
5dive objective replan warm-pool --dry-run --json     # 查看建议的差异,不创建任何内容
5dive objective replan warm-pool --json \
  [--max-new-per-cycle=3] [--no-progress-limit=3] [--yes] [--from-gate=<id>]

Delegated push:
5dive push

--yes仅豁免数量超过检查点的审核——差异中的Tier-2任务仍会强制审核,且--shadow/--propose-only下的内容无法豁免。

--no-progress-limit=N 在N个周期无进展/进展不利后自动暂停目标。

An agent created with
--can-push
(needs
--isolation=standard
, the default) can push ONE named feature branch for PR review once its task's gate is cleared and bound to that branch —
5dive push DIVE-42 [--branch=<b>] [--dry-run]
. The agent's own process never touches a GitHub token; a root-only helper mints one scoped to just that repo, pushes, and discards it.
sudo 5dive push setup
(once per box) scaffolds the GitHub App config — never pass the private key on argv.

请始终先执行`--dry-run`查看重规划,与`goal add`遵循相同的原则。

Company wizard:
5dive company

治理投票:
5dive council

5dive company --yes --name=<n> --objective="<outcome>" --metric-cmd="<cmd>" --target=<n> --direction=up|down
is sugar over
project add
+
objective add
(+ optional
goal add
) — use it to stand up a whole self-steering project namespace in one call instead of three. Bare (TTY) walks an interactive wizard.
对于不应由单个代理决策的事项——成员变动、章程修订,或将开放审核路由至审议——请使用
5dive council
council convene "<question>"
会发送给实际就位的代理(每个代理通过自身框架投票,首轮盲投)并生成可审计、防篡改的结论;
council gate-clear <task>
会将开放的tier-1审核路由至理事会而非人工(tier-2或仅人工类型的审核永远不会自动清除,始终升级)。写入操作(
init
promote
/
demote
/
expel
bench add/rm
)需要sudo权限;读取操作(
roster
log
verify
)不需要。完整命令列表请查看
references/commands.md
——这是治理原语,请谨慎使用,不要替代普通的
task need
审核。

Search team memory before re-deriving

委托推送:
5dive push

5dive memory search
is the read-path into the accumulated markdown memory — your own
~/.claude/projects/*/memory
stores plus the shared team wiki when the box has one. BM25-ranked snippets with file+heading provenance, capped at a token ceiling. Read-only, no sudo, nothing leaves the box.
bash
5dive memory search "hetzner capacity gotchas" --json
5dive memory search "deploy rollback" --limit=4 --max-tokens=800
5dive memory search "auth" --roots=/path/a,/path/b   # override the default roots
5dive memory search "auth" --store=wiki   # all (default) | mine | wiki
5dive memory search "auth" --agent=marcus # another agent's store (per-user 0600 — root only)
Reach for it before re-deriving past decisions, debugging something a teammate already hit, or answering "have we seen this before?" — retrieval beats re-reading whole memory files into context.
Compile the write-path:
memory add
.
The read-path has a write twin — this is the CLI behind the "compile before you close" mandate. Body on stdin; it writes a frontmatter markdown file into your own store (or the shared team wiki with
--store=wiki
, the publish path teammates can search), stamps provenance, and appends the store's index line. A token/key tripwire refuses secret-shaped bodies (
--force
does NOT bypass it).
bash
echo "$BODY" | 5dive memory add --name=hetzner-cpx-drought \
  --description="cpx line delisted post price-hike; cx dry-run false-positive" \
  --type=reference --store=wiki --tags=hetzner,capacity \
  [--valid-to=2026-12-31] [--supersedes=<slug>] [--confidence=high] [--provenance="<src>"]
通过
--can-push
创建的代理(需要
--isolation=standard
,默认设置)在其任务审核通过并绑定到指定功能分支后,可推送该分支以供PR审查——
5dive push DIVE-42 [--branch=<b>] [--dry-run]
。代理自身进程永远不会接触GitHub令牌;仅root可用的辅助程序会生成仅针对该仓库的令牌,推送后立即丢弃。
sudo 5dive push setup
(每台主机执行一次)会搭建GitHub应用配置——永远不要在命令行参数中传递私钥。

lifecycle envelope (DIVE-1024): recall demotes/flags expired, superseded, low-confidence.

公司向导:
5dive company

5dive memory doctor --json # hygiene: index drift, dangling [[links]], stale refs, near-dupes
undefined
5dive company --yes --name=<n> --objective="<outcome>" --metric-cmd="<cmd>" --target=<n> --direction=up|down
project add
+
objective add
(+可选
goal add
)的简化命令——用于一次性创建完整的自导向项目命名空间,而非分三次调用。不带参数(TTY环境)会启动交互式向导。

Read the fleet: digest, usage, supervisor

在重新推导前搜索团队记忆

Three read-only surfaces, no agent reasoning, no tokens burned:
bash
undefined
5dive memory search
是累积Markdown记忆的读取路径——包括你自己的
~/.claude/projects/*/memory
存储,以及主机上的共享团队知识库。结果是BM25排名的片段,带有文件+标题来源,受令牌上限限制。只读,无需sudo,内容不会离开主机。
bash
5dive memory search "hetzner capacity gotchas" --json
5dive memory search "deploy rollback" --limit=4 --max-tokens=800
5dive memory search "auth" --roots=/path/a,/path/b   # 覆盖默认根目录
5dive memory search "auth" --store=wiki   # all(默认) | mine | wiki
5dive memory search "auth" --agent=marcus # 其他代理的存储(每个用户权限0600——仅root可用)
在重新推导过往决策、调试队友已遇到的问题,或回答“我们之前遇到过这个问题吗?”之前,请先使用该命令——检索比重新读取整个记忆文件更高效。
**写入路径编译:
memory add
。**读取路径有对应的写入命令——这是“关闭前编译”要求背后的CLI。内容通过标准输入传递;它会将带有前置元数据的Markdown文件写入你自己的存储(或通过
--store=wiki
写入共享团队知识库,队友可搜索的发布路径),标记来源,并附加到存储的索引行。令牌/密钥触发机制会拒绝类似密钥的内容(
--force
也无法绕过)。
bash
echo "$BODY" | 5dive memory add --name=hetzner-cpx-drought \
  --description="cpx line delisted post price-hike; cx dry-run false-positive" \
  --type=reference --store=wiki --tags=hetzner,capacity \
  [--valid-to=2026-12-31] [--supersedes=<slug>] [--confidence=high] [--provenance="<src>"]

Standup digest: shipped last 24h / in progress / open human gates /

生命周期包(DIVE-1024):记忆会降级/标记过期、被取代、低置信度的内容。

auto-cleared gates / token burn / heartbeat health.

5dive digest --json # --7d widens the window sudo 5dive digest --send # deliver to the paired Telegram chat sudo 5dive digest on --at=7 # opt in to daily auto-delivery (default OFF); off | status
5dive memory doctor --json # 健康检查:索引漂移、悬空[[链接]]、过时引用、近似重复
undefined

Token burn, per agent / per task (subscription tokens, no dollars).

查看集群状态:摘要、使用情况、监控

5dive usage --json # board: top agents + top tasks, 24h (--7d) 5dive usage worker-1 --json # one agent: per-model + per-task breakdown 5dive cost --json # budget-focused board: per-agent 24h burn vs soft/ceiling + state 5dive activity worker-1 --json # what it actually DID: files touched, commands run, cost # (--task=DIVE-N to scope · --limit=N · --7d) 5dive usage loops --json # spend rolled up per loop / topology sudo 5dive usage budget set worker-1 --daily=2000000 [--ceiling=<tok>] [--hard-stop] # --daily soft cap -> ⚠ on the board; hard-stop OFF by default sudo 5dive usage budget ls # all budgets;
budget clear worker-1
removes one
三个只读界面,无需代理推理,不消耗令牌:
bash
undefined

Fleet health board: per-agent state, classification, cause, last activity.

站会摘要:过去24小时交付内容 / 进行中任务 / 开放人工审核 /

Classes: healthy | slow | update-pending | stuck | drift (cause one of

自动清除审核 / 令牌消耗 / heartbeat健康状态。

service-dead|tmux-dead|poller-dead|loop-stuck|no-progress|stale-cli|goal-drift).

The BOARD is observe-only. Recovery is a separate opt-in: the P2 ladder

(DIVE-857/970) sits behind its own root sentinel (supervisor.actions.enabled)

and, when flipped on, walks a stuck agent through nudge -> resume -> rotate

with exponentially spaced attempts, escalating to the paired human when the

ladder is exhausted. Sentinel absent = zero actions, audit-only ticks.

sudo 5dive supervisor sudo 5dive supervisor --watch # live repaint (default 5s)
5dive digest --json # --7d扩大时间窗口 sudo 5dive digest --send # 发送到配对的Telegram聊天 sudo 5dive digest on --at=7 # 选择加入每日自动发送(默认关闭);off | status

Crash-loop detection is SEPARATE — it lives in the restart wrapper

令牌消耗,按代理/任务统计(订阅令牌,无美元成本)。

(hooks/run-loop.sh, DIVE-1029): exponential backoff on an agent dying within

seconds, surfaces the real stderr once, and SUPPRESSES the false "usage limit

reset, agent resumed" banner while it's actually just crashing.


Check `usage` (or `account usage` for rate-limit headroom) **before** blaming
quota for a failure or moving agents between accounts; check `supervisor`
before restarting an agent on a hunch.
5dive usage --json # 面板:顶级代理 + 顶级任务,24小时(--7d) 5dive usage worker-1 --json # 单个代理:按模型 + 任务细分 5dive cost --json # 预算聚焦面板:每个代理24小时消耗 vs 软上限/硬上限 + 状态 5dive activity worker-1 --json # 实际操作:触摸的文件、运行的命令、成本 # (--task=DIVE-N 筛选 · --limit=N · --7d) 5dive usage loops --json # 按循环/拓扑汇总花费 sudo 5dive usage budget set worker-1 --daily=2000000 [--ceiling=<tok>] [--hard-stop] # --daily软上限 -> 面板上显示⚠;默认不启用硬停止 sudo 5dive usage budget ls # 所有预算;
budget clear worker-1
删除单个预算

Control other boxes:
5dive fleet

集群健康面板:每个代理的状态、分类、原因、最后活动时间。

分类:healthy | slow | update-pending | stuck | drift(原因包括

service-dead|tmux-dead|poller-dead|loop-stuck|no-progress|stale-cli|goal-drift)。

面板仅用于观察。恢复是独立的可选功能:P2阶梯(DIVE-857/970)位于自身root哨兵(supervisor.actions.enabled)之后,

当启用时,会通过提示→恢复→轮换的方式逐步处理卡住的代理,尝试间隔呈指数增长,当阶梯用尽时升级至配对的人工。如果哨兵不存在,则无任何操作,仅记录审计信息。

When the operation spans more than this VM, a fleet registry maps box names to SSH targets (references only — host/user/port + a path to a key, never key material). One view and one command surface over all of them:
bash
sudo 5dive fleet add prod-2 --host=1.2.3.4 --key=/home/claude/.ssh/id_ed25519
5dive fleet ls
5dive fleet status --json          # per-box reachability + agent counts (parallel SSH)
5dive fleet agents --json          # every agent across the fleet, one view
5dive fleet send scout@prod-2 "status report please"
5dive fleet restart scout@prod-2
One unreachable box never fails the whole view.
add
/
rm
need root; the read surfaces don't.
sudo 5dive supervisor sudo 5dive supervisor --watch # 实时刷新(默认5秒)

Diagnose a sick host

崩溃循环检测是独立的——它位于重启包装器中(hooks/run-loop.sh,DIVE-1029):代理在数秒内崩溃时会指数退避,仅显示一次真实的标准错误流,

并在实际崩溃时抑制虚假的“使用限制重置,代理已恢复”横幅。

bash
sudo 5dive doctor --json
Envelope is always
{ ok: true, data: { summary, checks } }
with exit 0. Branch on
data.summary.errors > 0
. Add
--fix
(alias
--repair
) to attempt reversible fixes (apt installs, type installer recipes, registry reseed, dead poller restart);
--dry-run
previews them. Narrow the run with
--category=deps|types|auth|creds|registry|shelld|channels|host|memory
.
Other read surfaces worth knowing:
bash
sudo 5dive agent stats --all --json   # whole fleet: unit state, restarts, health
sudo 5dive agent stats worker-1 --json
5dive update --check --json           # is the CLI behind/stale? read-only, no root
sudo 5dive watch                      # htop-style live view (interactive TTY only)
5dive self-update
upgrades the CLI + plugins and restarts every agent on the host — never run it casually from an agent session; managed boxes update nightly on their own.

在因配额问题排查失败或在账户间移动代理之前,请检查`usage`(或`account usage`查看速率限制余量);在凭直觉重启代理之前,请检查`supervisor`。

Rules of engagement

控制其他主机:
5dive fleet

  1. Always pass
    --json
    .
    Parse the envelope. Don't grep stderr.
  2. One name = one agent. Names are lowercase letters/digits/hyphens, start with a letter, max 16 chars. Reuse a name only after
    agent rm
    .
  3. Don't share bot tokens. Two Telegram-channel agents on the same bot will race each other on
    getUpdates
    . Each agent needs its own.
  4. Tear down what you spin up. A leaked
    worker-N
    agent stays running across reboots — it's a real systemd unit, not a thread. On task completion call
    5dive agent rm <name>
    .
  5. Don't shell out to the underlying CLI binaries directly. Going around
    5dive
    skips the systemd unit, the audit log, and the env injection — the agent will run with broken auth and no restart loop.
  6. Read
    5dive --help
    if a flag is rejected as unknown — the binary on the host may be newer or older than this skill. The help output is authoritative.
  7. The
    auth login <type>
    path is interactive only.
    Never call it from your own session.
  8. When delegating a chat request, don't relay — hand off context. If a user pings you in a Telegram/Discord chat that another agent's bot also belongs to and asks you to involve that agent, use
    agent send --reply-to-chat=<id> --reply-to-msg=<id>
    (values come straight from the inbound
    <channel>
    tag's attributes). The target replies directly in the chat from its own bot — relaying through you adds latency, breaks attribution, and makes the user re-read your paraphrase of the answer.
  9. Blocked on a human? Gate it. Use
    task need
    with a recommendation instead of guessing or letting the task rot silently.
  10. Debug a task's history with
    5dive trace <id|DIVE-N>
    , not by reconstructing it by hand.
    It's read-only and reconstructs the full goal-to-ship timeline plus a
    verdict:
    line (zero-human vs human-in-the-loop, counted from actual human-cleared gates, not effort).
  11. Before trusting the fleet's own rails, run
    5dive selfcheck --json
    .
    It proves gate delivery, the audit log, bundle integrity, and the scorecard for real in an isolated sandbox rather than just reporting green — treat any
    not-reached
    probe as "unmeasured here", not "fine".
  12. Don't hardcode a model id — check
    5dive models [--json]
    .
    It's the live source of truth for what
    opus
    /
    sonnet
    /
    fable
    /
    haiku
    currently resolve to; the alias and the underlying id drift across releases.
当操作涉及多台虚拟机时,集群注册表会将主机名称映射到SSH目标(仅引用——主机/用户/端口 + 密钥路径,不包含密钥内容)。通过一个界面和命令集管理所有主机:
bash
sudo 5dive fleet add prod-2 --host=1.2.3.4 --key=/home/claude/.ssh/id_ed25519
5dive fleet ls
5dive fleet status --json          # 每台主机的可达性 + 代理数量(并行SSH)
5dive fleet agents --json          # 集群中所有代理的统一视图
5dive fleet send scout@prod-2 "status report please"
5dive fleet restart scout@prod-2
一台主机不可达不会导致整个视图失败。
add
/
rm
需要root权限;读取界面不需要。

Reference

诊断故障主机

  • references/commands.md
    — every subcommand and flag, copy/pasteable.
  • references/exit-codes.md
    — exit codes & error classes.
  • references/paths.md
    — on-disk state layout (only for debugging).
bash
sudo 5dive doctor --json
输出包始终为
{ ok: true, data: { summary, checks } }
,退出码为0。根据
data.summary.errors > 0
进行分支判断。添加
--fix
(别名
--repair
)尝试可逆修复(apt安装、类型安装程序、注册表重新初始化、重启无响应的轮询器);
--dry-run
预览修复操作。可通过
--category=deps|types|auth|creds|registry|shelld|channels|host|memory
缩小运行范围。
其他值得了解的读取界面:
bash
sudo 5dive agent stats --all --json   # 整个集群:单元状态、重启次数、健康状态
sudo 5dive agent stats worker-1 --json
5dive update --check --json           # CLI是否落后/过时?只读,无需root权限
sudo 5dive watch                      # htop风格的实时视图(仅交互式TTY可用)
5dive self-update
会升级CLI + 插件并重启主机上的所有代理——永远不要从代理会话中随意运行;托管主机每天夜间会自动更新。

Going further

参与规则

The full reference manual lives at https://5dive.com/docs. If a flag in this skill conflicts with what the running binary accepts, trust the binary — run
sudo 5dive --help
or
sudo 5dive agent <sub> --help
directly and follow that.
Synced to 5dive CLI 0.16.30 (2026-07-27). A given box's binary can lag by up to a day behind main (nightly update channel) — trust
5dive --help
if they differ.
  1. **始终传递
    --json
    。**解析输出包。不要通过grep标准错误流获取信息。
  2. **一个名称对应一个代理。**名称由小写字母/数字/连字符组成,以字母开头,最多16个字符。仅在
    agent rm
    后才可重复使用名称。
  3. **不要共享机器人令牌。**两个使用同一机器人令牌的Telegram频道代理会在
    getUpdates
    上产生冲突。每个代理需要独立的令牌。
  4. **销毁你生成的代理。**泄露的
    worker-N
    代理会在重启后继续运行——它是真实的systemd单元,而非线程。任务完成后请调用
    5dive agent rm <name>
  5. **不要直接调用底层CLI二进制文件。**绕过
    5dive
    会跳过systemd单元、审计日志和环境注入——代理会运行在身份验证失效且无重启循环的状态。
  6. 如果标志被拒绝为未知,请阅读
    5dive --help
    ——主机上的二进制文件可能比本技能更新或更旧。帮助输出是权威的。
  7. **
    auth login <type>
    路径仅适用于交互式环境。**永远不要从你的会话中调用它。
  8. **转交聊天请求时,不要中转——传递上下文。**如果用户在其他代理的机器人也加入的Telegram/Discord聊天中Ping你,并要求你联系该代理,请使用
    agent send --reply-to-chat=<id> --reply-to-msg=<id>
    (值直接来自入站
    <channel>
    标签的属性)。目标代理会通过自身机器人直接在聊天中回复——通过你中转会增加延迟、破坏归属关系,并让用户重新阅读你转述的答案。
  9. **因人工受阻?设置审核。**使用
    task need
    并提供建议,不要猜测或让任务无声无息地搁置。
  10. **使用
    5dive trace <id|DIVE-N>
    调试任务历史,不要手动重建。**它是只读的,可重建从目标到交付的完整时间线,以及
    verdict:
    行(零人工参与 vs 人工参与,根据实际人工清除的审核统计,而非工作量)。
  11. **在信任集群自身的流程之前,请运行
    5dive selfcheck --json
    。**它会在隔离沙箱中实际验证审核交付、审计日志、包完整性和计分板——将任何
    not-reached
    探测视为“此处未测量”,而非“正常”。
  12. **不要硬编码模型ID——请检查
    5dive models [--json]
    。**这是
    opus
    /
    sonnet
    /
    fable
    /
    haiku
    当前实际对应的模型ID的实时来源;别名和底层ID会随版本更新而变化。

参考资料

  • references/commands.md
    — 所有子命令和标志,可直接复制粘贴。
  • references/exit-codes.md
    — 退出码 & 错误类别。
  • references/paths.md
    — 磁盘上的状态布局(仅用于调试)。

深入了解

完整参考手册请访问https://5dive.com/docs。如果本技能中的标志与运行中的二进制文件接受的标志冲突,请以二进制文件为准——直接运行
sudo 5dive --help
sudo 5dive agent <sub> --help
并遵循其说明。
与5dive CLI 0.16.30(2026-07-27)同步。特定主机上的二进制文件可能比主分支落后最多一天(夜间更新频道)——如果存在差异,请以
5dive --help
为准。