  Remove the local daemon (--yes to apply, --purge for local credentials)

Credential storage:
  sr storage            Show the active credential source
  sr storage hosted     Use credentials hosted for the selected Stack team
  sr storage local      Keep and use credentials only on this machine
  sr storage legacy     Use the selected legacy remote Subrouter server

Team vault management:
  sr team list          List Stack Auth teams
  sr team current       Show the selected team
  sr team use <team>    Select the team whose credentials this machine leases
  sr account list       List credentials shared with the selected team
  sr account add <codex|claude|openai-key|anthropic-key>
                           Add one credential to the selected team vault
  sr account import --only <label> [--dry-run]
                           Copy one local credential for a canary
  sr account import --all --dry-run
                           Copy local credentials into the selected team vault
  sr account import --all --yes
                           Confirm the reviewed bulk upload
  sr account repair <id>
                           Replace a broken shared credential in place
  sr account remove <id>
  sr logout             Revoke this machine's cmux.com session

Usage:
  sr                    Show Codex and Claude usage, grouped by provider
  sr add                Add an account; asks whether it is Codex or Claude
  sr add codex          Add a Codex account (opens OAuth login)
  sr add claude         Add a Claude account (opens OAuth login)
  sr add-key            Add an API key account
  sr import             Import current ~/.codex/auth.json account
  sr list               List all Codex accounts
  sr switch [email]     Switch active Codex account and sync OpenCode/pi
  sr g [email]          Switch active account, sync OpenCode/pi, and restart Codex.app
  sr gui [email]        Switch active account, sync OpenCode/pi, and restart Codex.app
  sr gui-switch [email] Switch active account, sync OpenCode/pi, and restart Codex.app
  sr remove <email>     Remove a Codex account
  sr status             Show Codex and Claude usage (non-interactive)
  sr pick               Switch to the recommended account, failing if none has quota
  sr reset [email]      Redeem a rate-limit reset credit (best candidate, or --all, or --dry-run)
  sr usage [days]       Refresh and show API-key spend
  sr trace <email>      Show OAuth refresh breadcrumbs for an account

  sr remote -v          List local, cmux hosted, and self-hosted remotes
  sr remote use local   Route agents through this computer
  sr remote use cmux    Route agents through hosted cmux
  sr remote add <name> <url>
                           Add a self-hosted Subrouter
  sr remote use <name>  Route agents through a self-hosted Subrouter

  sr daemon start       Start this machine's local proxy
  sr daemon stop        Stop this machine's local proxy
  sr daemon restart     Restart this machine's local proxy
  sr daemon status      Show local proxy health
  sr daemon logs        Follow local proxy logs

  sr server             Manage legacy remote Subrouter servers
  sr server up          Compatibility alias for daemon start
  sr server down        Compatibility alias for daemon stop
  sr server restart     Compatibility alias for daemon restart
  sr server status      Compatibility health view
  sr server add <name> --url <url> [--default]
  sr server use <name|local> [--no-codex-config]
  sr server rename <old> <new>
  sr server install <name>
  sr server login <name> [--device-auth]
  sr server sync <name> [--device-auth] [--yes]

  sr tenant create <name> [--server <name>]     Create an isolated per-tenant account pool
  sr tenant list [--server <name>]
  sr tenant key create <tenant> [--server <name>]
  sr tenant key revoke <tenant> <key-prefix> [--server <name>]

  sr admin-keys         List stored OpenAI admin keys
  sr add-admin-key      Add an sk-admin-* key
  sr remove-admin-key <label>
  sr attach-project <api-key-label> [--project-id <id-or-name>]

  sr claude             Manage Claude Code profiles
  sr claude-aws [--model fable] [claude args...]
                           Launch Claude Code on AWS Bedrock via the server (Fable 5)
  sr claude-direct [claude args...]
                           Launch Claude Code directly on Anthropic (bypass subrouter)
  sr spend              Show AWS Bedrock spend tracked by the server
  sr gemini             Manage Gemini profiles

  sr serve [--addr 127.0.0.1:31415] [--authority-mode --state-dir /absolute/path] [--fetch-usage=true] [--multi-tenant] [--codex-upstream URL] [--claude-upstream URL] [--kimi-upstream URL] [--zai-upstream URL] [--transcripts DIR] [--transcript-gcs-uri gs://bucket/prefix] [--transcript-gcs-sync-timeout 30m] [--transcript-local-retention 24h] [--transcript-max-local-bytes 2GiB]
  sr authority-status --state-dir /absolute/path
  sr supervise --worker-bin PATH [--addr 127.0.0.1:31415] [--control-socket /var/run/subrouter-supervisor.sock] [--expect-proxy-protocol] [--drain-timeout 10m] [--worker-stop-grace 30s] -- [serve flags]
  sr front --backend-id ID --backend-address ADDRESS [--backend-network tcp|unix] [--addr 127.0.0.1:31415] [--control-socket /var/run/subrouter-front.sock] [--listener-transfer-socket /var/run/subrouter-front-listener.sock]
  sr probe [--url http://127.0.0.1:31415]
  sr accounts
  sr codex [codex args...]
  sr install-daemon [--start=true]       macOS LaunchAgent
  sr install-systemd [--start=true]      Linux systemd service
  sr install-launchd [--start=true]      macOS shared-server credentials

Session stickiness:
  Prefer sending X-Subrouter-Session per conversation.
  Send X-Subrouter-Agent when the client is not Codex.
  Send X-Subrouter-User-Email for teammate-level observability.
  Send X-Subrouter-Account-ID to force a specific account, including an API-key account.
  Subrouter switches the active sr account every 10m by default; set --sr-switch-interval=0 to disable.
  For sr codex, set SUBROUTER_CODEX_USER_EMAIL and/or SUBROUTER_CODEX_ACCOUNT_ID instead.
  The proxy also checks common session headers, query params, and small JSON bodies.

Codex accounts                                                                     
#    Account               Plan  State           Use               5h       7d     
───  ────────────────────  ────  ──────────────  ────────────────  ───────  ───────
1    paid (api key)        a...  rec             API key fallback                  

Switch to (#): No shared accounts.
--- FAIL: TestSlotRetirementDrainsPinnedStreamBeforeSupervisorExit (0.00s)
    supervisor_test.go:410: listen unix /home/user/.cache/overdeck/tests/subrouter/1786982558-1017160-full/tmp/subrouter-worker-1259318440/worker.sock: bind: invalid argument
--- FAIL: TestStartWorkerGenerationKeepsSocketPathDialable (0.00s)
    supervisor_test.go:681: startWorkerGeneration: listen unix /home/user/.cache/overdeck/tests/subrouter/1786982558-1017160-full/tmp/subrouter-worker-1344388363/worker.sock: bind: invalid argument
FAIL
FAIL	github.com/manaflow-ai/subrouter/cmd/subrouter	17.686s
ok  	github.com/manaflow-ai/subrouter/cmd/subrouter-transport-observer	12.970s
ok  	github.com/manaflow-ai/subrouter/internal/accounts	12.959s
ok  	github.com/manaflow-ai/subrouter/internal/agents/claude	4.612s
?   	github.com/manaflow-ai/subrouter/internal/agents/gemini	[no test files]
?   	github.com/manaflow-ai/subrouter/internal/agents/opencode	[no test files]
?   	github.com/manaflow-ai/subrouter/internal/agents/pi	[no test files]
ok  	github.com/manaflow-ai/subrouter/internal/broker	0.008s
ok  	github.com/manaflow-ai/subrouter/internal/front	0.128s
ok  	github.com/manaflow-ai/subrouter/internal/proxy	16.264s
ok  	github.com/manaflow-ai/subrouter/internal/stackauth	0.009s
ok  	github.com/manaflow-ai/subrouter/internal/storepath	0.039s
ok  	github.com/manaflow-ai/subrouter/internal/tailnet	0.002s
ok  	github.com/manaflow-ai/subrouter/internal/tenant	0.047s
ok  	github.com/manaflow-ai/subrouter/internal/transcript	0.011s
ok  	github.com/manaflow-ai/subrouter/selectacct	4.624s
ok  	github.com/manaflow-ai/subrouter/session	0.005s
FAIL

command-supervisor classification=opaque-exit
command-supervisor last-event=none
command-supervisor process-tree=empty
