`swarmctl --swarm https://<swarm> login` runs the OAuth 2.0 authorization-code flow with PKCE against the swarm's authelia as a new public `swarmctl` client: a pushed authorization request, the browser login and explicit consent, and the code delivered by form_post to a loopback port. The access and refresh tokens are cached at mode 0600 under $XDG_STATE_HOME/swarmctl/ and refreshed under a file lock, since authelia rotates the refresh token and revokes the login when a used one is presented again. With --swarm (or SWARMCTL_SWARM), the agent, schedule and forge verbs send their requests to https://<swarm>/api/ with the bearer token instead of over the controller's unix socket, which stays the default. authelia registers the client on every authelia host with a swarm domain: `kind = "native"`, public, no minted secret, scopes offline_access and authelia.bearer.authz, audience https://<swarm>/api/ (matched as a URL prefix), redirect http://127.0.0.1/callback (any loopback port). Every field is one authelia 4.39.20's validator requires for a public client holding the bearer scope. The swarm apex's /api/ answers a refused caller that sent an Authorization header with the 401 itself instead of the login redirect, so the CLI can tell "log in again" apart from an answer; a browser still gets the redirect. The bearer token is not forwarded to the controller. Refs #4409 (mara: c94764, c94782).
18 KiB
Command-Line Help for swarmctl
This document contains the help content for the swarmctl command-line program.
Command Overview:
swarmctl↴swarmctl agent↴swarmctl agent create↴swarmctl agent mint-identity↴swarmctl agent mint-forge-token↴swarmctl agent inference↴swarmctl agent inference get↴swarmctl agent inference set↴swarmctl agent inference clear↴swarmctl schedule↴swarmctl schedule add↴swarmctl schedule list↴swarmctl schedule edit↴swarmctl schedule pause↴swarmctl schedule resume↴swarmctl schedule rm↴swarmctl user↴swarmctl user add↴swarmctl user reset-password↴swarmctl user update↴swarmctl user list↴swarmctl forge↴swarmctl forge make-admin↴swarmctl login↴swarmctl completions↴
swarmctl
swarm-level operator CLI
Usage: swarmctl [OPTIONS] <COMMAND>
Subcommands:
agent— Manage agents across the swarmschedule— Manage scheduled promptsuser— Manage subjects in the swarm's SSO providerforge— Manage human accounts on the swarm's forgelogin— Log in to the swarm named by--swarmas your own SSO accountcompletions— Generate a shell completion script forswarmctland print it to stdout
Options:
-
--authelia-bin <PATH>— authelia binary used to hash passwords. The argon2 parameters must match the verifier's, so this has to be the configured package rather than whatever is onPATH -
--users-file <PATH>— Host-side path of authelia's users database — that is, the path inside the container, prefixed with the container's root.This is the only user store: it's read before every change and written in place, and
swarm-authelia-bridgewrites the same file. -
--swarm <URL>— The swarm's domain, ashttps://<domain>. Given, theagent,scheduleandforgeverbs go through its gateway as the accountswarmctl loginlogged in, instead of over the controller's socket. Falls back toSWARMCTL_SWARM -
--ca-file <PATH>— A PEM CA certificate to trust beside the system roots, for a swarm whose gateway serves a certificate from the swarm's own CA. Falls back toSWARMCTL_CA_FILE
swarmctl agent
Manage agents across the swarm
Usage: swarmctl agent <COMMAND>
Subcommands:
create— Queue creation of a new agent on a hive in this swarmmint-identity— Queue a re-mint of an existing agent's identity at the swarm's secret storemint-forge-token— Check one agent's forge token, and mint it if it's missing or staleinference— Show or change the model, effort and subagent models the swarm sets for an agent
swarmctl agent create
Queue creation of a new agent on a hive in this swarm.
Asks the swarm-controller to insert its agent-creation job graph — SSO identity, forge user, config repo, and the deploy message that puts the agent on --hive — and prints the queued job's node id.
This returns as soon as it queues the work. It doesn't wait, and a finished graph would not mean the agent is up either: the last node publishes a deploy, after which the hive converges on its own clock. Watch the swarm UI's job view, or the hive itself, for the rest.
No approval gate guards this: the caller is root on the controller's host, or logged in through the swarm domain's SSO gate.
Usage: swarmctl agent create [OPTIONS] --hive <HIVE> <NAME>
Arguments:
-
<NAME>— Name for the new agent: 1–63 characters of[a-z0-9-].Becomes an SSO subject, a forge user and a repository name, so it's validated here before queuing. The controller refuses a name the swarm has already placed on a different hive; the same name on the same hive re-creates that agent.
Options:
-
--hive <HIVE>— Hive in this swarm to deploy the agent to.Required, and deliberately not defaulted: it's an address — the hive that gets the deploy message — and only the operator knows which one they mean. The controller checks it against the swarm's hive roster and names the known hives if it misses.
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl agent mint-identity
Queue a re-mint of an existing agent's identity at the swarm's secret store.
The backfill verb. Agent creation is event-driven and nothing at swarm level sweeps for agents that are missing a credential, so an agent created before a credential joined the mint never receives one. This re-runs the mint for one agent that already exists.
⚠️ It re-mints the agent's store certificate, which that agent picks up the next time its container boots. It leaves an existing queue secret exactly as it stands, so running this against an already-migrated agent doesn't disturb its queue connection.
Queues and returns, the same way agent create does — watch the swarm UI's job view for the outcome.
Usage: swarmctl agent mint-identity [OPTIONS] <NAME>
Arguments:
<NAME>— Name of an agent that already exists
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl agent mint-forge-token
Check one agent's forge token, and mint it if it's missing or stale.
swarm-controller does this for every agent with a store identity at start and every five minutes; this is for when waiting isn't an option. It leaves a current token alone.
Queues and returns, the same way agent create does — watch the swarm UI's job view for the outcome.
Usage: swarmctl agent mint-forge-token [OPTIONS] <NAME>
Arguments:
<NAME>— Name of an agent that already exists
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl agent inference
Show or change the model, effort and subagent models the swarm sets for an agent.
A field the swarm sets wins over the agent's own value (its agent.nix or a hyperhive-model/hyperhive-effort file) from its next turn on; the agent reads its settings every ten seconds. A field the swarm doesn't set, or clears, leaves the agent on its own value.
Usage: swarmctl agent inference <COMMAND>
Subcommands:
get— Show what the swarm sets for an agent, naming the fields it doesn't set, and the model and effort the agent runs on, each with where it comes fromset— Set fields for an agent. Only the flags given change; the others keep what's storedclear— Clear every field for an agent, so it goes back to its own values
swarmctl agent inference get
Show what the swarm sets for an agent, naming the fields it doesn't set, and the model and effort the agent runs on, each with where it comes from
Usage: swarmctl agent inference get [OPTIONS] <AGENT>
Arguments:
<AGENT>— Agent name
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl agent inference set
Set fields for an agent. Only the flags given change; the others keep what's stored
Usage: swarmctl agent inference set [OPTIONS] <AGENT>
Arguments:
<AGENT>— Agent name. A hive must declare it
Options:
-
--model <MODEL>— The model its turns run on, as claude's--modeltakes it -
--effort <LEVEL>— The reasoning effort its turns run atPossible values:
low,medium,high,xhigh,max -
--subagent-models <MODELS>— The models it may start subagents on, comma-separated. Stored and shown; the agent doesn't apply it yet -
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl agent inference clear
Clear every field for an agent, so it goes back to its own values
Usage: swarmctl agent inference clear [OPTIONS] <AGENT>
Arguments:
<AGENT>— Agent name
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule
Manage scheduled prompts.
The swarm keeps each prompt, and every agent it names fires it in its own container. Fire times are the schedule's start time plus whole intervals: changing the body never moves them, and an agent that was down fires the latest missed one once.
Usage: swarmctl schedule <COMMAND>
Subcommands:
add— Add a scheduled prompt and print it with its new idlist— List scheduled prompts, one row each, with their agents and next fire timeedit— Change a scheduled promptpause— Stop a scheduled prompt firing. Times that pass while it's paused aren't fired when it resumesresume— Let a paused scheduled prompt fire again, from its next time onrm— Remove a scheduled prompt from every agent it names
swarmctl schedule add
Add a scheduled prompt and print it with its new id.
Without --every it fires once. Without --at its first fire is now.
Usage: swarmctl schedule add [OPTIONS] --name <TEXT> --agent <AGENT> --body <TEXT>
Options:
-
--name <TEXT>— The prompt's title -
--agent <AGENT>— Agent to fire it in. Repeatable; at least one -
--body <TEXT>— The prompt, delivered to each agent verbatim -
--at <TIME>— First fire time: an RFC 3339 time with its offset, such as2026-10-05T09:00:00+02:00, or unix seconds. Defaults to now -
--every <DURATION>— Time between fires: a count with a unit ofs,m,hord, such as1hor7d. Leave out for a one-shot -
--paused— Add it paused -
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule list
List scheduled prompts, one row each, with their agents and next fire time
Usage: swarmctl schedule list [OPTIONS]
Options:
-
--agent <AGENT>— Show only the prompts that fire in this agent -
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule edit
Change a scheduled prompt.
Only the flags given change, and the id stays. --at and --every move the fire times; --name, --body and the agent flags don't.
Usage: swarmctl schedule edit [OPTIONS] <ID>
Arguments:
<ID>— The prompt's id, asschedule listshows it
Options:
-
--name <TEXT>— New title -
--body <TEXT>— New prompt text -
--at <TIME>— New first fire time, in the formschedule add --attakes -
--every <DURATION>— New time between fires, in the formschedule add --everytakes -
--once— Make it a one-shot -
--add-agent <AGENT>— Agent to start firing it in. Repeatable -
--remove-agent <AGENT>— Agent to stop firing it in. Repeatable. Fails if the agent isn't a target, or if no agent would remain -
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule pause
Stop a scheduled prompt firing. Times that pass while it's paused aren't fired when it resumes
Usage: swarmctl schedule pause [OPTIONS] <ID>
Arguments:
<ID>— The prompt's id, asschedule listshows it
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule resume
Let a paused scheduled prompt fire again, from its next time on
Usage: swarmctl schedule resume [OPTIONS] <ID>
Arguments:
<ID>— The prompt's id, asschedule listshows it
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl schedule rm
Remove a scheduled prompt from every agent it names
Usage: swarmctl schedule rm [OPTIONS] <ID>
Arguments:
<ID>— The prompt's id, asschedule listshows it
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl user
Manage subjects in the swarm's SSO provider
Usage: swarmctl user <COMMAND>
Subcommands:
add— Add a user, generating a password for themreset-password— Set a new password for an existing user, generating it the same wayuser adddoesupdate— Change an existing user's attributeslist— List every user in authelia's users database
swarmctl user add
Add a user, generating a password for them
Usage: swarmctl user add [OPTIONS] <USERNAME>
Arguments:
<USERNAME>— Login name. Conservative ASCII only — it's a YAML map key and reaches access-control rules and logs
Options:
--display-name <TEXT>— Name shown in the SSO UI. Defaults to the username--email <ADDRESS>--group <GROUP>— Repeatable
swarmctl user reset-password
Set a new password for an existing user, generating it the same way user add does.
authelia's file store has no self-service reset (no SMTP notifier), so this is the only way a human account gets a new password once an operator forgets the old one. Refuses if the user doesn't exist — there's no separate "create" path here.
Usage: swarmctl user reset-password <USERNAME>
Arguments:
<USERNAME>— Login name of an existing user
swarmctl user update
Change an existing user's attributes.
Every flag is optional and they compose, so one call can set multiple things at once. Deliberately doesn't touch the password: regenerating a credential is a different intent from editing an attribute, and folded together an attribute edit can invalidate a login by accident.
Usage: swarmctl user update [OPTIONS] <USERNAME>
Arguments:
<USERNAME>— Login name of an existing user
Options:
--display-name <TEXT>— Name shown in the SSO UI--email <ADDRESS>--add-group <GROUP>— Repeatable. Adding a group the user is already in isn't an error--remove-group <GROUP>— Repeatable. Fails if the user isn't in the group — a revocation that reports success without revoking is the failure nobody re-checks
swarmctl user list
List every user in authelia's users database.
Read-only: it never writes the file. Shows every subject in it, including agent identities swarm-authelia-bridge created — one line per user: username, display name, email (if set), groups (if any).
Usage: swarmctl user list
swarmctl forge
Manage human accounts on the swarm's forge
Usage: swarmctl forge <COMMAND>
Subcommands:
make-admin— Make an existing forge user a site admin
swarmctl forge make-admin
Make an existing forge user a site admin.
The forge creates a human's account on their first SSO login, and this fails until that login has happened. Running it on a site admin changes nothing. Refused for an agent.
Usage: swarmctl forge make-admin [OPTIONS] <NAME>
Arguments:
<NAME>— Forge username, the same as the user's SSO username
Options:
-
--controller-socket <PATH>— swarm-controller's unix socket.Supplied by the nix module that installs this binary, from the same
socketPathoption the daemon binds; falls back toSWARM_CONTROLLER_SOCKET.
swarmctl login
Log in to the swarm named by --swarm as your own SSO account.
Opens the swarm's SSO login in your browser (and prints the URL) and receives the answer on a loopback port, so run it where that browser runs. swarmctl keeps the login, mode 0600, under $XDG_STATE_HOME/swarmctl/ and refreshes it as it's used. To log out, delete that file.
Usage: swarmctl login
swarmctl completions
Generate a shell completion script for swarmctl and print it to stdout.
Supports bash, zsh, fish, elvish and powershell. The nix package already installs bash/zsh/fish system-wide; this is for ad-hoc or other-shell use.
Dispatched before PathArgs::resolve() for the same reason as markdown-docs: emitting a completion script needs none of the SWARMCTL_AUTHELIA_* deployment env vars, and requiring them would make the package's own build-time invocation fail.
Usage: swarmctl completions <SHELL>
Arguments:
-
<SHELL>— Shell to emit completions forPossible values:
bash,elvish,fish,powershell,zsh