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.
Keys & inventory#
| Command | Purpose |
|---|---|
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 list | List 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#
| Command | Purpose |
|---|---|
stm policy list | Show the active allow / deny / warn rules. |
stm policy add | Add a rule over the tuple (key, command, agent, project). |
stm policy remove | Remove a rule. |
stm policy test | Test 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#
| Command | Purpose |
|---|---|
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#
| Command | Purpose |
|---|---|
stm project add | Register a project (path + name). |
stm project list | List registered projects. |
stm project show | Show a project's in-scope keys and settings. |
stm project scope | Add a key to a project's scope. |
stm project unscope | Remove a key from a project's scope. |
stm project enforce | Make PreToolUse refuse out-of-scope substitutions for that project. |
stm project rename | Rename a project. |
stm project remove | Unregister 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#
| Command | Purpose |
|---|---|
stm vault info | Show the local vault's path, mode, magic, and KDF id. |
stm vault unlock | Cache the encrypted-file passphrase for this process. |
stm vault rotate-passphrase | Rotate 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#
| Command | Purpose |
|---|---|
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#
| Command | Purpose |
|---|---|
stm teams quickstart | The guided path — run this first. quickstart create makes a team + prints a copy-paste invite; quickstart join joins and requests enrollment in one step; quickstart finish accepts the team key (verifying the fingerprint) and pulls the vault. Same commands and cryptography as the steps below, fewer to remember. |
stm teams serve | Run the self-hostable, zero-knowledge Teams server (configured via STM_TEAM_* env vars). |
stm teams init | Create a team (admin). Generates the team key, self-enrolls, prints the team token. --server <url> --admin <token> [--name <name>]. |
stm teams join | Join a team from a member machine. --server <url> --token <team-token> [--name <handle>]. A machine can belong to several teams. |
stm teams list / use <name> | List the teams this machine belongs to; switch the current one. Any command takes --team <name> to target another. |
stm teams enroll-request | Publish your public keys and request enrollment (nothing secret is sent). |
stm teams members | List 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 accept | Unwrap the sealed team key locally into your keychain. |
stm teams passphrase | Set the team passphrase directly (the shared-passphrase alternative to public-key enrollment). |
stm teams share <tool>:<label> | Mark a key shared (included in push) or, with unshare, personal. Keys are personal by default. |
stm teams push | Encrypt shared keys with the team key and upload the vault blob; personal/unscoped keys are held back. --all shares every active key. |
stm teams pull | Download the vault, decrypt locally, and add new keys. |
stm teams audit-push | Send local key-use events (placeholder commands only), signed with your Ed25519 key. |
stm teams audit | Show the combined team log, attributed to the verified member. |
stm teams usage-push | Send local brokered-call usage records (metadata only), signed with your Ed25519 key. |
stm teams usage | Read the team usage log. --tool/--member filter, --limit N caps, --summary aggregates. |
stm teams status | Show this machine's team configuration. |
stm teams leave | Remove this machine's team config. |
The full self-hosting walkthrough is on the Teams page.
Codex (experimental)#
| Command | Purpose |
|---|---|
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#
| Command | Purpose |
|---|---|
stm dashboard | Open the localhost dashboard (add keys out-of-band, bound to 127.0.0.1). |
stm status | Daemon + inventory summary, active agents, and the active keystore backend. |
stm doctor | Diagnose which keystore tier is active and how to reach the next-stronger tier. |
stm stop | Stop the dashboard daemon. |
stm uninstall | Remove all stm data (and any Codex blocks) from this host. |
stm --version | Print the installed stm version. |
Inside Claude Code the common actions also have slash commands: /stm:dashboard,
/stm:inventory, /stm:import, and /stm:revoke.
How these commands stay safe
The keychain-only model, the four hooks, the policy engine, and the honest limits behind the CLI.
Read the security model → ReferenceDOCS.md — the long form
Keystore tiers, platform details, subscriptions and funding cards, and the full Codex surface.
Open DOCS.md →