Skip to main content

Requirements

  • Node.js 20 or newer
  • An npm-compatible package manager

Install

The package installs a single chainpatrol binary. Verify it:
The npm package is @chainpatrol/cli. The unscoped chainpatrol package on npm is a placeholder for the JavaScript SDK and does not contain the CLI.
To run it once without installing globally:

Upgrading

The CLI checks npm for a newer version in the background while your command runs and prints a one-line notice when one exists. The check is skipped in --json and --quiet mode so it can never corrupt machine-readable output, and it never delays your command by more than half a second.

Configuration

Configuration lives in config.json inside the CLI’s config directory:
  • $XDG_CONFIG_HOME/chainpatrol/ (defaults to ~/.config/chainpatrol/)
  • ~/.chainpatrol/ is still used if it already exists and the XDG directory does not
  • $CHAINPATROL_CONFIG_DIR overrides both
~/.config/chainpatrol/config.json

Setting a default organization

Most organization-scoped commands take --org <slug>. Passing it saves the slug as your default, so later commands can omit it:
The organization is resolved in this order:
1

--org flag

An explicit --org <slug> always wins, and is written back to config.json.
2

Saved default

defaultOrg from config.json.
3

Environment variable

CHAINPATROL_ORG, useful in CI where you do not want to write a config file.
If none of them resolve, the command fails with Organization required. Use --org <slug> to specify one. and exit code 3.
Commands authenticated with an organization-scoped API key resolve the organization server-side from the key, so --org is optional for those.

Environment variables

Shell completions

chainpatrol setup installs completions for you. To write the script yourself:
Restart your shell to pick them up.

Uninstall

To also remove stored credentials and configuration, delete the config directory: