Skip to main content
The crispstats command line reads the same numbers as the dashboard and the REST API: every command maps to one API endpoint. It prints aligned tables for people and the API’s JSON, untouched, for scripts and agents. It needs Node 20 or newer and has no dependencies. Try it now on the public demo site, no key needed:

Install

Run it without installing through npx, or install it once to get the crispstats command:
npx crispstats works too: the crispstats package installs @crispstats/cli and exposes the same command.

Sign in

1

Run login

It prints the address of the API and MCP page, at the API keys section, and opens it in your browser.
2

Create a secret key

Create a key with the Read scope to read reports. To record or delete payments, give it the Events or Admin scope too. See API keys.
3

Paste the key

Paste it at the prompt. Nothing is shown as you type, and the key never lands in your shell history. The CLI checks it against the API before saving it.
The key is saved to ~/.config/crispstats/config.json, or $XDG_CONFIG_HOME/crispstats/config.json when that is set. The file is readable by you only (mode 600). If the key reads exactly one site, that site becomes the default.
logout only removes the key from this computer. The key keeps working until you revoke it on the API and MCP page.

Pick a site

Every report reads one site. The CLI takes the first of these that is set:
  1. --site <id> on the command
  2. the CRISPSTATS_SITE environment variable
  3. the default saved with crispstats use
A site id is the segment after /app/ in your dashboard URL; crispstats sites lists them. crispstats use also takes the site’s domain. Without any of them, a report stops with No site picked. and exit code 2.

Environment variables

A flag wins over an environment variable, which wins over the saved file.

Flags for every command

Colour is also off when the output is not a terminal, so piped output is always plain.

Output

For people, numbers come formatted the way the dashboard shows them: money from the API’s integer minor units in the site’s currency (4900 USD is $49.00), rates as percentages, durations as minutes and seconds, times in UTC. Long lists end with where the next page starts:
With --json, the CLI prints the response body untouched, so jq and agents read the API’s documented fields. --all fetches every page of a paged list and prints them as one response, with every row in rows (or events for raw events).

Errors and exit codes

Errors go to stderr, never into piped output. Each one names the cause, as the API wrote it, and the way out:
With --json, the API’s error envelope is printed to stderr as is. See errors for every code.

Use it in CI

Store the key as a secret and pass it through the environment. Nothing is written to disk.
GitHub Actions
A delete needs --yes in CI, since there is no one to answer the prompt. Requests count against the key’s rate limit; --verbose shows how much is left.

Use it from an AI agent

Coding agents that run shell commands can read your analytics with the CLI. Give the agent a Read only key, through CRISPSTATS_TOKEN, and tell it to pass --json:
Every command has --help with an example, and every report’s JSON carries a summary sentence an agent can quote. For assistants that speak MCP, the MCP server offers the same reports as tools. Next: every command.
Last modified on December 3, 2026