The CLI
anastroctl does everything the web UI does and more: enrolling devices, scripting threads and
machines, managing clusters, and launching the web UI as your device. For every subcommand and flag,
see the CLI reference.
Install
Section titled “Install”Build from source with a stable Rust toolchain:
git clone https://github.com/leftshiftlabs/anastrocd anastrocargo install --path crates/anastroctlOr build with Nix (binary lands at ./result-ctl/bin/anastroctl):
nix build 'github:leftshiftlabs/anastro#default^ctl'Runs on macOS and Linux.
Find your way around
Section titled “Find your way around”Commands are grouped by resource, using singular nouns and clear verbs (account device list,
inference token create):
- Daily work:
thread,machine,project,org,board,trigger,assistant,ui - Your account:
login,whoami,account(devices and API keys) - Integrations:
inference,apps(GitHub and Linear),connector(remote MCP servers),mcp - Operations:
cluster,node,users,audit,api
Run anastroctl <command> --help to explore subcommands and flags (operator flags like -C and
--operator-key show up under cluster and node help). Commands that take --project accept a
project name or ID; set ANASTRO_PROJECT or a context’s project field to avoid repeating it.
The client file
Section titled “The client file”anastroctl locates clusters using ~/.config/anastro/config.toml (override with --anastroconfig
or ANASTROCONFIG). Your operator gives you the node entries—each context pins a cluster’s
nodes by their cryptographic node_id:
current = "prod"
[contexts.prod]nodes = [ { name = "cp1", node_id = "<endpoint id>", relay = "https://relay-1.example.com", addrs = ["10.10.0.11:7444"] },]org = "acme" # optional default org (override with --org or ANASTRO_ORG)project = "api" # optional default project (override with --project or ANASTRO_PROJECT)| Key | Meaning |
|---|---|
current |
Default context when --context / ANASTRO_CONTEXT isn’t set |
nodes |
Each node’s name, pinned node_id, relay URL, and optional direct addrs |
org |
Default org for org-scoped commands (falls back to your personal org) |
project |
Default project for project-scoped commands |
All traffic travels directly over iroh, so anastroctl works anywhere your
cluster’s relays or direct addresses are reachable. Your device’s private key (device.key) is
created automatically next to config.toml the first time you need it.
Sign in this device
Section titled “Sign in this device”With an enrollment link (an invite, a recovery link, or a sign-in link from
anastroctl account device link):
anastroctl login --enroll 'anastro://enroll#…'This redeems the link for your device’s own key and adds the cluster to your client file. The link itself never becomes a device, and the cluster never sees your private key.
Without a link (when your client file already lists the cluster’s nodes):
anastroctl login --name "work laptop"This prints a join string (anastro-device:<endpoint ID>?name=work%20laptop) and waits. Approve
that exact key from a device that’s already signed in:
- CLI:
anastroctl account device approve '<join string>' - Web UI: Settings → Devices → Approve a device or browser, and paste the join string
Check that the name and short ID match. Nothing reaches the cluster before approval, so there is no one-time code anyone could intercept. Once approved:
anastroctl whoamianastroctl account device listanastroctl account device revoke <device> # by name or ID prefixIf you’re bootstrapping a brand-new cluster, anastroctl cluster bootstrap enrolls your first device
automatically (The first admin). Native apps use the same
enrollment links (Apps).
Open the web UI
Section titled “Open the web UI”anastroctl uiOpens the web UI in your browser on a fresh http://anastro-<random>.localhost:<port> origin,
signed in as this device. See The web UI.
Keys for scripts and CI
Section titled “Keys for scripts and CI”Device keys belong on people’s computers. For scripts and CI, create an API key: anastroctl
generates a key pair locally and registers only the public key on the cluster.
anastroctl account key create --name ci --ttl 30d --project api --scope readanastroctl account key listanastroctl account key revoke <id>| Option | Effect |
|---|---|
--ttl |
Required lifetime (12h, 30d), capped at 90 days unless your operator changed [auth] api_key_max_ttl |
--project |
Restrict to specific projects (repeatable); default is every project you can access |
--scope |
Restrict to specific operation IDs, or read for all GETs (repeatable); default is everything you can do |
--service-account |
Issue a key for a service account instead of yourself |
--out |
Write the secret to a new 0600 file instead of printing it |
--public-key |
Register an externally generated public key so no secret is printed |
The secret (anastro_sk_…) is printed once. Pass it via ANASTRO_KEY or --key-file <file> to
run anastroctl as that key instead of your device. API keys can’t mint new credentials or perform
sensitive actions like approving devices.
In CI, commit the client file (it contains no secrets, only node IDs and addresses) and store the API key in your CI secrets:
ANASTRO_KEY=${{ secrets.ANASTRO_KEY }} anastroctl --anastroconfig anastro.toml machine listFor raw read-only API queries over iroh, use anastroctl api get <path>. Browse the full API schema
at /api/docs on the origin printed by anastroctl ui.
Renamed commands (migrating old scripts)
Section titled “Renamed commands (migrating old scripts)”Older top-level account and operator commands moved into consistent resource groups:
| Old command | New command |
|---|---|
devices, tokens |
account device, account key |
apply, bootstrap, unseal, upgrade, backup, postgres, storage |
cluster <cmd> |
secret identity, operator-key id |
cluster key age, cluster key operator |
secret init, secret set, secret ls, secret rm |
cluster bundle init, set, list, delete |
secret store |
cluster secret |
health, status, version |
node status (combines health, version, API health, and git rev) |
bash, terminal, fs diff, fs cat, fs ls |
machine exec, machine shell, machine diff, machine cat, machine ls |
machine destroy |
machine delete |
inference add, inference token, inference tokens |
inference account add, inference token create, inference token list |
project members <project> list |
project member list --project <project> |
secrets bind <project> |
project secret bind --project <project> |
thread rename, thread pin, thread snooze |
thread set --title, --pinned, --snooze |
Thread deletion also uses --delete-machines to destroy attached machines.