Interactive login
credentials.json in the config
directory with 0600 permissions. Check it at any time:
Session tokens expire. When one does, the CLI clears it and asks you to run
chainpatrol login again, exiting with code 2.Logging in without a browser
In a remote shell, a container, or a CI runner, the CLI detects that it is not attached to a terminal and falls back to plain text — the verification URL is printed on stdout immediately instead of being hidden behind an interactive UI. Open it on any device. For a caller that parses output,--json emits one JSON object per milestone:
API key authentication
SetCHAINPATROL_API_KEY and the CLI uses it instead of a stored session — no login step,
nothing written to disk. This is the right choice for CI, cron jobs, and service accounts.
X-API-KEY header, the same one the External
API uses, so an existing API key works with the CLI as-is.
An organization-scoped key carries its organization with it. Commands that would otherwise
need --org — threats list, takedowns list, orgs assets list, reports search,
proposals review — resolve it from the key.
Which identity am I using?
whoami validates the key and reports the organization it is bound to.
With a session token, it returns the logged-in user. Either way it is the fastest check
before a command that writes.
Permissions
The CLI has exactly the permissions of the credential behind it — it does not widen them. Two consequences worth knowing:- Staff-only surfaces (for example
queues snapshot --all) fail with exit code5for customer credentials. - Proposal reviews must be attributed to a customer-role member of the organization, so staff credentials are refused there.