Loading...
Loading...
Use the local `5dive` CLI on a 5dive runtime VM to spawn, inspect, send to, and tear down sibling agents. Trigger this skill whenever the user asks for a worker, sub-agent, side task, parallel run, "another agent", "fan out", "delegate", or anything that needs more than one Claude/Codex/Gemini process running at once on the host. Also trigger when the user asks to inspect, restart, or pair an existing agent, when they mention `/var/lib/5dive/`, or when they need a machine-readable health check (`5dive doctor --json`). Always prefer `5dive` over running coding CLIs by hand — it is the only sanctioned way to keep agents under systemd.
npx skill4agent add 5dive-com/skills 5dive-cli5divesudo 5dive ...--jsonagent-<name>5dive-agent@<name>.serviceagent-<name>EnvironmentFiletelegramdiscordnoneclaudeopenclawhermesclaudesudo 5dive ...--json--jsonsudo 5dive agent create scout --type=claude --json{ "ok": true, "data": { "name": "scout", "type": "claude", "created": true } }error.code{ "ok": false, "error": { "code": 6, "class": "auth_required", "message": "..." } }error.classokusagevalidationnot_foundconflictauth_requirednot_installednot_runningpairingpermissiontimeoutgenericreferences/exit-codes.md# 1. Pick a unique name (lowercase letters/digits/hyphens, ≤16 chars,
# must start with a letter). Check the registry first if you care:
sudo 5dive agent list --json | jq '.data.agents | keys'
# 2. Create the worker. --workdir scopes its tmux cwd; default is
# /home/claude/projects.
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
# 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"
# 4. Poll its output until it goes idle. --tmux dumps the scrollback.
sudo 5dive agent logs worker-1 --tmux --lines=80
# 5. Tear it down when you're done — frees the systemd unit + Linux user.
sudo 5dive agent rm worker-1 --jsonSUDO_USER=agent-*5dive-cli--with-skills=<spec>[,<spec>...]5dive-com/skills<owner/repo>:<id>--with-skills=5dive-cli,acme/skills:db-tools--no-skills--defer-authagent create--auth-profile=<name>combined.envsudo 5dive agent create draft-bot --type=claude --defer-auth --jsonfor type in claude codex gemini; 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:
for type in claude codex gemini; do
echo "=== ${type} ==="
sudo 5dive agent logs "fan-${type}" --tmux --lines=200
done
# Cleanup.
for type in claude codex gemini; do
sudo 5dive agent rm "fan-${type}" --json
doneauth_required# If create fails with error.class=auth_required, the type isn't authenticated.
# Two paths — pick by what credentials you have:
# A) Static API key in $KEY (preferred for automation)
echo "$KEY" | sudo 5dive agent auth set claude --api-key=- --json
# B) Device-code flow (when only a human can complete login)
sudo 5dive agent auth start claude --json
# -> session id; give the URL from `auth poll` to the user; they paste the
# callback code back via `auth submit`.5dive agent auth login <type>auth startauth setaccount--auth-profile=<name>5dive account ...agent auth start|poll|submit|cancel# Inventory: which named accounts exist, what types each is signed into,
# and how many agents are bound to each.
sudo 5dive account list --json
# Detail for one account, including which env keys are populated.
sudo 5dive account show acme-prod --json
# Provision a new empty account, then sign it in (TTY-only — humans).
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
# 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
# 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 --jsondefaultaccount addrenameauth-profile=default/etc/5dive/connectors/<type>.envagent pair# A) Classic — return a pairing code, user DMs the bot, paste the bot reply.
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
# 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
# -> {found:true, userId, chatId, ...}; re-poll on {found:false}.
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
# render a tappable t.me/<bot> link alongside the "send /start" prompt.
sudo 5dive agent telegram-getme --token="$BOT_TOKEN" --json
# -> {ok:true, data:{botId, username, firstName}}telegram-discovertelegram-getmeagent sendagent asksudo 5dive agent send <name> "..."$SUDO_USERagent-<you>[5dive-msg from=<you> id=<8-hex>] <your text>--from=<label>--rawsudo 5dive agent sendagent-*[5dive-msg from=scout id=ab12cd34] please summarise the auth middleware auditsudo 5dive agent send scout "[re=ab12cd34] auth middleware looks clean except for ..."[re=<id>]agent askagent logsasksudo 5dive agent ask scout \
"list the OWASP A01 issues you found, one per line" \
--timeout=180 --jsontmux capture-pane--idle-secs--json{ok:true, data:{name, from, msg_id, reply}}askask--timeoutsendlogsagent sendagent logs --tmuxagent askagent sendagent ask&wait--fromsudo 5dive doctor --json{ ok: true, data: { summary, checks } }data.summary.errors > 0--repair--jsonagent rmgetUpdatesworker-N5dive agent rm <name>5dive5dive --helpauth login <type>references/commands.mdreferences/exit-codes.mdreferences/paths.mdsudo 5dive --helpsudo 5dive agent <sub> --help