GitHub

keys

Mint, list, and revoke org API keys without leaving the terminal

The keys command manages org API keys, the credential used for CI, headless agents, and the hosted MCP server. It talks to the same endpoints as the dashboard’s Settings → API Keys page.

Subcommands

  • create - Mint a new key
  • list - List keys for your org
  • revoke - Revoke a key by prefix or id

create

Mint a new org API key. The plaintext token is shown once, copy it before you close the terminal.

Usage

bash
squirrel keys create [options]

Options

OptionDescriptionDefault
--nameKey namecli-<hostname>-<yyyymmdd>
--scopesComma-separated scopesfull access
--expires-daysDays until expirynever
--shellOffer to append the export line to your shell rc fileoff
--jsonOutput as JSONoff

Example

bash
squirrel keys create --name "CI" --scopes audits:write,audits:read,credits:read
✓ Created API key CI (sq_ab12cd…) for Acme Inc
  Scopes: audits:write, audits:read, credits:read
  Expires: never

Save this token now (it will not be shown again):
  sq_ab12cd34ef56gh78ij90kl12mn34op56

Ready to copy:
  export SQUIRRELSCAN_API_KEY=sq_ab12cd34ef56gh78ij90kl12mn34op56

--shell

--shell shows the exact line and target file, asks for confirmation, then appends (never overwrites), with a trailing # added by squirrel keys create comment so it’s easy to find later:

bash
squirrel keys create --shell
About to append to /Users/you/.zshenv:
  export SQUIRRELSCAN_API_KEY=sq_ab12cd…  # added by squirrel keys create
Append this line? [y/N]

zsh prefers ~/.zshenv (sourced for every invocation, not just interactive shells) when it exists, falling back to ~/.zshrc. Requires an interactive terminal: in CI or a non-TTY shell, copy the printed export line manually instead.


list

List API keys for your org.

Usage

bash
squirrel keys list [options]

Options

OptionDescription
--jsonOutput as JSON

Example

bash
squirrel keys list
sq_ab12cd…  CI  active
  Scopes: audits:write, audits:read, credits:read
  Created: Jun 1, 2026  Last used: Jul 3, 2026

revoke

Revoke a key immediately by its prefix (as shown by list) or full id.

Usage

bash
squirrel keys revoke <prefix-or-id> [options]

Options

OptionDescription
--forceSkip the confirmation prompt
--jsonOutput as JSON

Example

bash
squirrel keys revoke sq_ab12cd
About to revoke CI (sq_ab12cd…).
Continue? [y/N] y
✓ Revoked CI (sq_ab12cd…)

A prefix that matches more than one active key errors instead of guessing. Use a longer prefix or the full id.

  • Authentication - token types, scopes, and precedence
  • auth - log in first; keys requires a login session
  • Hosted MCP - the main consumer of a minted key for agents

Type to search…

↑↓ navigate open esc close