5dive-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese5dive-cli
5dive-cli
This skill teaches you to drive the 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 and parsing the JSON envelope
it emits when you pass .
5divesudo 5dive ...--json本技能将教你在5dive运行时虚拟机上操作命令。你当前正运行在这样一台虚拟机中。你可以通过执行命令在同一主机上生成额外的代理,并解析其传递参数时输出的JSON包。
5divesudo 5dive ...--jsonWhen 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 , then
sudo 5dive agent list --json(and pass chat context if the request came from a channel — see "Delegating a request that came in over a channel" below).agent send - 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 () or an agent should be woken only when it has queued work (
task add --recurring).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 (), or a task should quietly wait until a date (
5dive task need).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 (), is any agent stuck/drifting (
5dive usage), what shipped in the last 24h (5dive supervisor).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)、过去24小时交付了哪些内容(5dive supervisor)。5dive digest
如果用户只是希望你直接完成工作,则无需生成代理。
Mental model
核心模型
Everything the CLI does maps onto these resources on the host:
- One agent = one Linux user () + one systemd unit (
agent-<name>) + one tmux session (5dive-agent@<name>.service) running the chosen CLI in a restart loop.agent-<name> - Auth is decoupled. You authenticate a type once; every agent of that
type inherits the credentials via .
EnvironmentFile - A channel (/
telegram/discord/dashboard, comma-listable) is the inbound message surface. All agent types support channels; each agent needs its own bot token.none(claude-only, token-free) is web-dashboard chat and is folded into every claude create by default —dashboardopts out.--channels=none - The CLI is idempotent and safe to call from another agent, but is gated by isolation tier (DIVE-1002). New agents default to
sudo— zero sudo. Only the first agent on a fresh box, or one created withstandard, gets a scoped grant: the--isolation=adminCLI plus non-paging5diveofsystemctl start|stop|restartunits — NOT5dive-*. So the no-sudo surfaces (NOPASSWD:ALL,5dive task,org,memory) run from any agent; the root surfaces (usage/agent create/config,pair,heartbeat on/off) need an admin agent.doctorruns the deferred self-restart internally so an admin never needs a raw grant. For manual unit lifecycle there's a scoped primitive,agent restart <name> --defer— 5dive-owned units only, no eval/pager (the admin sudoers dropped its rawsudo 5dive agent _svc <start|stop|restart> <5dive-unit>lines because sudo-rs on Ubuntu 26.04 rejects wildcards inside command arguments, DIVE-1088).systemctl
Agent types on a current host: . Run for what's actually
installed — the set changes between releases.
antigravity codex claude openclaw hermes grok opencodesudo 5dive agent types --jsonCLI的所有操作都对应主机上的以下资源:
- 一个agent(代理) = 一个Linux用户() + 一个systemd单元(
agent-<name>) + 一个tmux会话(5dive-agent@<name>.service),该会话以重启循环运行选定的CLI。agent-<name> - 身份验证是解耦的。你只需对一种代理类型进行一次身份验证;该类型的所有代理都会通过继承凭据。
EnvironmentFile - channel(频道)(/
telegram/discord/dashboard,可逗号分隔列表)是入站消息的入口。所有代理类型都支持频道;每个代理需要独立的机器人令牌。none(仅Claude可用,无需令牌)是Web仪表板聊天,默认会集成到每个Claude代理中——可通过dashboard选择退出。--channels=none - CLI具有幂等性,可从其他代理安全调用,但**权限受隔离等级限制**(DIVE-1002)。新代理默认使用
sudo等级——无sudo权限。只有新主机上的第一个代理,或通过standard创建的代理,才能获得受限权限:可使用--isolation=adminCLI,以及对5dive单元执行非分页的5dive-*操作——并非systemctl start|stop|restart。因此,无需sudo的功能(NOPASSWD:ALL、5dive task、org、memory)可从任何代理运行;需要root权限的功能(usage/agent create/config、pair、heartbeat on/off)需要管理员代理。doctor会在内部执行延迟自重启,因此管理员永远不需要原始权限授予。对于手动单元生命周期管理,有一个受限原语:agent restart <name> --defer——仅针对5dive所属单元,无eval/分页功能(Ubuntu 26.04上的sudo-rs拒绝命令参数中的通配符,因此管理员sudoers删除了原始sudo 5dive agent _svc <start|stop|restart> <5dive-unit>命令行,DIVE-1088)。systemctl
当前主机上的代理类型:。执行查看实际已安装的类型——该集合会随版本更新而变化。
antigravity codex claude openclaw hermes grok opencodesudo 5dive agent types --jsonOutput contract — always pass --json
--json输出约定——始终传递--json
--jsonPass as a global flag (anywhere on the command line). Stdout
becomes a stable envelope; progress lines stay on stderr.
--jsonbash
sudo 5dive agent create scout --type=claude --jsonSuccess:
json
{ "ok": true, "data": { "name": "scout", "type": "claude", "created": true } }Failure (exit code matches ):
error.codejson
{ "ok": false, "error": { "code": 6, "class": "auth_required", "message": "..." } }Branch on , not on the human message. Classes:
, , , , , ,
, , , , , .
error.classokusagevalidationnot_foundconflictauth_requirednot_installednot_runningpairingpermissiontimeoutgenericSee for the full table.
references/exit-codes.md将作为全局标志传递(可放在命令行任意位置)。标准输出将变为稳定的JSON包;进度信息将输出到标准错误流。
--jsonbash
sudo 5dive agent create scout --type=claude --json成功输出:
json
{ "ok": true, "data": { "name": "scout", "type": "claude", "created": true } }失败输出(退出码与匹配):
error.codejson
{ "ok": false, "error": { "code": 6, "class": "auth_required", "message": "..." } }**根据进行分支判断,而非人工可读消息。**错误类别包括:, , , , , , , , , , , 。
error.classokusagevalidationnot_foundconflictauth_requirednot_installednot_runningpairingpermissiontimeoutgeneric完整列表请查看。
references/exit-codes.mdRecipes
使用示例
Spawn a worker for a side task
生成辅助代理处理任务
bash
undefinedbash
undefined1. 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
--type=claude
--workdir=/home/claude/projects/myrepo
--json
sudo 5dive agent create worker-1
--type=claude
--workdir=/home/claude/projects/myrepo
--json
--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"
"audit the auth middleware for OWASP A01 issues; report back as a markdown bullet list"
sudo 5dive agent send worker-1
"审核身份验证中间件是否存在OWASP A01问题;以Markdown项目符号列表形式返回报告"
"审核身份验证中间件是否存在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-1agent fireagent rm5dive fire worker-1
/ agent fire
是agent rm
的别名(同样是受管控的销毁操作)——与5dive hire
相对应。
5dive fire worker-1agent fireagent rm5dive hireteardown) — the counterpart to 5dive hire
.
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--dry-runy/N--yesagent import除了空白的团队成员,你还可以从代理市场(角色包注册表,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--dry-runy/N--yesagent importInspect / import a persona pack
检查/导入角色包
agent import.tar.gzinspectbash
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] --jsonA pack's hooks are arbitrary shell that auto-runs on the new agent's tool
events (the agentjacking surface), so is deny-by-default on hooks
— stripped unless you pass (DIVE-995/1009) — and refuses any
member with a /absolute path or a symlink (zip-slip + link-escape guards,
DIVE-1010/1012).
import--allow-hooks..agent import.tar.gzinspectbash
5dive agent inspect <slug|pack.tar.gz> --json # 查看该包会运行哪些shell/钩子/技能
sudo 5dive agent import <slug|pack.tar.gz> --as=<name> [--allow-hooks] --json角色包的钩子是任意shell脚本,会在新代理的工具事件中自动运行(存在代理劫持风险),因此默认拒绝钩子——除非传递(DIVE-995/1009),否则钩子会被移除;同时会拒绝包含/绝对路径或符号链接的成员(防止zip-slip和链接逃逸,DIVE-1010/1012)。
import--allow-hooks..Skill inheritance on agent-spawned children
代理生成子代理时的技能继承
When an agent (you, ) creates another agent of any
supported type, the CLI auto-installs the skill into the child
so it inherits inter-agent comms knowledge. Humans creating from the
dashboard don't get this default. Override either way:
SUDO_USER=agent-*5dive-cli- — explicit list. Each spec is a bare id (defaults to
--with-skills=<spec>[,<spec>...]) or5dive-ai/skills. Example:<owner/repo>:<id>.--with-skills=5dive-cli,acme/skills:db-tools - — opt out, even when called from another agent.
--no-skills - — seed the new hire's recall store from shared knowledge so it boots knowing the company (DIVE-990). Scope is a comma-list:
--inherit-memory=<scope>, a siblingwiki(its SHAREABLE facts only), or<agent-name>/all.team - — 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.
--no-team-bot
当一个代理(你,)创建任何支持类型的代理时,CLI会自动将技能安装到子代理中,使其继承代理间通信知识。从仪表板创建代理的用户不会获得此默认设置。可通过以下方式覆盖默认行为:
SUDO_USER=agent-*5dive-cli- ——显式技能列表。每个spec可以是裸ID(默认来自
--with-skills=<spec>[,<spec>...])或5dive-ai/skills。示例:<owner/repo>:<id>。--with-skills=5dive-cli,acme/skills:db-tools - ——选择退出,即使从其他代理调用也不继承技能。
--no-skills - ——从共享知识中为新代理初始化记忆存储,使其启动时了解公司情况(DIVE-990)。范围是逗号分隔列表:
--inherit-memory=<scope>、兄弟代理wiki(仅其可共享的事实)、<agent-name>/all。team - ——当主机有共享团队机器人时,新的无机器人代理会自动关联(拥有独立论坛主题,使用共享令牌仅发送消息);此参数可选择退出。
--no-team-bot
Create-then-auth: --defer-auth
--defer-auth先创建后验证:--defer-auth
--defer-authUse 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 ; combine with to bind a profile slot
that doesn't yet have a .
agent create--auth-profile=<name>combined.envbash
sudo 5dive agent create draft-bot --type=claude --defer-auth --json当你希望先注册代理再配置凭据时使用(例如,代理自身的首次运行UI将处理登录)。跳过时的身份验证环节;结合绑定尚未配置的配置文件槽位。
agent create--auth-profile=<name>combined.envbash
sudo 5dive agent create draft-bot --type=claude --defer-auth --jsonBYO API key: --provider
(hermes / openclaw / claude)
--provider自带API密钥:--provider
(hermes / openclaw / claude)
--providerhermesopenclaw--defer-authbash
sudo 5dive agent create cheap-bot --type=openclaw \
--provider=openrouter --api-key=- --json # key on stdinProviders: .
openrouter google minimax moonshot huggingface anthropic deepseek qwen nous openai zaiSince 0.8.0, also works on — real Claude Code
pointed at a BYO endpoint — for the subset with an Anthropic-compatible API:
. It requires (the
creds are profile-scoped) and wires /
plus safe per-tier model defaults into that profile. Override any tier with
at create, or later
(DIVE-1103). OpenRouter's Anthropic-skin endpoint translates, so any
OpenRouter slug works (, , , , …) —
but keep the background HAIKU slot on a prompt-caching-capable model or
every background call pays full price.
--provider--type=claudeopenrouter deepseek moonshot zai--auth-profile=<name>ANTHROPIC_BASE_URLANTHROPIC_AUTH_TOKEN--model=<slug>agent config set model=<slug>openai/*google/*z-ai/*deepseek/*hermesopenclaw--defer-authbash
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版本开始,也适用于——指向自带端点的真实Claude Code,适用于具有Anthropic兼容API的子集:。需要(凭据与配置文件绑定),并将/以及安全的按等级模型默认值写入该配置文件。创建时可通过覆盖任何等级,或之后通过修改(DIVE-1103)。OpenRouter的Anthropic兼容端点支持翻译,因此任何OpenRouter slug都可使用(、、、等)——但请确保后台HAIKU槽使用支持提示缓存的模型,否则每次后台调用都需支付全额费用。
--provider--type=claudeopenrouter deepseek moonshot zai--auth-profile=<name>ANTHROPIC_BASE_URLANTHROPIC_AUTH_TOKEN--model=<slug>agent config set model=<slug>openai/*google/*z-ai/*deepseek/*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=highbash
sudo 5dive agent config worker-1 set model=claude-opus-4-8
sudo 5dive agent config worker-1 set effort=higheffort: 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"
doneWait, 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
undefinedfor type in claude codex opencode; do
sudo 5dive agent rm "fan-${type}" --json
done
undefinedDeclarative fleets: compose + team templates
声明式集群:组合与团队模板
For more than a couple of agents, declare the fleet in a and
let the CLI reconcile, docker-compose style:
5dive.yamlbash
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)当需要管理多个代理时,可在中声明集群,让CLI像docker-compose一样协调:
5dive.yamlbash
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
5dive crew托管CrewAI团队:5dive crew
5dive crewThe 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
(), and a co-signed receipt per run.
CREWAI_STORAGE_DIRbash
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_DIRbash
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从auth_required
错误中恢复
auth_requiredbash
undefinedbash
undefinedIf 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
auth poll-> 会话ID;将auth poll
返回的URL提供给用户;用户通过auth submit
粘贴回调码。
auth pollauth submitcallback code back via auth submit
.
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多账户:account
命令
accountA 5dive account is a named auth profile — one bag of credentials that any
number of agents can share via . 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.
--auth-profile=<name>5dive account ...agent auth start|poll|submit|cancelbash
undefined5dive的**account(账户)**是命名的身份验证配置文件——一组凭据,可通过被任意数量的代理共享。当主机有多个用户/计费身份(例如,工作和个人Anthropic登录)且不同代理应使用不同身份时使用。
--auth-profile=<name>5dive account ...agent auth start|poll|submit|cancelbash
undefinedInventory: 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.
remove重命名/删除账户。删除时如果仍有代理绑定到该账户会拒绝操作。
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 pairbash
undefinedagent pairbash
undefinedA) 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] --jsonname-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: reads the value from stdin and writes it into
root-owned without the secret ever touching argv or
the audit log (DIVE-930/932).
5dive secret write <KEY> --connector=<name>/etc/5dive/connectors/Who may talk to the bot is governed by the agent's . Read /
write it without touching the file by hand (the plugin re-reads per message,
no restart needed):
access.jsonbash
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可用的写入原语:从标准输入读取值并写入root拥有的目录,密钥永远不会接触命令行参数或审计日志(DIVE-930/932)。
5dive secret write <KEY> --connector=<name>/etc/5dive/connectors/谁可以与机器人通信由代理的控制。无需手动编辑文件即可读写该文件(插件会在每次消息时重新读取,无需重启):
access.jsonbash
sudo 5dive agent telegram-access get worker-1 --json
echo '{"dmPolicy":"allowlist","allowFrom":[433634012],"groups":{}}' \
| sudo 5dive agent telegram-access set worker-1Shortcut 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 () is the
sole consumer. Per-agent bridges go 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 gates stay tappable in team-bot mode.
5dive-team-bot-listenergetUpdatesTELEGRAM_SEND_ONLYtask needbash
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 topicrefresh-listenerself-updateteam-bot shared无需每个代理使用独立的机器人令牌,主机可运行共享的团队机器人:所有代理使用单个令牌发布到一个Telegram论坛群组(每个代理拥有独立主题),且有一个root监听器服务()是唯一的消费者。每个代理的桥接器设置为仅发送(,在启动时传播到每个桥接器的环境中),这消除了每个令牌一个消费者的409冲突(DIVE-1087);监听器还会自行处理审核按钮的点击,在回复前重新读取当前审核状态(DIVE-1093),因此审核在团队机器人模式下仍可点击。
5dive-team-bot-listenergetUpdatesTELEGRAM_SEND_ONLYtask needbash
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-listenerself-updateteam-bot sharedTalking to other agents (inter-agent comms)
与其他代理通信(代理间通信)
agent sendagent askagent sendagent askSending: attribution is automatic
发送:自动添加来源标识
When you (an agent) shell out to , the CLI
sees that is and wraps the payload as:
sudo 5dive agent send <name> "..."$SUDO_USERagent-<you>[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 . Skip wrapping with
(useful when you're piping a prompt that already has its own structure).
--from=<label>--rawHumans running directly never get auto-wrapped — only
sends from users do.
sudo 5dive agent sendagent-*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.
$()当你(一个代理)执行时,CLI会检测到是,并将消息内容包装为:
sudo 5dive agent send <name> "..."$SUDO_USERagent-<you>[5dive-msg from=<you> id=<8-hex>] <your text>这样接收方可以识别出是来自对等代理的消息,以及具体是哪个代理。可通过覆盖推断的名称。使用跳过包装(当你传递的提示已有自身结构时非常有用)。
--from=<label>--raw人工直接运行永远不会自动包装——只有用户发送的消息才会被包装。
sudo 5dive agent sendagent-*请用单引号包裹消息内容,并避免在其中使用反引号/——消息会通过shell传递,未加引号的替换会在你的代理端执行,导致消息内容被损坏。
$()Receiving: recognise the envelope and reply by name
接收:识别消息包并按名称回复
When a line like
[5dive-msg from=scout id=ab12cd34] please summarise the auth middleware auditappears 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 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.
[re=<id>]当出现如下内容作为你的输入时:
[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一次性同步调用:agent ask
agent askIf you want a request/response in one CLI call (no manual polling of
), use :
agent logsaskbash
sudo 5dive agent ask scout \
"list the OWASP A01 issues you found, one per line" \
--timeout=180 --jsonIt sends the wrapped envelope, then watches after the
marker line and returns once the scrollback has been quiet for
(default 5s). Stdout (text mode) is just the reply body; in mode the
envelope is .
tmux capture-pane--idle-secs--json{ok:true, data:{name, from, msg_id, reply}}Caveats — read these before leaning on :
ask- Idle-by-stability is heuristic. A receiver that streams progress
continuously will keep awake until
askfires. If you're asking for something the receiver might narrate (long agentic work), prompt it for a terse final summary or use plain--timeout+send.logs - 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.
- 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 logsaskbash
sudo 5dive agent ask scout \
"list the OWASP A01 issues you found, one per line" \
--timeout=180 --json它会发送包装后的消息包,然后在标记行之后监控,当滚动缓冲区安静(默认5秒)后返回结果。文本模式下的标准输出仅包含回复内容;模式下的消息包为。
tmux capture-pane--idle-secs--json{ok:true, data:{name, from, msg_id, reply}}注意事项——在依赖前请阅读以下内容:
ask- **基于稳定性判断空闲状态是启发式的。**持续输出进度信息的接收方会让保持活跃直到
ask触发。如果你请求的内容可能会被接收方详细描述(长耗时的代理任务),请提示其返回简洁的最终摘要,或使用普通的--timeout+send。logs - **回复内容是屏幕上显示的所有内容。**它包括接收方CLI输出的任何装饰信息(光标行、状态提示)——除非提示要求,否则不要期望得到干净的JSON内容。
- **无重试,无交付确认。**如果接收方在回复过程中崩溃,你会得到部分内容或超时,不会有中间状态。
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: (and
optional for thread replies) stamps the envelope so
the receiver gets a machine-readable hint instead of relying on you
describing the chat in prose.
--reply-to-chat=<id>--reply-to-msg=<id>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 tag whose attributes already carry exactly what
the flags want:
<channel><channel source="plugin:telegram:telegram" chat_id="433634012" message_id="4671" user="..." ts="...">
redirect to marketing
</channel>The mapping is one-for-one:
- attribute →
chat_id--reply-to-chat=<chat_id> - attribute →
message_id(optional; threads the reply)--reply-to-msg=<message_id>
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 on an incoming message, post your answer
directly in that chat via your own Telegram/Discord tool. Use
as the threaded 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.
reply-to-chat=<id>reply-to-msg=<id>reply_toIf 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] ...当你看到入站消息包含时,请通过自身的Telegram/Discord工具直接在该聊天中回复。使用作为线程化的,使消息作为引用回复显示。不要同时向发送方回复对等消息——他们已选择退出中转。
reply-to-chat=<id>reply-to-msg=<id>reply_to如果目标代理的机器人未加入该聊天,请省略这些标志,自行中转回复,并告知用户需要添加机器人。
Rules of thumb
经验法则
- For "fire-and-forget delegate, I'll check later": + poll
agent sendwhen it suits you.agent logs --tmux - For "I need an answer to continue": .
agent ask - For broadcast / fan-out across N agents: loop (or
agent sendin parallel viaagent ask+&). Each call is independent.wait - Don't reuse labels for unrelated agents — pick a label that names you, so receivers can address replies correctly.
--from - 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 (), so no sudo is needed —
any user can read and write directly.
/var/lib/5dive/tasksagent-*bash
undefined当你将工作扇出到多个代理时,主机有一个共享任务队列和组织架构图,让团队基于单一事实来源协作。两者都存储在可组写入的sqlite数据库中(),因此无需sudo权限——任何用户都可直接读写。
/var/lib/5dive/tasksagent-*bash
undefinedQueue 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
--assignee=worker-1 --priority=high --json
5dive task add "audit the auth middleware for OWASP A01"
--assignee=worker-1 --priority=high --json
--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 tasks for one initiative — open a
project. A project is a named task workspace with its own ident prefix
(e.g. , ) and an optional lead; tasks filed into it are
numbered in that namespace instead of the shared backlog. The default
project (prefix ) is that shared backlog and is always present.
DIVE-NFROG-1FROG-2DIVE-NdiveDIVEbash
undefined不要为一个计划创建大量零散的任务——请创建一个项目。项目是命名的任务工作区,拥有独立的标识前缀(例如、)和可选负责人;归入项目的任务会使用该命名空间编号,而非共享的待办事项。默认的项目(前缀)是共享待办事项,始终存在。
DIVE-NFROG-1FROG-2DIVE-NdiveDIVEbash
undefinedOpen 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
--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
--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将问题提交给人工处理:task need
task needWhen 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
--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
--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你(代理)只能task answer
等级0/1的DECISION审核。approval / secret / manual审核现在仅人工可用(已启用强制限制):它们通过Telegram点击(每个审核的--human-proof随机数,由root生成——你的LLM永远看不到)或非代理SUDO_UID清除,永远不会通过代理会话的sudo task answer
清除。旧的可伪造--proof证据形式已被移除(DIVE-916/950)。
task answersudo task answersecret / 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
task park5dive 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 oneWho fronts the inbox: . 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."
task coordinator [--json]当任务需要休眠但不进入人工收件箱(稍后再处理、等待外部日期)时:
bash
5dive task park DIVE-12 --reason="revisit after launch" --wake=+3d --jsonRecurring 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 sendbash
undefined5dive 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 escalate <id>—
作为配对人工批量清除:task clear-recs
。DIVE-1305——从已验证的DM聊天中,一键清除所有符合条件的低风险审核(等级<2、有--recommend
、未路由到负责人),无需逐个点击:
task clear-recs--recommend5dive task add "rotate the weekly metrics digest"
--recurring="0 9 * * 1" --assignee=worker-1 --json 5dive task ls --recurring --json # list templates
--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)——是应显示“需要你处理”横幅的唯一代理,这样多个配对代理不会各自独立发送相同的提醒。空输出表示没有组织或组织架构不明确(多根)——视为“无人显示横幅”。
task coordinator [--json]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 sendbash
undefinedLoops: 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 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 ;
"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.
task donetask loop startbash
undefined5dive task add "rotate the weekly metrics digest"
--recurring="0 9 * * 1" --assignee=worker-1 --json 5dive task ls --recurring --json # 查看模板列表
--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
scorecard_json循环:在代理间中继工作(+人工审核)
('' when ungraded), a score
column (84/100 style) on the text board.
score—
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).循环会将代理串联成自动中继:每个步骤在其完成后立即转交至下一个步骤,人工审核会暂停流程等待点击。这是仪表板循环构建器背后的CLI——而且因为它只是CLI,你可以通过对话方式构建、编辑和检查循环。“设置内容流水线:研究→起草→我的审核→发布”只需执行;“将步骤3替换为Marcus / 在发布前添加审核 / 停止运行中的循环”只需编辑运行的任务。仪表板无法安全编辑运行中的循环——但你可以。
task donetask loop startbash
undefinedMaker→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 auto-derives
acceptance criteria and assigns a grader distinct from the maker, so a plain
hands off to grade instead of closing. Trivial chores (bodyless
mechanical titles), low-priority tasks and recurring templates auto-skip it;
is the explicit opt-out and 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:
task addtask done--no-verifyFIVE_VERIFY_DEFAULT=0bash
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" --json5dive 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
task done行中包含每次运行的最新评分卡:--json中的scorecard_json
(未评分时为空),文本面板中的score
列(84/100格式)。
scorecard_jsonscoregrades against --accept and either closes it (their own task done
) or:
task done—
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):非琐碎的会自动派生验收标准,并分配与创作者不同的审核者,因此普通的会转交至审核而非关闭。琐碎的杂务(无内容的机械标题)、低优先级任务和周期性模板会自动跳过验证;是显式选择退出的参数,是集群级别的关闭开关。要指定特定审核者(或在自动跳过的情况下添加审核者),请为任务设置与受让人不同的verifier:
task addtask done--no-verifyFIVE_VERIFY_DEFAULT=0bash
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" --jsonLOOP-7: agent-native orchestration verbs
创作者的task done
不会关闭任务——它会转交至审核者,审核者会根据--accept进行评分,要么关闭任务(审核者自己执行task done
),要么:
task donetask done5dive looptask loop--ceilingtask 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> # 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 addtask_depsbash
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 looptask loop--ceilingtask 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 objectivegoaltickbash
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--direction--publictickpauseresumermSelf-steer it: (OSS-27/OSS-33) drives one cycle —
a planner proposes a diff (new/reprioritized/cancelled tasks) toward the
target, validated like a plan:
objective replan <name>goal addbash
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 addtask_depsbash
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
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 . dispatches
to the real seated agents (each votes via its own harness, blind first round)
and seals an auditable, tamper-evident verdict;
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
(, //, ) are sudo-gated; reads
(, , ) are not. See for the
full verb surface — this is a governance primitive, reach for it deliberately,
not as a substitute for a normal gate.
5dive councilcouncil convene "<question>"council gate-clear <task>initpromotedemoteexpelbench add/rmrosterlogverifyreferences/commands.mdtask need5dive objectivegoaltickbash
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-cmdtick--direction--publictickpauseresumerm自导向:(OSS-27/OSS-33)驱动一个周期——规划代理会提出朝向目标的差异(新任务/重新排序任务/取消任务),像计划一样进行验证:
objective replan <name>goal addbash
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
5dive push--yes仅豁免数量超过检查点的审核——差异中的Tier-2任务仍会强制审核,且--shadow/--propose-only下的内容无法豁免。
—
--no-progress-limit=N 在N个周期无进展/进展不利后自动暂停目标。
An agent created with (needs , the
default) can push ONE named feature branch for PR review once its task's
gate is cleared and bound to that branch — . 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. (once per box) scaffolds the GitHub App
config — never pass the private key on argv.
--can-push--isolation=standard5dive push DIVE-42 [--branch=<b>] [--dry-run]sudo 5dive push setup
请始终先执行`--dry-run`查看重规划,与`goal add`遵循相同的原则。Company wizard: 5dive company
5dive company治理投票:5dive council
5dive council5dive company --yes --name=<n> --objective="<outcome>" --metric-cmd="<cmd>" --target=<n> --direction=up|downproject addobjective addgoal add对于不应由单个代理决策的事项——成员变动、章程修订,或将开放审核路由至审议——请使用。会发送给实际就位的代理(每个代理通过自身框架投票,首轮盲投)并生成可审计、防篡改的结论;会将开放的tier-1审核路由至理事会而非人工(tier-2或仅人工类型的审核永远不会自动清除,始终升级)。写入操作(、//、)需要sudo权限;读取操作(、、)不需要。完整命令列表请查看——这是治理原语,请谨慎使用,不要替代普通的审核。
5dive councilcouncil convene "<question>"council gate-clear <task>initpromotedemoteexpelbench add/rmrosterlogverifyreferences/commands.mdtask needSearch team memory before re-deriving
委托推送:5dive push
5dive push5dive memory search~/.claude/projects/*/memorybash
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: . 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 , the publish path teammates can search), stamps provenance,
and appends the store's index line. A token/key tripwire refuses secret-shaped
bodies ( does NOT bypass it).
memory add--store=wiki--forcebash
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>"]通过创建的代理(需要,默认设置)在其任务审核通过并绑定到指定功能分支后,可推送该分支以供PR审查——。代理自身进程永远不会接触GitHub令牌;仅root可用的辅助程序会生成仅针对该仓库的令牌,推送后立即丢弃。(每台主机执行一次)会搭建GitHub应用配置——永远不要在命令行参数中传递私钥。
--can-push--isolation=standard5dive push DIVE-42 [--branch=<b>] [--dry-run]sudo 5dive push setuplifecycle envelope (DIVE-1024): recall demotes/flags expired, superseded, low-confidence.
公司向导:5dive company
5dive company5dive memory doctor --json # hygiene: index drift, dangling [[links]], stale refs, near-dupes
undefined5dive company --yes --name=<n> --objective="<outcome>" --metric-cmd="<cmd>" --target=<n> --direction=up|downproject addobjective addgoal addRead the fleet: digest, usage, supervisor
在重新推导前搜索团队记忆
Three read-only surfaces, no agent reasoning, no tokens burned:
bash
undefined5dive memory search~/.claude/projects/*/memorybash
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可用)在重新推导过往决策、调试队友已遇到的问题,或回答“我们之前遇到过这个问题吗?”之前,请先使用该命令——检索比重新读取整个记忆文件更高效。
**写入路径编译:。**读取路径有对应的写入命令——这是“关闭前编译”要求背后的CLI。内容通过标准输入传递;它会将带有前置元数据的Markdown文件写入你自己的存储(或通过写入共享团队知识库,队友可搜索的发布路径),标记来源,并附加到存储的索引行。令牌/密钥触发机制会拒绝类似密钥的内容(也无法绕过)。
memory add--store=wiki--forcebash
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 # 健康检查:索引漂移、悬空[[链接]]、过时引用、近似重复
undefinedToken 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; removes one
budget clear worker-1三个只读界面,无需代理推理,不消耗令牌:
bash
undefinedFleet 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-1Control other boxes: 5dive fleet
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-2One unreachable box never fails the whole view. / need root;
the read surfaces don't.
addrmsudo 5dive supervisor
sudo 5dive supervisor --watch # 实时刷新(默认5秒)
Diagnose a sick host
崩溃循环检测是独立的——它位于重启包装器中(hooks/run-loop.sh,DIVE-1029):代理在数秒内崩溃时会指数退避,仅显示一次真实的标准错误流,
—
并在实际崩溃时抑制虚假的“使用限制重置,代理已恢复”横幅。
bash
sudo 5dive doctor --jsonEnvelope is always with exit 0.
Branch on . Add (alias ) to attempt
reversible fixes (apt installs, type installer recipes, registry reseed, dead
poller restart); previews them. Narrow the run with
.
{ ok: true, data: { summary, checks } }data.summary.errors > 0--fix--repair--dry-run--category=deps|types|auth|creds|registry|shelld|channels|host|memoryOther 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
在因配额问题排查失败或在账户间移动代理之前,请检查`usage`(或`account usage`查看速率限制余量);在凭直觉重启代理之前,请检查`supervisor`。Rules of engagement
控制其他主机:5dive fleet
5dive fleet- Always pass . Parse the envelope. Don't grep stderr.
--json - One name = one agent. Names are lowercase letters/digits/hyphens,
start with a letter, max 16 chars. Reuse a name only after .
agent rm - Don't share bot tokens. Two Telegram-channel agents on the same
bot will race each other on . Each agent needs its own.
getUpdates - Tear down what you spin up. A leaked agent stays running across reboots — it's a real systemd unit, not a thread. On task completion call
worker-N.5dive agent rm <name> - Don't shell out to the underlying CLI binaries directly. Going
around skips the systemd unit, the audit log, and the env injection — the agent will run with broken auth and no restart loop.
5dive - Read 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.
5dive --help - The path is interactive only. Never call it from your own session.
auth login <type> - 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
(values come straight from the inbound
agent send --reply-to-chat=<id> --reply-to-msg=<id>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.<channel> - Blocked on a human? Gate it. Use with a recommendation instead of guessing or letting the task rot silently.
task need - Debug a task's history with , not by reconstructing it by hand. It's read-only and reconstructs the full goal-to-ship timeline plus a
5dive trace <id|DIVE-N>line (zero-human vs human-in-the-loop, counted from actual human-cleared gates, not effort).verdict: - Before trusting the fleet's own rails, run . 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
5dive selfcheck --jsonprobe as "unmeasured here", not "fine".not-reached - Don't hardcode a model id — check . It's the live source of truth for what
5dive models [--json]/opus/sonnet/fablecurrently resolve to; the alias and the underlying id drift across releases.haiku
当操作涉及多台虚拟机时,集群注册表会将主机名称映射到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一台主机不可达不会导致整个视图失败。/需要root权限;读取界面不需要。
addrmReference
诊断故障主机
- — every subcommand and flag, copy/pasteable.
references/commands.md - — exit codes & error classes.
references/exit-codes.md - — on-disk state layout (only for debugging).
references/paths.md
bash
sudo 5dive doctor --json输出包始终为,退出码为0。根据进行分支判断。添加(别名)尝试可逆修复(apt安装、类型安装程序、注册表重新初始化、重启无响应的轮询器);预览修复操作。可通过缩小运行范围。
{ ok: true, data: { summary, checks } }data.summary.errors > 0--fix--repair--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-updateGoing 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 or
directly and follow that.
sudo 5dive --helpsudo 5dive agent <sub> --helpSynced 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 if they
differ.
5dive --help- **始终传递。**解析输出包。不要通过grep标准错误流获取信息。
--json - **一个名称对应一个代理。**名称由小写字母/数字/连字符组成,以字母开头,最多16个字符。仅在后才可重复使用名称。
agent rm - **不要共享机器人令牌。**两个使用同一机器人令牌的Telegram频道代理会在上产生冲突。每个代理需要独立的令牌。
getUpdates - **销毁你生成的代理。**泄露的代理会在重启后继续运行——它是真实的systemd单元,而非线程。任务完成后请调用
worker-N。5dive agent rm <name> - **不要直接调用底层CLI二进制文件。**绕过会跳过systemd单元、审计日志和环境注入——代理会运行在身份验证失效且无重启循环的状态。
5dive - 如果标志被拒绝为未知,请阅读——主机上的二进制文件可能比本技能更新或更旧。帮助输出是权威的。
5dive --help - **路径仅适用于交互式环境。**永远不要从你的会话中调用它。
auth login <type> - **转交聊天请求时,不要中转——传递上下文。**如果用户在其他代理的机器人也加入的Telegram/Discord聊天中Ping你,并要求你联系该代理,请使用(值直接来自入站
agent send --reply-to-chat=<id> --reply-to-msg=<id>标签的属性)。目标代理会通过自身机器人直接在聊天中回复——通过你中转会增加延迟、破坏归属关系,并让用户重新阅读你转述的答案。<channel> - **因人工受阻?设置审核。**使用并提供建议,不要猜测或让任务无声无息地搁置。
task need - **使用调试任务历史,不要手动重建。**它是只读的,可重建从目标到交付的完整时间线,以及
5dive trace <id|DIVE-N>行(零人工参与 vs 人工参与,根据实际人工清除的审核统计,而非工作量)。verdict: - **在信任集群自身的流程之前,请运行。**它会在隔离沙箱中实际验证审核交付、审计日志、包完整性和计分板——将任何
5dive selfcheck --json探测视为“此处未测量”,而非“正常”。not-reached - **不要硬编码模型ID——请检查。**这是
5dive models [--json]/opus/sonnet/fable当前实际对应的模型ID的实时来源;别名和底层ID会随版本更新而变化。haiku
—
参考资料
—
- — 所有子命令和标志,可直接复制粘贴。
references/commands.md - — 退出码 & 错误类别。
references/exit-codes.md - — 磁盘上的状态布局(仅用于调试)。
references/paths.md
—
深入了解
—
完整参考手册请访问https://5dive.com/docs。如果本技能中的标志与运行中的二进制文件接受的标志冲突,请以二进制文件为准——直接运行或并遵循其说明。
sudo 5dive --helpsudo 5dive agent <sub> --help与5dive CLI 0.16.30(2026-07-27)同步。特定主机上的二进制文件可能比主分支落后最多一天(夜间更新频道)——如果存在差异,请以为准。
5dive --help