@getstackrun/cli
STACK from your terminal. The operator CLI mirrors nearly every STACK surface:
register agents, issue passports, connect services and grant scoped
credentials, manage your team, configure detectors and notifications, retrieve
credentials for scripts and CI, and tail the live audit log. Sign in once via
OAuth Device flow.
# Sign in (browser opens, RFC 8628 Device flow)
npx @getstackrun/cli auth login
# Fastest path: register a safe bot, make one governed LLM call, see the proof
npx @getstackrun/cli quickstart
# Run a localhost LLM gateway — point any tool's baseURL at it, no key on the box
npx @getstackrun/cli proxy serve --agent familybot
# Retrieve a credential for a script (operator-only, audited, revocable)
export SLACK_TOKEN=$(npx @getstackrun/cli service credential slack --json | jq -r .access_token)
# Tail your live audit log
npx @getstackrun/cli monitor --follow
# See everything
npx @getstackrun/cli --help
Agents with the default stack_managed signing model need no enrollment —
quickstart and proxy serve provision the on-box keypair automatically on
first run. agent enroll is only for the advanced customer_managed
bring-your-own-keypair path.
Docs for agents
How-to guides for every STACK service and for controls are published as markdown. The list is at https://getstack.run/llms.txt, and one service's guide is at https://getstack.run/docs/account/.md (for example https://getstack.run/docs/account/email.md).
Which surface? CLI vs MCP vs SDK
STACK has three client surfaces. Pick by who is driving.
| Surface |
Who drives it |
When |
What it's for |
MCP (mcp.getstack.run) |
an LLM assistant (Claude Code, Cursor) |
dev and setup, in natural language |
auto-discovered stack_* tools over OAuth |
SDK (@getstackrun/sdk, getstack) |
the agent's own code |
the runtime hot path |
offline passport verification, in-process |
CLI (npx @getstackrun/cli) |
a human operator in a terminal |
ops, scripts, CI |
routine operator actions + live audit tail; team, credential and administration commands require explicit OAuth scopes |
The three share one credential: auth login writes ~/.stack/credentials.json,
and both SDKs read it. Sign in once, all three work.
The default CLI login is the same set a person gets signing in from an MCP
client. It does not grant team administration, raw credential retrieval,
payout writes, OAuth-app/CMEK changes, authority or identity mutation, skill
publishing, partner administration, or platform admin. For a deliberate
management session, set STACK_OAUTH_SCOPE to the exact scopes you
need and sign in again; refresh tokens preserve or narrow scope and cannot add
it later.
Commands
npx @getstackrun/cli --help prints every command. The reference below is
generated from the same registry as --help (src/commands.ts), so the two
cannot drift. Prefix each command with npx @getstackrun/cli.
Get started
| Command |
What it does |
quickstart [--provider anthropic\|openai\|openrouter] [--agent <name>] |
Guided setup: register a safe bot, issue a passport, make one governed LLM call, print the audit row |
proxy serve --agent <name\|id> |
Run a localhost LLM gateway. Point any tool's baseURL at it (dummy key ok); STACK injects the real key. No key on the box.[--port 8788] [--provider anthropic\|openai\|openrouter] [--mission-ttl 3600] |
setup [--clients claude,codex,cursor] [--groups agents,messaging] |
Add STACK to one or several installed MCP clientsClient names may be separated by commas or spaces.``--groups chooses the tool groups the client lists from its first list (a client that never refreshes its tool list needs it); omit it for the plain URL, or use all for every tool. |
register |
Print how to get started and the MCP install instructions |
Account
| Command |
What it does |
auth login |
Sign in via browser (Device flow, RFC 8628) |
auth status |
Show current sign-in state |
auth logout |
Revoke session and clear local credentials |
me |
Print your operator profile |
Usage & billing
| Command |
What it does |
usage |
Consumption vs plan + spend + earnings (billing period) |
usage --period <p> |
Scope to a window: today | yesterday | 7d | 30d | month | last-month | billing (default) |
usage --since <iso> --until <iso> |
Arbitrary range (ISO-8601 or unix-ms)``scan usageandllm usagedrill into those meters |
billing subscriptions |
Read the platform and controls subscription state and this month's account actions and control checks |
billing subscribe platform\|controls |
Start the platform or hosted controls subscription; prints the Stripe Checkout URL and whether a free trial applies(controls need the platform subscription first; a 409 SUBSCRIPTION_CONFLICT means it is already on, or the account does not need one) |
Agents
| Command |
What it does |
agent list |
List all your agents |
agent show <name\|id> |
Detail on one agent |
agent register <name> |
Register a new agent[--profile proxied-llm-bot] <- safe default for a bot that just runs``[--key-mode stack_managed\|customer_managed\|co_signed]``[--llm-inject-system-prompt true\|false] <- no effect: accepted and ignored [--llm-redact-pii true\|false]``[--accountability-mode logged\|enforced\|standard] <- new agents start logged``[--eval-traffic true\|false] <- test traffic: warnings arrive resolved, criticals stay live |
agent setup --from-file <setup.json> |
Register an agent, its first grants and the hosts its connections may reach, as one approval |
agent dismiss-warnings <name\|id> |
Resolve an agent's open warnings and hide new ones of the same kinds for a day; criticals stay open |
agent update <name\|id> |
Rename an agent, change its description, or update its LLM-gateway toggles (redaction defaults true / fail-closed)[--name <new-name>] <- must be free among your agents that are not retired; changes no authority``[--description <text>]``[--llm-inject-system-prompt true\|false] <- no effect: accepted and ignored``[--llm-redact-pii true\|false] <- false sends user PII to the provider unredacted |
agent enroll <name\|id> |
Enroll a customer-managed keypair (advanced; stack_managed agents and 'proxy serve' auto-enroll, no manual step) |
agent rotate <name\|id> |
Rotate keypair (admin only) |
agent sign-claim <name\|id> |
Sign a claim envelope locally (customer_managed mode)--envelope <file.json> [--out <file>] |
agent suspend <name\|id> |
Suspend an agent |
agent unsuspend <name\|id> |
Re-activate a suspended agent |
agent unblock <name\|id> |
Clear an auto-blocked agent so it can issue new passports |
agent delete <name\|id> |
Delete an agent |
Passports