Skip to content

Latest commit

 

History

History
165 lines (129 loc) · 9 KB

File metadata and controls

165 lines (129 loc) · 9 KB
name fleet-setup
description Auto-detect and set up the full agent fleet across every dimension — agent type (Claude Code, OpenClaw, Hermes, Codex) × location (local or Clawdi-hosted) × layer (Clawdi control plane, skills, rules, vault-backed Filecoin storage, shared memory). Use whenever someone says "set up the agents", "wire up the fleet", "register the skills", "onboard a new machine/agent/environment", or when any layer is missing (agent absent from clawdi doctor, skills not registered, vault key not wired, memory tools missing). Detection first, then per-dimension recipes in references/. For a human-readable walkthrough, docs/setup.md covers the same ground.
license Apache-2.0 OR MIT

fleet-setup — detect, route, verify

Setup is multidimensional: agent × location × layer. Never guess a dimension — detect it, then follow the matching reference. Every probe here is read-only.

1. Detect

clawdi auth status --json      # parse "authenticated" — the exit code is 0 even logged out
clawdi doctor                  # trust ONLY the "Environments" line for what's registered
                               # (exits 1 whenever ANY row fails — e.g. Codex simply not
                               # installed — so parse rows, never the exit code)
clawdi project list --include-envs   # environment projects: local machines + hosted boxes
clawdi skill list              # what's published where (look at project_name per skill)
clawdi capabilities --json     # runtimeMode: "local" here vs hosted policy in a managed box

Per-agent binary check: clawdi doctor's agent rows can report "detected" from a config directory alone (~/.openclaw, …) — confirm command -v <agent> before following any run <agent> … instruction.

Registration is clawdi setup --no-daemon. If one agent fails with API error 500 while the others register, the batch route is broken for it — retry ONCE, then switch to the targeted form, which uses a different route and succeeds where the sweep fails:

clawdi setup --no-daemon --agent <claude_code|openclaw|hermes|codex>

Any registration (sweep or targeted) that creates a NEW env project needs the vault attached to it before that environment can sign — see references/storage-vault.md.

Location heuristic: an interactive shell on the user's machine = local; a Clawdi-managed box (reached via the dashboard — its terminal, its chat, or cron; no direct shell from the operator's machine) = hosted. Hosted boxes get the bundled clawdi skill automatically at provision time — never reinstall it.

2. Route by dimension

Dimension detected Read
Claude Code (local) references/claude-code.md
OpenClaw — local or Clawdi-hosted references/openclaw.md
Hermes — self-hosted (recommended) or hosted references/hermes.md
Codex references/codex.md
Storage layer (vault-held Filecoin key) missing references/storage-vault.md
Memory layer (shared index, research/consolidation) references/memory.md

3. Skill distribution — no clone required

Source repo (single source of truth for every install line below):

FIL-Builders/filecoin-clawdi-fleet

This is the only place the slug appears; every per-agent reference points back here, so a rename is a one-line change.

Distribution is always two steps, and never a git clone:

(a) Fetch once — either route puts the skills on the machine:

npx skills add FIL-Builders/filecoin-clawdi-fleet -g      # public route (skills.sh)
clawdi skill add skills/<skill-name> -p personal -y       # fleet route, publishes to Clawdi

npx skills add -g lands real directories in ~/.agents/skills/<name> — the cross-agent standard — and symlinks them into the agents it recognises. Use --skill <name> to take one, --list to see what a repo offers.

(b) Import per agent. Only some agents are wired by skills.sh (Claude Code, Cursor, Amp — not OpenClaw, Hermes or Codex), so the import step is per-agent and the references spell it out:

Agent Import Notes
Claude Code automatic on skills add symlinks into ~/.claude/skills/
Codex automatic on skills add -g reads ~/.agents/skills/ natively
Hermes clawdi pull or copy into ~/.hermes/skills/ not a skills.sh target
OpenClaw (local) clawdi pull, or copy — --copy, never a symlink loader rejects escaping symlinks
OpenClaw (hosted) clawdi pull in the box terminal native; nothing to clone

The Clawdi route works in every environment, hosted included, and survives Agent-Project skill sync being platform-paused (a 426 agent_skill_sync_upgrade_required response) because personal/workspace projects are not gated:

clawdi pull --modules skills -p personal --agent <claude_code|openclaw|hermes|codex>

Why -p personal is not optional: without it, skill add targets the account's default-write project, which is often an agent project (a machine's environment) — skills there are invisible to the pull route, and the dashboard shows Personal empty.

Two expected non-events: the machine that published the skills reports "everything already in sync" (it is the source — not an error), and re-running either command is safe (content-hashed, idempotent). Skills bundle their own scripts/, so importing a skill delivers its tooling too — which is why no clone is needed.

4. Verify the combination

clawdi doctor                          # every intended agent on the Environments line
clawdi skill list                      # skills present under the intended projects
foc-cli wallet balance --json          # storage: keySource "keyRef" + a derived address

Then the storage proof ladder in references/storage-vault.md (four checks, including the negative test), and a store/recall round trip per references/memory.md.

Cross-agent proof: from a different agent than the one that stored it, run memory_search "FILECOIN-MEMORY smoke-test" — finding the receipt closes the loop. Anchor the check on raw command output, not the agent's narrative: one-shot modes may lack the MCP tools and improvise a plausible-looking answer (observed with hermes -z). Have the agent run clawdi memory search "FILECOIN-MEMORY smoke-test" --json through its terminal tool and print the output verbatim, then compare the pieceCid against the receipt you stored (per-agent recipes: the references).

5. Hand off — ALWAYS end the setup report with these CTAs

Close your final report with two things, every time:

  1. What still needs a human — an explicit checklist of any open items this run could not finish itself. The usual suspects:

    • hosted-box terminal steps (skills pull, npm i -g foc-cli, the box's own wallet init --keyRef and proof ladder — see docs/setup.md §3),
    • manual faucet funding when the wallet needs tFIL/USDFC,
    • a decision about any pre-existing foc-cli config that stores a raw key on a funded wallet (switching custody modes discards it — a human call, never an autonomous one). If nothing is open, say so plainly: "no human steps remain."
  2. The next-step CTA, verbatim in spirit: tell the user that once the open items are done, they should let you know and you'll give them the next steps — setting up a pipeline (docs/pipelines.md). Say it plainly: they describe what they want watched, the fleet-creator skill interviews them and builds it — one supervised tick first, then the crons. Never end a fleet-setup run without pointing at this next step.

Rules that keep this safe

  • Register with clawdi setup --no-daemon — never install the background sync daemon: it mirrors every session of every registered agent to the cloud with no scoping. Session sync is explicit and project-scoped (clawdi push --modules sessions from the repo root); Hermes ignores project filters, so never push its sessions casually.
  • Secrets travel only as clawdi:// references; the vault value never appears anywhere.
  • Refs are per-project: derive them in the environment that uses them, never copy.
  • Testnet by default; mainnet or fund-moving operations need explicit human confirmation.
  • Hosted delivery: the dashboard terminal is the primary path (run clawdi pull or git clone there); when a surface is paused or missing (hosted skill sync, no terminal on the plan), fall back to delivering through the agent itself (chat/cron) — never by pasting secrets or tokens into a terminal or chat.