/spellguard:spellguard-clifrom spellguard
Inspects, scripts, and operates the Spellguard CLI for auth, managed agents, provisioning, diagnostics, and JSON/YAML/table output contracts.
Ships in spellguard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the installed spellguard CLI as the source of truth for Spellguard account state, managed coding agents, setup, and diagnostics. Prefer spellguard schema when scripting because it exposes auth, prompt, mutation, destructive, arguments, flags, environment, output, and result-field metadata.
| Need | Command family | Reference |
|---|---|---|
| Current user, login state, profiles, config resolution | whoami, login, logout, profile, config | identity.md |
| Managed agent inventory and per-framework login state | agents, agents login | agents.md |
| SSH/connect readiness and connection next steps | connect | connect.md |
| Create or terminate managed coding agents | provision, deprovision | provision.md |
| Wait for async work | operations wait | operations.md |
| Install or repair Claude Code/Codex plugin wiring | setup, reset | setup.md |
| Health, version, schema, updates | doctor, version, schema, update | diagnostics.md |
| Any other domain command (credentials, policies, orgs, members, byok, providers, spend-limits, visibility, activity, audit, integrations, …) — the full curated surface (~250 commands) | see the index | index.md |
| Any management-API operation with no dedicated command anywhere (uncurated raw passthrough) — prefer a curated command when one exists | api | api.md |
The rows above are the human-facing shortcuts; index.md lists EVERY curated command family (the wide agent surface is hidden from --help but fully available). If no shortcut row fits, consult the index BEFORE reaching for api. Prefer a curated command whenever one covers your task: only those carry field projection, typed remediation, --skeleton, and next_steps. Reach for api only for an operation with no curated command in the index (the ~47 known gaps) — or run spellguard schema for the exhaustive catalog. Mutating methods (POST/PUT/PATCH/DELETE) require --yes; GET/HEAD never do. The server — not the CLI — enforces permissions on the target operation.
Use machine output for automation:
spellguard whoami --format json
spellguard agents --format json
spellguard agents --fields framework,provider,region --format json
spellguard connect my-agent --format json
spellguard operations wait op_123 --format json
spellguard schema agents --compact
Use --non-interactive in scripts when a prompt would be wrong. Use --yes only when the user has already confirmed a destructive action.
Request bodies: write to a temp file, pass the path. --input takes a file path, or - to read stdin — never inline JSON (an inline --input '{"k":"v"}' is opened as a filename and fails with body_unreadable). Writing the body to a temp file avoids shell-quoting failures entirely; --skeleton prints a starter body to fill in.
spellguard agents create --skeleton > /tmp/body.json # starter body
# edit /tmp/body.json
spellguard agents create --input /tmp/body.json --yes --format json
printf '%s' '{"nonce":"abc"}' | spellguard github app complete-install --input - # or pipe via -
JSON/YAML success output uses an envelope with data, page, request_id, and warnings. Errors use error.code, error.message, error.remediation, and error.request_id on stderr. List commands may include page.truncated; if true, treat the list as partial.
Semantic exit codes are stable and add-only: 0 ok, 1 general, 2 usage, 3 authn, 4 authz, 5 not-found, 6 conflict, 7 network, 8 timeout, 9 confirmation-required (a machine-mode mutation refused without --yes). Signal exits pass through as 128+N such as Ctrl-C 130.
For compact command metadata, run:
spellguard schema <command> --compact
For full command metadata with descriptions, omit --compact.
SPELLGUARD_TOKEN takes precedence over stored login. If auth fails while that variable is set, replace or unset it before retrying.agents defaults to a stable minimal projection. Add optional fields with --fields; unknown field names are usage errors and list valid options.connect re-resolves detail before using display hostnames from agents; do not build SSH targets from list output alone.deprovision and reset are destructive. Confirm intent before adding --yes.setup claude-code and setup codex are the supported plugin setup paths. Do not edit agent settings files directly.spellguard binary is available.usage_error with valid alternatives and remediation.--format json; disable ambient agent mode only with SPELLGUARD_NO_AGENT_MODE when debugging.The files under references/ are generated from spellguard schema by pnpm run gen:cli-skill. When command metadata matters, read only the reference family needed for the task.
references/access-governance.md (opens in a new tab)references/activity.md (opens in a new tab)references/agents.md (opens in a new tab)references/analytics.md (opens in a new tab)references/api-keys.md (opens in a new tab)references/api.md (opens in a new tab)references/audit.md (opens in a new tab)references/byok.md (opens in a new tab)references/codex-authentication.md (opens in a new tab)references/connect.md (opens in a new tab)references/credentials.md (opens in a new tab)references/daemon.md (opens in a new tab)references/dashboard.md (opens in a new tab)references/detection-pipeline.md (opens in a new tab)references/diagnostics.md (opens in a new tab)references/github-audit.md (opens in a new tab)references/grants.md (opens in a new tab)references/groups.md (opens in a new tab)references/handlers.md (opens in a new tab)references/identity.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub spellguard/spellguard --plugin spellguard4 skills in this plugin
/spellguard-handler-authoringWrite, debug, or repair a Spellguard task handler — the single executable a managed box runs for a task type. Use when asked to 'write a handler', 'add a task type', 'make my agent do X when Y happens', 'why did my handler fail', 'my task timed out', 'the handler isn't running', 'inspect the handlers on this box', 'restore a handler', or when editing anything under ~/.config/spellguard/handlers. Teaches the handler ABI (stdin envelope, the three environment variables, the result-file contract, exit semantics), the heartbeat obligation that keeps a long task alive, how to report progress and completion without credentials, and how to read handler inventory and divergence states./spellguard-resetDisconnect this machine from Spellguard. Use when the user runs /spellguard-reset, wants a from-scratch setup test, or needs to cleanly tear down the agent on this machine (deregister server-side, stop the daemon, delete the local credential)./spellguard-setupBootstrap a Spellguard-issued GitHub credential. Use when the user runs /spellguard-setup, asks to set up Spellguard, or needs to authorize the plugin's GitHub access for the first time on this machine.Other plugins' skills for the same job