CLI reference

The stm command reference.

Every stm command, grouped by task. Each has a one-line purpose and a usage pattern. A key value is never passed on the command line — stm add reads it from stdin — so a secret never lands in your shell history.

Runtime hooks: macOS + Claude Code Linux / Windows / Codex: experimental Broker & Teams server: anywhere Bun runs

Keys & inventory#

CommandPurpose
stm add --tool <t> [--label <l>] [--plan] [--cost] [--renews]Add a key. The value is read from stdin, never the CLI. Optional flags record the plan, monthly cost, and renewal date alongside it.
stm listList keys, subscriptions, funding cards (last-4), monthly spend, and renewals due.
stm subscription <tool> [...]Set the plan, cost, renewal date, and funding card (nickname + last-4 only) behind a tool.
stm resolve {{stm:t:l}}Resolve a placeholder to its value locally (local-only; for debugging on your own machine).
stm revoke <tool> <label>Mark a key revoked in the inventory (a metadata flag — it does not call a provider API).
stm rotate <tool> <label>Open the provider dashboard and swap a new value in place; the placeholder address stays the same.
stm import [dir...]Scan .env files for keys to import into the inventory.
stm sync [provider]Fetch real spend from configured providers. The only feature that makes outbound calls — only when you run it, only to providers you configured.

The key value goes straight to the OS keychain. Read the placeholder grammar for how {{stm:tool:label}} is matched.

Access policy#

CommandPurpose
stm policy listShow the active allow / deny / warn rules.
stm policy addAdd a rule over the tuple (key, command, agent, project).
stm policy removeRemove a rule.
stm policy testTest a command against the active rules before you save one.

Rules are glob-matched and evaluated at PreToolUse, before keychain resolution — a denied command never causes a key to be read. See the policy engine.

Audit#

CommandPurpose
stm audit [--tail N] [--event <class>] [--tool] [--since]Print the forensic log of PreToolUse and broker decisions. Filter by count, event class, tool, or time.

Event classes: substitute · policy.deny · policy.warn · unresolved · malformed · broker. The audit log never holds a real key value.

Projects#

CommandPurpose
stm project addRegister a project (path + name).
stm project listList registered projects.
stm project showShow a project's in-scope keys and settings.
stm project scopeAdd a key to a project's scope.
stm project unscopeRemove a key from a project's scope.
stm project enforceMake PreToolUse refuse out-of-scope substitutions for that project.
stm project renameRename a project.
stm project removeUnregister a project.

Scope matching is a longest-prefix match on cwd. SessionStart only advertises the in-scope keys when a session opens inside that path.

Vault#

CommandPurpose
stm vault infoShow the local vault's path, mode, magic, and KDF id.
stm vault unlockCache the encrypted-file passphrase for this process.
stm vault rotate-passphraseRotate the Tier-3 vault passphrase (decrypt under the old, re-encrypt under the new).

These manage the opt-in encrypted-file keystore (Tier 3: PBKDF2-SHA512 + AES-256-GCM) used on headless Linux hosts. For non-interactive use set STM_FILE_PASSPHRASE. See DOCS.md for the full keystore tier chain and snapshot export/import.

Broker#

CommandPurpose
stm broker [tool] [label]Ensure the daemon is up and print the broker base URL, the loopback capability token, and a ready curl example. Route HTTP API calls so the real key is injected on the outbound request — never in the command.

Full details, the /proxy model, and the security invariants are on the broker page.

Teams#

CommandPurpose
stm teams serveRun the self-hostable, zero-knowledge Teams server (configured via STM_TEAM_* env vars).
stm teams initCreate a team (admin). Generates the team key, self-enrolls, prints the team token. --server <url> --admin <token> [--name <name>].
stm teams joinJoin a team from a member machine. --server <url> --token <team-token>.
stm teams enroll-requestPublish your public keys and request enrollment (nothing secret is sent).
stm teams membersList team members and their enrollment status.
stm teams enroll <member-id>(Existing member) seal the team key to a joiner's key. The CLI verifies the key set matches the id before sealing.
stm teams acceptUnwrap the sealed team key locally into your keychain.
stm teams passphraseSet the team passphrase directly (the shared-passphrase alternative to public-key enrollment).
stm teams pushEncrypt local active keys with the team key and upload the vault blob.
stm teams pullDownload the vault, decrypt locally, and add new keys.
stm teams audit-pushSend local key-use events (placeholder commands only), signed with your Ed25519 key.
stm teams auditShow the combined team log, attributed to the verified member.
stm teams statusShow this machine's team configuration.
stm teams leaveRemove this machine's team config.

The full self-hosting walkthrough is on the Teams page.

Codex (experimental)#

CommandPurpose
stm codex [...]Launch or wire up the OpenAI Codex CLI with stm keys (session-env mode, guardrail hooks, or MCP-wrapped mode). Experimental. Run stm codex --help for subcommands.

Codex is smoke-tested against external contracts only; Claude Code is the strongest supported surface. See the Codex section of DOCS.md.

Daemon & lifecycle#

CommandPurpose
stm dashboardOpen the localhost dashboard (add keys out-of-band, bound to 127.0.0.1).
stm statusDaemon + inventory summary, active agents, and the active keystore backend.
stm doctorDiagnose which keystore tier is active and how to reach the next-stronger tier.
stm stopStop the dashboard daemon.
stm uninstallRemove all stm data (and any Codex blocks) from this host.
stm --versionPrint the installed stm version.
Slash commands

Inside Claude Code the common actions also have slash commands: /stm:dashboard, /stm:inventory, /stm:import, and /stm:revoke.