CLI reference
Every verb, with its flags, and the invariant the read backends behind them all obey.
Start here
The verbs a new host needs:
agentctl init # scaffold the GitOps repo (default /opt/agentctl)
agentctl provision # host bootstrap (idempotent)
agentctl agents add <name> --user-email <e> --api-key <k> # a new agent (pi + webview)
agentctl apply [<agent>] # reconcile, and restart exactly what changed
agentctl status # host readiness + fleet overview
agentctl notify <agent>|self <text> [--file <path>] # message the owner over its channel
agentctl logs <name>|self [-f] # an agent's unit journal
agentctl version # print the build version
The full grammar
Global flags
agentctl [--repo <path>] <command> ...
| Command |
Note |
--repo <path> |
Overrides the fleet repo location for locally-run verbs; position-independent, before or after the subcommand. It has no effect on daemon-routed verbs like apply, which read the default location or $AGENTCTL_REPO. |
Fleet lifecycle
agentctl version | --version | -V
agentctl init [<dir>] [--git <url>]
agentctl provision [--check]
agentctl status
agentctl queue
agentctl apply [<agents.yaml>] [<agent>] [--dry-run] [--no-pull] [--force] [--prune [--yes]] [--verbose] [--json]
agentctl defaults list | add <kind> <name> | remove <kind> <name>
agentctl migrate <ssh-target>[:port]|<local-path>|--local <manifest.yaml> [--agent <name>] [--new-name <dest>] [--bot-token <t>] [--owner-id <id>] [--chat-id <id>] [--force-pair] [-i|--ssh-key <ssh-key>] [--no-creds] [--cutover]
agentctl converge <agent> [--dry-run|--apply]
agentctl config normalize
agentctl upload reap [--ttl <dur>] [--dry-run]
agentctl shell reap [--dry-run]
agentctl subsession reap [--ttl <dur>]
| Command |
Note |
version |
Prints the build version. |
init |
Scaffolds the GitOps repo; default dir /opt/agentctl. |
init (layout) |
agents.yaml, agents.d/ shards, mcp/skills/agents/hooks/tools overlays, secrets.d/ store. |
init --git <url> |
Joins an existing fleet instead of scaffolding a new one. |
provision |
Host bootstrap, idempotent. |
provision --check |
Dry-run: reports what would change without converging. |
status |
Host readiness + fleet overview. |
queue |
Daemon reconcile queue: pending / in-flight / last result. |
apply |
Declarative reconcile from the repo; restarts exactly what changed, including itself. |
apply --no-pull |
Skips the repo git pull before reconciling; uses the working tree as-is. |
apply --force |
Reconciles, then restarts ALL agents and gateways. |
apply --dry-run |
Previews the restart set. |
apply --prune |
Lists live agents no longer in the ledger. |
apply --prune --yes |
Runs userdel -r on those orphans. |
apply (output) |
On a terminal: one live progress bar. --verbose restores the scrolling ✓ <step> narrative, --json gives the NDJSON events, AGENTCTL_NO_PROGRESS=1 or a non-TTY stdout falls back to the scroll. |
apply --fast --reconcile --native-converge |
Accepted and do nothing: the fingerprint skip and the native converge are what a plain apply already does. |
apply (semantics) |
Operations: apply semantics. |
defaults |
Host-level catalog-defaults overlay (defaults.yaml) applied to every agent. |
upload reap |
Collects abandoned resumable uploads — tus partials with no progress. --ttl sets the age, --dry-run only lists them. |
shell reap |
Ends any shell session that is both unattached and silent past its idle TTL of 8 h, the host maintenance shell included. Run every 15 min by agentctl-shell-reap.timer. |
subsession reap |
The same sweep for idle subsessions. |
migrate |
Relocates one agentctl agent over SSH, or from a local path. |
migrate --chat-id |
Overrides the destination's chat id; wins over the source's, same as --owner-id. |
migrate --force-pair |
Ignores both --owner-id and --chat-id (and the source's) and pairs fresh. |
migrate --no-creds |
Skips copying provider credentials from the source. |
migrate --cutover |
Stops the source agent. |
converge |
Native Go reconcile of ONE agent's steady state — the engine under apply. |
config normalize |
Rewrites agents.yaml to the canonical schema (legacy→new, one-shot) and commits. |
Self-scope agent verbs
agentctl inject <agent>|self <text>
agentctl abort <agent>|self [--session <sid>]
agentctl notify <agent>|self|admin <text> [--file <path>]... [--format md|text] [--silent] [--record-only] [--from-cron]
agentctl agent-message <to-agent> --subject <subject> [--file <path>]... [--] <message>
agentctl agent-message --list
agentctl attachment fetch <agent>|self <file_id>
agentctl chrome restart|status
agentctl browser status <agent> [--caller <scope-agent>]
agentctl browser fit [self]
agentctl terminal status <agent> [--caller <scope-agent>]
agentctl terminal up [self]
agentctl apps list|active|validate [<agent>|self] [--json]
agentctl apps bundle <agent>|self <id>
| Command |
Scope |
Note |
inject |
self; admin/root → any agent |
Injects a message into an agent's live session as a user turn. |
abort |
self; admin/root → any agent |
Cancels the turn in flight in a pi agent's live session. The session stays open: the next prompt runs normally. --session <sid> addresses a subsession's own lane. Backs the cockpit's STOP control. A claude-runtime target is refused — that runtime has no mid-turn cancel, so there is nothing to send the stop to. |
notify |
self; admin/root → any; admin → fleet admin |
Outbound message plus attachments to the owner over its channel. |
notify --record-only |
self |
Records the message without delivering it. --from-cron marks it as a cron's own output. |
attachment fetch |
self; admin/root → any agent |
Pulls one inbound attachment by its channel file id. |
browser fit / terminal up |
self |
Sizes your own browser display; starts your own terminal transport. |
agent-message |
any agent → any other agent |
Sends ANOTHER fleet agent a message plus optional file attachments, cross-host. It records a card on the recipient and can never start a turn there. |
agent-message --list |
self |
Lists cards addressed to the caller. |
chrome restart / chrome status |
self |
Recovers or inspects your OWN CDP Chrome (browser@<self>) without root. |
browser status |
self; admin/root → any agent |
Read-only: would /browser/enter succeed for <agent> right now? Walks the same gate sequence in the same order. |
terminal status |
self; admin/root → any agent |
Read-only: would /terminal/enter succeed for <agent> right now? Same gate sequence as browser status. |
apps list / apps bundle |
self |
Read plane for user-authored cockpit mini-apps (~/.claude/apps). |
apps active |
self |
The launcher set — installed apps intersected with the agent's wired MCPs. |
apps validate |
self |
Reports why a mini-app does not appear. |
Render jobs
agentctl render <project> <clip> [--agent <name>] [--backend local]
agentctl render status [<job-id>] [--all]
agentctl render cancel <job-id> [--agent <name>]
agentctl render event <job-id> [--agent <name>]
| Command |
Note |
render |
Renders a composition DETACHED — survives an agent restart — and returns a job id. The bare form takes no subcommand word. |
render status |
Your render jobs in full, plus host contention as a count. |
render cancel |
Stops one of your renders; frames are cleaned up. |
render event |
Announces that a render changed state, so the cockpit's chip updates live (reads the state from the job file). |
Agents
agentctl agents add <name> [--channel webview|telegram|teams|slack (default: webview)] [--user-email <e>] [--bot-token <t>] [--owner-id <id>] [--owner-aad <id>] [--owner-email <e>] [--admin|--no-admin] [--runtime pi|claude (default: pi)] [--api-key <key>] [--provider anthropic|foundry|groq|openai|openrouter|…] [--model <id>] [--workspace-remote <url>] [--json]
agentctl agents list | restart <name>|all | logs <name> | trigger <name> <job> | remove <name> --yes
agentctl agents roster [--json]
agentctl agents env <name> [--reveal]
agentctl agents restart-self
agentctl agents stop-self
agentctl agents admin <name> [--revoke]
agentctl agents supervisor <name> [--revoke]
agentctl agents set <name> owner_id|chat_id|model|skill_model|provider|runtime|workspace_remote|user_email|fanout|channel|endpoint_base_url|foundry_resource|foundry_base_url|cost_cap_usd <value>
agentctl agents remote add <url> <name>|self | remove <name>|self
agentctl agents validate [<name>|--all] [--json]
agentctl agents skills add|remove|list <skill> <name>|*
agentctl agents skills catalog add <name> [--from <dir>] [--content-stdin] [--zip-stdin] [--force]
agentctl agents subagents add|remove|list <sub> <name>|*
agentctl agents subagents catalog add <name> [--from <file>] [--content-stdin] [--zip-stdin] [--force]
agentctl agents cron add|remove|list <job> <name>|*
agentctl agents cron catalog [--json]
agentctl agents hooks add|remove|list <hook> <name>|*
agentctl agents hooks catalog add <name> --event <E> (--script <p>|--script-stdin|--command <c>) [--args <a>] [--timeout <n>] [--force]
| Command |
Note |
agents add |
The routing key follows --channel (table below). |
agents roster |
Every recorded agent with its host, channel, runtime and cost cap. |
agents env |
The agent's rendered unit environment; --reveal prints secret values instead of masking them. |
agents restart-self |
Self-scope; used by the agent's own post-login restart. |
agents stop-self |
Self-scope stop + disable; used by remote migrate --cutover. |
agents admin |
Grants or revokes the admin ROLE, at operator scope. |
agents admin (additive) |
Any number of agents may hold it. |
agents supervisor |
Grants or revokes the SUPERVISOR role, which admits an identity to the fleet-wide activity rollup and nothing else. Independent of admin. |
agents set |
Sets one ledger scalar declaratively; apply reconciles it. |
agents set cost_cap_usd |
Takes effect without apply — see Cost cap. |
agents remote |
Git remote + deploy key for an agent's ~/workspace backup repo. |
agents remote add |
Prints the pubkey to register. |
agents validate |
Lints recorded agents against every add-time invariant. |
agents validate (checks) |
Secrets, catalog refs, teams routing/reachability. |
agents skills add / remove |
Activates or deactivates a skill for one agent, or * for all. |
agents skills list |
Catalog plus defaults. |
agents skills catalog add |
AUTHORS a new skill into the overlay. --from <dir> copies a source tree, --content-stdin takes SKILL.md on stdin, --zip-stdin extracts a zipped skill folder; --force overwrites an existing overlay entry. Same three source flags on agents subagents catalog add. |
agents cron |
Per-user timers. |
agents hooks |
Claude hooks: registry plus repo overlay. |
agents hooks catalog add |
--script-stdin pipes the hook script body on stdin (the web upload path); --force overwrites an existing registry entry. |
Routing key per channel, set at agents add. See Channels.
--channel |
Required routing flags |
webview |
--user-email, mandatory; no bot token |
telegram |
--owner-id or pairing, plus --bot-token |
teams |
--owner-aad |
slack |
--owner-email |
| any |
--user-email is additive and gives that agent a cockpit too |
agentctl mcp catalog list [--json]
agentctl mcp catalog add <name> --npm <pkg@ver> | --uvx <pkg==ver> [--entry <module>] | --url <endpoint> [--header 'K: V']... | --zip-stdin [--into <path>] [--runtime <r>]
agentctl mcp catalog add <name> [--scope shared|per_user] [--auth none|env|oauth] [--env KEY...] [--scopes URL...]
agentctl mcp catalog upgrade <name> --to <ver>
agentctl mcp catalog remove <name>
agentctl mcp add|remove <mcp> <name>|self
agentctl mcp wired [<agent>|self] [--json]
agentctl mcp read <mcp> <tool> [--params '<json>'] [--timeout <sec>] [<agent>|self]
agentctl mcp call <mcp> <tool> [--params '<json>'] [--timeout <sec>] [<agent>|self]
agentctl tool catalog list [--json]
agentctl tool catalog add <name> [--from <dir>] [--content-stdin] [--zip-stdin] [--force]
agentctl catalog browse [--json]
agentctl catalog remove <kind> <name>
agentctl catalog add <skill|subagent|mcp|tool|hook> <name> [--from <dir>] [--content-stdin] [--zip-stdin] [--force] [--event <E>] [--npm <pkg@ver>] [--uvx <pkg==ver>] [--url <u>]
| Command |
Note |
mcp catalog list |
Selectable MCPs with source, pinned version and auth. |
mcp catalog add --npm/--uvx |
Bridged MCP: pins an exact version, vendor lock. --entry <module> picks the uvx entry point when it isn't the package name. |
mcp catalog add --url |
A remote HTTP MCP endpoint instead of a vendored one; --header 'K: V' adds a forwarded header (repeatable). |
mcp catalog add --zip-stdin |
A custom MCP folder (mcp.yaml + server/scripts) streamed as a zip on stdin — the web upload path. |
mcp catalog add --runtime |
Overrides the produced item's runtime (default python). |
mcp catalog add --scope / --auth |
Optional; the defaults are shared and none. |
mcp catalog add --into |
Overrides the destination; the default is the overlay, plus a commit. |
mcp catalog upgrade --to |
The only way a version moves; --to is required. |
mcp catalog remove |
Drops it from the catalog; must be deactivated everywhere first. |
mcp add / mcp remove |
Activates or deactivates it for an agent; the socket materializes here. |
mcp wired |
The MCPs wired for an agent. This is what tells you which tool surfaces an agent actually has. |
mcp read |
A turnless read-only tool call on a wired MCP; prints the raw tool JSON. |
mcp call |
A turnless tool call on an action-plane MCP, mutating tools included; prints the raw tool JSON. |
mcp read / mcp call (args) |
--params takes the tool's arguments as a JSON object. --timeout is in seconds, default 20, clamped to 120. |
mcp read / mcp call (gate) |
A tool declared risk: block in its mcp.yaml is refused on both. See Webview API for the full gate order. |
tool catalog list |
The host CLI tool catalog, every item kind: native. Read-only: a catalog tool has no per-agent wiring verb — mcp add is how an agent is granted a tool surface. |
tool catalog add |
Authors a native tool into the overlay; same --from/--content-stdin/--zip-stdin/--force source flags as the skill/subagent catalog-add verbs. |
catalog browse |
Every category's items, with origin (overlay/deb) and defaults. |
catalog remove |
Removes an OVERLAY item. |
catalog add |
One entry point over the five per-category authoring verbs; it dispatches. |
catalog add cron |
Not authorable; use cron add to SCHEDULE work. |
catalog add cron (shape) |
A cron catalog item is a shipped unit + timer template pair. |
Channel gateways
agentctl teams-gateway install [--port 3978] [--json] | uninstall | status
agentctl slack-gateway install [--port 8732] [--json] | uninstall | status
agentctl webview-gateway install [--port 8735] [--json] | uninstall | status
agentctl webview-login install | uninstall | serve
agentctl auth-broker install [--port 8734] [--json] | uninstall | status | serve
| Command |
Note |
teams-gateway |
Host Teams channel gateway: webhook :3978 plus WS router. |
slack-gateway |
Host Slack channel gateway: Socket Mode plus WS router. |
webview-gateway |
Host web-view channel gateway (WS router). |
webview-gateway (dial-in) |
channel=webview agents dial in over the fleet net; top --web becomes the live cockpit. |
webview-gateway install |
Installs one unit plus its env file and marks the host in the ledger; --port overrides 8735. |
webview-gateway uninstall |
Disables and removes that unit, its unit file and its env file. Root is the only precondition. |
webview-login |
Host web-view login proxy (generic auth driver → cockpit); binds :8736. |
webview-login (requires) |
WEBVIEW_HMAC_KEY plus driver config in sops. |
auth-broker |
Optional host OAuth callback broker on :8734; makes login google hands-free. |
install --json |
On all four, emits the install as NDJSON progress events instead of the human output. |
serve |
The foreground process a unit's ExecStart runs; not for manual use. |
| ports |
Every --port default is in Ports and the port guard, which also gives each one's bind address. |
Host jobs
Run one of 63 allowlisted verbs on another fleet host, as root there. Operator scope: root or
an admin: true agent.
agentctl host job run <host-or-agent> <verb> [args…] [--agent <name>]
agentctl host job status <host> <job-id>
agentctl host job logs <host> <job-id> [--follow|-f] [--after <sequence>]
agentctl host job cancel <host> <job-id>
agentctl host job grant …
agentctl hostjob-worker run <job-id>
| Command |
Note |
host job run |
Prints the job id, then follows automatically. Ctrl-C detaches without cancelling. |
host job run (target) |
A hostname, or an agent name — which resolves to the host that agent is pinned to. |
host job run (exit) |
Exits with the verb's real exit code on the target. |
host job run (secrets) |
The three secret-bearing verbs read their value from stdin and refuse a raw value flag. |
host job status |
The target's committed receipt and current state, by canonical hostname and job id. |
host job logs |
Replays output from the TARGET's own durable journal. |
host job logs --follow |
Streams to the terminal state; --after <n> resumes strictly after a cursor. |
host job cancel |
Records a cancellation request and reports the target's state. NOT a rollback. |
host job grant |
Internal: mints a short-lived signed grant for one action. Called by the four verbs above. |
hostjob-worker run |
NOT for manual use — the ExecStart of agentctl-hostjob@<job-id>.service. |
hostjob-worker run (input) |
Only the root-owned 0600 spec.json under /var/lib/agentctl/hostops/target/ops/<id>/. |
hostjob-worker run (argv) |
The verb and its arguments never appear on a command line. |
hostjob-worker run (records) |
The receipt, its execution identity (unit, pid, cgroup, boot id) and a terminal state. |
hostjob-worker run (interrupt) |
A worker stopped mid-flight records interrupted, never failed. |
Three verbs resolve their host automatically, so the wrapper is not needed at all:
agentctl apply <agent> # runs on the host that agent is pinned to
agentctl agents restart <agent>
agentctl login <provider> <agent>
Only an explicit agent name pinned to a different host is forwarded. self, all, a local
agent and an unknown name all run locally.
Fleet-wide
agentctl fleet apply [--concurrency N] [apply-args…]
agentctl fleet upgrade [--concurrency N] [args…]
| Command |
Note |
fleet apply |
One apply host job per host in the ledger. |
fleet upgrade |
One host upgrade host job per host in the ledger. |
| both (concurrency) |
Four hosts at a time by default; --concurrency 1 is sequential. |
| both (status) |
Every state change prints one clock-stamped line as it happens; the summary is a recap. |
| both (failure) |
A failed host does not stop the others, and is not retried. |
| both (args) |
Trailing arguments are passed through to every host, e.g. fleet apply --prune --yes. |
| both (ids) |
Each host's job id is printed before its dispatch, so a broken stream stays addressable. |
Fleet diagnostics
agentctl fleet inspect pressure [--sample 1s..60s] [--hosts host1,host2] [--concurrency 1..4] [--json]
agentctl fleet inspect resources --group mcp [--hosts host1,host2] [--concurrency 1..4] [--json]
agentctl fleet inspect rollout|failures|log-storage|mounts [--hosts host1,host2] [--concurrency 1..4] [--json]
The six fixed profiles are read-only host jobs; no arbitrary verb, filesystem path,
agent alias, scoped home/workspace tree, or global --repo override is accepted. The default cohort is one
snapshot of the deployed ledger host namespace (host keys, agent hosts and the explicitly
configured gateway); a local hostname absent from that roster is not included.
The gateway endpoint is derived once from that same snapshot and pinned for every
job; AGENTCTL_REPO and the current directory do not select a different roster
or gateway. An unset gateway retains the existing loopback convention. The grant
subprocess is also pinned to the deployed repository. Grants bind the selected
host, job and verb using the existing grant protocol; they do not include a ledger
snapshot hash. Concurrent changes to the deployed ledger are not an atomic
transaction with daemon authorization or grant minting. --hosts narrows the cohort
to explicit known hostnames. An unreadable ledger, unknown host,
duplicate host, or a cohort exceeding 16 hosts fails closed before dispatch. The
concurrency default is 2 and the maximum is 4; each host has a 100-second client
context deadline; grant-process cleanup may take an additional 100 ms. No host is
retried or reached by a fallback transport.
The output is one JSON object (pretty-printed without --json). Human progress is
best-effort, nonblocking and may be omitted if stderr is blocked or unsupported;
JSON mode has no progress output. The job_ids map is allocated before submissions,
but delivered with the final report after collection; an allocated ID is not proof
of submission or acceptance. If stdout is blocked, collection and its deadlines
still finish, but the Unix output write can itself block indefinitely. A failed or
externally interrupted write can leave partial, invalid JSON and undisclosed IDs;
do not assume cancellation or completion from that output. Human progress may have
shown IDs before submission, but is not a durable receipt.
The per-host status describes job/transport outcome, not the health or
completeness of the target's measurements. target_indicators highlights reported
uncertainty. Snapshots are checked against the profile's known schema and semantic
allowlists, including dynamic map keys and values. Recognized structured reasons
and errors are retained; unrecognized content rejects the entire snapshot as
partial with invalid_snapshot, rather than being copied or silently removed.
A newer target schema or new unrecognized reason may therefore require a CLI update.
unsupported,
refused, unavailable, timeout, cancelled, failed, partial, and
truncated are not success. One host's failure does not prevent other hosts from
being attempted; the command exits non-zero unless every transport result is ok
and no result was truncated.
Capture reserves a fair share per host, at most 1 MiB per host and 8 MiB for
the encoded aggregate. Raw stderr, meta and incomplete output prefixes are not
included. truncated is independent of the job status, so trimming never changes
a failure or timeout into another outcome. Truncated data is not a complete snapshot.
A lost, timed-out or cancelled stream does not cancel an accepted durable job.
Use the host and job ID with agentctl host job status, then replay the full journal
with agentctl host job logs <host> <job-id> --follow --after 0 --meta-stderr.
The last_buffered_sequence is not a delivered aggregate cursor: always replay
from zero if recovering the original job output. The gateway closes a relay after
a terminal frame; a missing terminal tail is an incomplete stream requiring replay,
not proof that reordered frames can pass through the gateway. The snapshots may themselves report
unavailable or partial fields; installed package, applied configuration and loaded
runtime state must not be conflated.
Host job addressing
| Command |
Note |
host op, host operation |
Not a route to a target host. Both refuse and name host job run. |
| addressing |
A host job takes a HOSTNAME. To address an agent, use the ordinary verb with the agent's name. |
| reads |
A job's output lives in the target's own journal — read it with host job logs <host> <job-id>. |
Auth and secrets
agentctl login claude|google|ms365|atlassian|powerbi <name>|self [--code <code> | --status | --clear | --json]
agentctl secret set <KEY> [--value V] [--agent <name>] [--allow-missing]
agentctl secret get <KEY> [--agent <name>]
agentctl secret remove|rm|unset <KEY> [--agent <name>]
agentctl secret list [--json]
agentctl secret merge <base> <ours> <theirs>
agentctl cred encrypt <name> <cred-id>
| Command |
Note |
login |
Host-side or self-serve. See Logging an agent in for the per-provider flow (PKCE, device-code, redirect, broker). |
login --status |
Machine-readable creds probe — prints logged-in or needs-login. Works for claude and every broker OAuth provider (atlassian, google, ms365, powerbi); refuses on any other value. Prints managed instead of logged-in for a provider authenticating as shared infrastructure rather than per agent (powerbi in client_credentials mode). |
login --clear |
Deletes the provider's local credential state — the cockpit Connections panel's Disconnect action. Broker OAuth providers only (atlassian, google, ms365, powerbi); claude has its own re-login path instead. |
login --json |
One JSON object on stdout carrying the broker-init authorize URL, for a caller that has to hand the link to a human over a channel that isn't this terminal (the cockpit Connections panel). Refused on every other branch of this verb. |
secret set |
Stores a secret; the value comes from --value or stdin. An empty value is refused. |
secret set --agent |
Stores it per agent, as agents.<name>.<KEY>. |
secret set --allow-missing |
Accepts a key the catalog does not declare. |
secret get <KEY> (agent) |
Self-scoped: returns any secret visible to that agent, on stdout. |
secret get |
The canonical runtime fetch; no value lands on disk. |
secret set (shared/other) |
Operator-only, as is secret list. |
secret remove (aliases) |
rm and unset are the same verb. |
secret list |
Key NAMES only, never values. Takes no key argument. |
secret merge |
A three-way merge driver for the encrypted store, for a git conflict on secrets.d/. |
cred encrypt |
systemd-creds for a unit credential; general-purpose. |
PII filter
Fleet-wide, not per-agent.
agentctl pii-filter set <base-url> [model]
agentctl pii-filter set --local [model]
agentctl pii-filter set --local-js
agentctl pii-filter clear
agentctl pii-filter status
agentctl pii-filter log [--session <id>] [--json]
| Command |
Note |
pii-filter set <base-url> |
Points the fleet at an external KServe v2 PII detector; turns redaction ON for every pi agent on the next apply. [model] is the KServe path segment. |
pii-filter set --local |
Self-hosts the detector as a host service on every host running a pi agent. 4 cores, 2 GB, ~1.5 GB of weights fetched at apply. No API key. |
pii-filter set --local-js |
Detects in-process inside each pi agent. No service, no key, no egress — the weights ship in the package. Takes no arguments. |
pii-filter set (exclusivity) |
The three modes are mutually exclusive; setting one clears the others. |
pii-filter clear |
Removes the detector; pi agents return to the no-op path on their next apply. A local service is stopped and disabled. |
pii-filter status |
Shows the mode. External: whether the API key is in the secret store — never the key. Local modes: service and weights state, and nothing about keys. |
pii-filter log |
Self-scoped: shows what the model provider actually saw for the calling agent's own session — the redacted form plus spans. The cockpit reveal's only data source; nothing else retains the redacted form. |
Docker and systemd units
agentctl docker [--yes] <docker-args…>
agentctl unit logs <unit> [-f] [--since <when>] [--until <when>] [--grep <pattern>] [--json] [-n <count>]
agentctl unit logs <usercron.service> --cron-output [--cron-date YYYY-MM-DD] [-n <count>]
agentctl unit logs <usercron.service> --cron-artifact state.json
agentctl unit logs <usercron.service> --cron-artifact runs.log [-n <count>]
agentctl unit status <unit>
agentctl unit reset-failed <unit>
| Command |
Note |
docker |
The host's docker CLI, run as root through agentd. Operator scope. Full passthrough — not an allowlist; --yes is required for the irreversible subcommands (prune, rm, rmi, compose down), and an unbounded one (logs -f, attach, events, wait) is refused. |
unit logs |
journalctl for ANY systemd unit on this host. For a per-agent script cron, --cron-output reads the newest private per-run log (or newest on a UTC --cron-date) with URL/token/key/certificate redaction and a bounded tail. --cron-artifact reads only state.json or runs.log from the bundle named by the unit's active ExecStart, with ownership/path checks, redaction and byte/line bounds; it does not accept arbitrary paths. |
unit status |
Unit properties (state, User, exact process exit code/status/time, restarts, memory, cgroup) plus the cgroup's memory.events OOM counters. |
unit reset-failed |
Clears ONE unit's latched failed state, after the cause is actually fixed. |
Host maintenance
agentctl host cron add|remove|list <job>
agentctl host rename [<new-name>] [--from <old-name>]
agentctl host upgrade
agentctl host list
agentctl host set <key> <value>
agentctl host dial
agentctl host caddy apply | recreate | domain set <fqdn> | domain clear
agentctl host proxy set <url> | clear
agentctl host proxy no-proxy add|remove <host-or-url> | list | clear
agentctl remote add <url> | remove
agentctl fleet reachable [--json] | seed | adopt [--force] | sync
| Command |
Note |
host cron |
Host-scope timers. |
host cron (catalog) |
Shipped jobs: load-monitor, runaway-reaper, job-watchdog. |
host rename |
Renames this host across the fleet ledger after an OS hostname change. |
host rename (touches) |
The hosts key, agent-host pins, teams_gateway. |
host upgrade |
Upgrades the agentctl package on THIS host: apt --only-upgrade / dnf upgrade --refresh. |
host upgrade (after) |
Run apply. |
host list |
Every host in the ledger with the agents pinned to it (* marks this machine), plus the fleet-wide maintenance-shell flag. |
host set |
One fleet-shared host scalar, declaratively; commits and pushes. The keys are host_shell, the two activity-protocol keys, and the cockpit theme keys (accent, backgrounds, foregrounds, borders, fonts, radius, logo, icon, app name), most with a _dark variant. |
host dial |
Holds this host's own connection to the fleet gateway, authenticated with the host's age key, so host shell <this-host> works with no agent on it. Machine-invoked: it is agentctl-host-dial.service's ExecStart. |
host caddy |
The host's TLS front end — see TLS and Caddy. domain set records the cockpit's FQDN. |
host proxy |
The host's outbound HTTP proxy, and its no-proxy list — see Egress proxies and air-gap. |
remote add |
Fleet /opt git remote + deploy key; prints the pubkey to register. |
fleet reachable / seed / adopt / sync |
Cluster-onboarding primitives. See Multi-host fleet § Joining a new host for the ordered sequence. |
Host diagnostics
Read-only host reads, at operator scope.
agentctl host disk [<path>…]
agentctl host load
agentctl host units [<pattern>] [--failed] [--all]
agentctl host ports
agentctl host sockets
agentctl host kernel [-f] [--since <when>] [-n <count>]
agentctl host http-probe <url> [--json] [--insecure] [--head] [--timeout <dur>] [--max-redirects <n>]
agentctl host stream-stats [--json]
agentctl host gateway-snapshot
agentctl host hostjob-ready [--json]
agentctl host activity-protocol-cat <relpath>
| Command |
Note |
host disk |
df -h for every filesystem, plus du -sh for each path given. |
host load |
Uptime, load average, memory and swap, and the real cgroup CPU quota. |
host units |
Failed units with no arguments. A pattern lists every loaded unit matching it; --all widens further. |
host ports |
Listening TCP sockets and the process holding each. Expected values are in Ports. |
host sockets |
TCP socket state counts — total, per state, and per gateway port, with queues and owner. |
host kernel |
The kernel log, where the OOM killer records what it killed. |
host http-probe |
One bounded GET or HEAD from this host: redirect chain, DNS/connect/TLS/TTFB timing, headers, certificate and a body sample. --insecure skips certificate verification. |
host stream-stats |
Live SSE/WS connection-lifecycle counters for the gateway process running on this host now — active, connects, disconnects and the disconnect-reason breakdown. |
host gateway-snapshot |
One bounded read: login and gateway unit status, reverse-proxy container state, socket state, gateway ports, upload-spool capacity, agent registration. |
host hostjob-ready |
This host's readiness as a host-job TARGET, per check: receipt store, unit template, runner binary, reconcile lock, receipt recovery scan. Exit 0 when ready. |
host activity-protocol-cat |
One file under the activity-protocol fleet store, by relative path. Admin or operator scope. |
Crons
agentctl cron add <label> --schedule '<OnCalendar>' (--skill <name>|--script <abs>|--workspace-script <abs>|--script-stdin --lang <ext>) [--host [--run-on <host>|any] | --agent <name>|self] [--timeout <dur>] [--dry-run] [--force]
agentctl cron remove <label> [--host | --agent <name>]
agentctl cron trigger <label> [--host | --agent <name>]
agentctl cron list [<agent>] [--host] [--json]
| Command |
Note |
cron add --script |
Durable self-contained script bundle: local shell/Python/JS/TS dependencies are copied into the overlay. |
cron add --workspace-script |
Durable timer pointing to an explicitly workspace-owned script; validated on every apply. |
cron add --script-stdin |
Pipes the script body on stdin; --lang gives the extension that picks the interpreter. |
cron add |
Durable timer, at self scope. |
cron add --host |
Host scope; admin. --run-on pins which host runs it, or any. |
cron add --agent |
An operator authors the cron FOR a named agent. |
cron add --timeout |
Caps one run; --dry-run renders the unit and timer without installing them; --force overwrites an existing label. |
cron remove |
Removes a generated cron. |
cron trigger |
Runs a generated cron once, now, without waiting for its timer. |
cron list |
Your crons; the admin agent and root see every agent's. A named agent narrows it, and cannot be combined with --host. |
cron list --host |
Host crons. |
Monitoring and observability
Read-only, and they route locally — except models, which reads the root-only ledger and so
goes through agentd (see its rows below).
agentctl top --json [--watch]
agentctl top --web [addr] --gateway [--login] [--ws-port <n>]
agentctl agents status [<name>]
agentctl health
agentctl doctor [<name>]
agentctl logs <name>|self [-f] [--since …] [--until …] [--grep …] [--json] [-n N]
agentctl timers [<name>]
agentctl creds [<name>]
agentctl usage [<name>] [--days N]
agentctl models
agentctl tail|def|session-stream|history|ws|mem|sessions|subagents|skills … <agent>
| Command |
Note |
top --json |
The raw Snapshot for THIS host, as one object. |
top --json --watch |
The same object as a 2.5s stream. |
top --json (wire format) |
What the fleet view is built from; the gateway op-relays it into each dialed-in agent. |
top --web |
The headless host service: serves the cockpit, accepts agent dial-ins. |
top --web (fleet view) |
The fleet view is the cockpit's fleet app — see The fleet view. |
top --web (reach) |
An admin sees every agent on the host, live, plus agents dialing in from other hosts. |
top --ws-port |
The dial-in listener's port in gateway mode; --login also serves the login proxy. |
top (other flags) |
top takes only the flags above. Any other flag exits 2 with a message naming what to use instead. |
agents status |
Per-agent unit state, uptime, NRestarts, mem/cpu, creds and MCP status. |
health |
Every agent on this host, plus host-level checks doctor does not run: the agents group, the ledger, and per-shard secret recipient drift. Non-zero exit on any problem. |
doctor |
Actionable diagnostics plus suggested fixes, per agent. |
health / doctor |
Non-zero exit makes them a watchdog or host-monitoring signal. |
logs |
An agent's unit journal; delegates to unit logs (root, via agentd). |
logs (scope) |
Admin scope, even for your own unit. |
timers |
Schedule, next fire, last run plus result. |
creds |
Per-(agent, provider) login health: valid, expiring or dead. |
usage |
Token and estimated-cost rollup. |
models |
The fleet's model_choices: catalog plus your own current default, as JSON. Self-scope: it takes no target, and an argument is an error. |
models (routing) |
The exception to "they route locally": the ledger is root-only, so this one goes through agentd, which resolves whose default to report from the calling uid. |
models (pi only) |
A claude agent's model is a free-text model name and was never a catalog id, so the verb refuses one. |
tail … skills |
Read backends the cockpit consumes over the socket or the agent dial-in — full grammar below. |
Workspace, memory and session reads
Read (and, for ws, write) backends the cockpit consumes directly. Every agent may name
itself; naming another agent is operator scope and is an
agent-administration operation — the host is
resolved from that agent's run_on: pin, so the spelling does not change when the peer lives
on another machine.
Admitted for a peer, from this section: ws ls|cat|raw|render|write|mkdir|rm|mv|changes|search,
mem, sessions, skills, def, candidates. Not admitted for a peer, and local-only:
ws inbox, the office verbs, subagents, tail, session-stream, history.
agentctl ws ls <agent> [relpath]
agentctl ws cat <agent> <relpath>
agentctl ws raw <agent> <relpath>
agentctl ws inbox <agent> <filename>
agentctl ws render <agent> <relpath>
agentctl ws write <agent> <relpath> # content on stdin
agentctl ws mkdir <agent> <relpath>
agentctl ws rm <agent> <relpath> [--recursive]
agentctl ws mv <agent> <src> <dst>
agentctl ws chmod <agent> <relpath> <mode> # octal only, e.g. 755
agentctl ws stat <agent> <relpath>
agentctl ws changes <agent> [--since <dur>]
agentctl ws search <agent> <query> [--limit N]
agentctl office stage|pdf|preview|reconcile <agent> <relpath>
agentctl office sweep <agent>
agentctl mem <agent> [--since <dur>] [--grep <regexp>] [--type user|feedback|project|reference]
agentctl sessions <agent> grep <pattern> [--since <dur>] [--role user|assistant] [--tool <name>]
agentctl sessions <agent> perms [--lane <lane>] [--all]
agentctl sessions <agent> pending [--lane <lane>]
agentctl sessions <agent> list [--since <unix-millis>] [--limit N]
agentctl sessions <agent> timeline <session-id>
agentctl subagents <agent> [--session <sid>]
agentctl skills <agent> [--since <dur>]
agentctl tail <agent> [--json] [--watch]
agentctl def <agent> <skill|subagent|cron|hook> <name>
agentctl session-stream <agent> [--once] [--seed N]
agentctl history <agent> [--before <unix>] [--limit <n>]
agentctl candidates <agent> [--kind skill|memory] [--status <s>] [--since <dur>]
| Command |
Note |
ws ls / ws cat / ws raw |
List a workspace dir as JSON; print a text file; stream raw bytes (images/pdf/media). |
ws inbox |
Streams an inbound-attachment file from the agent's channel inbox — cockpit thumbnails. |
ws render |
Renders a workspace text file to HTML — markdown, Chroma-highlighted code, CSV/JSONL tables — the cockpit's file-tab renderer. |
ws write |
Writes stdin to a workspace file; the self-scoped web-view save path. |
ws mkdir |
Creates a workspace folder, seeding a starter CLAUDE.md — the web-view add-folder path. |
ws rm |
Deletes a file or empty dir; --recursive deletes a populated tree — the web-view delete path. |
ws mv |
Moves/renames a workspace file — the web-view drag-to-folder path. |
ws stat |
Reports one path's current mode, owner, size and dir flag as JSON — {"mode":"0644","owner":"1001:1001","size":12,"dir":false}. The read half of ws chmod: ws ls carries no mode, so without this a mode could be changed and not read back. mode is a 4-digit octal string (a number would be re-read as decimal); owner is numeric uid:gid, which is what answers "is this the agent or is it root". No file contents, no timestamps. |
ws chmod |
Sets an existing path's permission bits from an octal mode (755, 0644). No web-view path; it exists so an admin agent can repair a peer's file mode — a cron script that lost its execute bit — without a root shell. Symbolic forms (+x) are refused, as is any mode above 0777, so setuid/setgid/sticky are not expressible. The target must already exist, and a symlink is refused rather than followed. Mode only — it cannot change a path's owner or group. |
ws changes |
Files changed since a duration — git log/diff if a repo, else an mtime walk — as JSON. |
ws search |
Full-text search of the agent's zk notebook, indexed and live, as JSON. |
office stage/pdf/preview/reconcile |
Cockpit Office-viewer backend for a workspace docx/xlsx/pptx: stage a copy to OneDrive, convert to PDF, preview, or write back an edit. Self-scope. |
office sweep |
Garbage-collects an agent's stale Office-viewer staging state. |
mem |
Searches an agent's file-based memory (MEMORY.md + memory/*.md) as JSON. |
sessions grep |
Transcript search across an agent's sessions. |
sessions perms |
The permission-prompt journal. |
sessions pending |
Permission prompts still awaiting an answer. |
sessions list |
An agent's sessions, newest first. --since takes Unix milliseconds, not a duration. |
sessions timeline |
One session's events, by session id. |
subagents |
Background subagents a session spawned (running first), as JSON — the web-view chip row. |
skills |
An agent's INSTALLED skills (~/.claude/skills or ~/.pi/agent/skills) with created/modified times, as JSON. Activation is a different verb: agents skills add\|remove\|list. |
tail |
An agent's live event feed as JSON — the watch-view source. |
def |
A skill/subagent/cron/hook's definition — the top detail viewer; op-relayed to a dialed-in agent. |
session-stream |
An agent's live session transcript as JSON events — the web-view seed. |
history |
One reverse-chronological page of an agent's full timeline (sessions + crons) — web-view scroll-back. |
candidates |
An agent's pending turn-review skill/memory candidates (idea plus pointers), as JSON. |
Subsessions
Headless, web-view-only agent sessions, at self scope.
agentctl subsession start --title <name> [--resume <sid>] <agent>|self
agentctl subsession prompt <name> <text> <agent>|self
agentctl subsession prompt <name> --resume-own-work <agent>|self
agentctl subsession tail <name> <agent>|self
agentctl subsession resume <name> <agent>|self
agentctl subsession clear <name> <agent>|self
agentctl subsession rm <name> <agent>|self
agentctl subsession rename <name> <new-name> <agent>|self
agentctl subsession list <agent>|self [--with-main]
agentctl subsession notify main|<name> <message> <agent>|self
agentctl subsession reap [--ttl <dur>]
| Command |
Note |
subsession start |
Spawns a NAMED headless sub on the web-view channel; the name is the handle. |
subsession prompt |
Delivers a turn to the sub's own ingress. |
subsession prompt --resume-own-work |
Recovers a STALLED sub instead of sending text: injects a resume turn if it is alive but has written nothing for 10 minutes, re-launches it if its process is gone, and does nothing if it is healthy or ended on its own. Self-scope — it resolves the name inside the caller's own registry. |
subsession tail |
Its transcript as JSON events. |
subsession resume |
Re-launches a stopped or idle sub, and re-checks the running cap. |
subsession resume (refuses) |
A sub with no transcript. |
subsession clear |
Stops the unit and KEEPS the transcript, so it stays resumable. |
subsession rm |
Deregisters it and keeps the transcript. |
subsession rename |
Retitles it; sid, transcript and unit are untouched. |
subsession rename (refuses) |
A name already taken. |
subsession list |
The registry as JSON: id, title, kind, status, last_active, resumable. |
subsession list --with-main |
Adds the synthesized main-lane entry — the cockpit's shape. |
subsession list (cross-agent) |
Goes through agentd, as root. |
subsession notify |
Leaves a note for ANOTHER SESSION OF THE SAME AGENT — target main (always that literal) or a subsession's name. Writes one file per notification under the target agent's ~/.cache/agentctl/subsession-notify/<bucket>/. Delivery is at the target's NEXT model call, so it reaches a target that is busy mid-turn as well as an idle one. For a cross-agent message, use agent-message. |
subsession notify (claude target) |
Writes the file. A pi extension drains it on the context event, so a pi target is the one that reads it. |
subsession notify (what the target keeps) |
The drain writes the notification into the receiving session's transcript before it deletes the file, so the record survives the model call it was injected on. The cockpit renders it as a REPORTED card in that lane. |
subsession notify (the sender's name) |
from is the sending subsession's title, or main for the main lane. A cron run names itself cron:<label> from the AGENTCTL_CRON_LABEL the cron wrappers export, and the cockpit tags those JOB instead of REPORTED. Every pi cron reports its outcome this way — see Crons. |
subsession notify (cross-agent) |
Not a cross-agent verb. It runs locally rather than through agentd, so an admin naming a peer hits that peer's home permissions and errors. agent-message is the ledger-gated verb for reaching another agent. |
subsession reap |
Host janitor timer: stops idle subs past the TTL. |
The seam invariant
| Rule |
Statement |
| Source of truth |
Append-only files on disk. |
| Frames |
The live push of events already in that log. |
| Durability |
Every durable frame must be reconstructible from the log. |
| Exempt |
Typing signals, token-delta previews, browse RPC, handshakes, client view state. |
| Full statement |
Architecture, including the one-writer rule for sends. |