Get started with the CLI
View as MarkdownInstall the reveata command line tool, sign in with a token, choose a website and get tables or JSON.
On this page
The reveata command line tool works with the same data as the REST API, from your terminal or your scripts: websites, stats, realtime visitors, goals, funnels, visitor profiles and payments. It can also send goals, payments and crawler requests from your backend.
Install
Install it from npm with npm install -g @reveata/cli. Anything the CLI does, you can also do by calling the API with the same token, for example with curl as shown in the API introduction.
It needs Node 22 or newer.
npm install -g @reveata/cli
reveata --helpSign in
Create an account token (dt_pat_…) under Account → API / MCP with the permissions you need, or use a website's site key (dt_site_…) from Settings → Developer. CLI permissions and roles explains what each command needs.
Then sign in once:
reveata login --api-url https://reveata.comWithout --token, the CLI asks for the token (the input is hidden on a terminal; otherwise it reads the first line of standard input). It checks the token with GET /api/v1/whoami and saves it, together with the API URL, in the config file. The token is never printed again: output shows a masked form such as dt_pat_…a91c.
echo "$REVEATA_TOKEN" | reveata login --api-url https://reveata.com
reveata whoamiConfig file and environment
The token and API URL are saved in ~/.config/reveata/config.json (under $XDG_CONFIG_HOME when it is set). Only you can read the folder (mode 0700) and the file (mode 0600). reveata logout removes the token and keeps the API URL.
For both values, a --token or --api-url flag wins over the environment, and the environment wins over the config file. The CLI reads these environment variables:
REVEATA_TOKEN: API token, used instead of the saved one.REVEATA_API_URL: Server origin, used instead of the saved one.REVEATA_SITE: Website id or domain used when --site is not given.REVEATA_CONFIG: Path of the config file to use instead of the default.REVEATA_BOT_TOKEN: Website bot request token for bots forward.
Choose a website
Most commands act on one website, named with --site <id|domain>: its id or its domain. Without --site, the CLI uses REVEATA_SITE, then the default saved with reveata config set-site (reveata config), and for a site key the key's own website. An account token can reach several websites, so it must name one.
reveata sites list
reveata stats overview --site example.comTables or JSON
Every command prints a readable table by default. Money is shown in the website's currency, for example €1,234.50.
With --json the CLI prints the API's data as JSON on standard output: the object for one resource, and every collected row (an array) for lists. Money stays in minor units (cents), as the API returns it. Messages, hints and errors always go to standard error, so the output can be piped:
reveata sites list --json | jq '.[].domain'--verbose prints every request with its status and x-request-id on standard error. Quote the request id when you contact support.
The exit code is 0 on success, 1 when the API answered with an error or the server could not be reached, and 2 when the command line itself is wrong (an unknown command or option, or a missing argument). A server that does not offer an endpoint yet answers 501 not_implemented, which the CLI reports as not available on this server yet.
Options on every command
--json: Print the raw JSON data instead of a table--verbose: Print every request with its status and x-request-id on stderr--token <token>: API token for this call (overrides REVEATA_TOKEN and the config file)--api-url <origin>: Server origin, e.g. https://analytics.example.com (opens in a new tab) (overrides REVEATA_API_URL)-h, --help: Show help for the command--version: Print the CLI version
reveata help <command> (or reveata <command> --help) prints the help of one command, with its options and examples.
Account commands
reveata account get and account update read and change your own profile and preferences (account:read / account:write). To save a default website, see reveata config.
reveata login
Verify an API token and save it for later commands.
Accepts an account token (dt_pat_…, Account settings → API / MCP → Account tokens) or a site key (dt_site_…, a website’s Settings → Developer → Site API keys). Without --token you are prompted (hidden input on a terminal; otherwise the first line of stdin is read). The token is checked with GET /api/v1/whoami and saved with the API URL in the config file (mode 0600).
No options beyond the global ones.
Calls GET /api/v1/whoami and GET /api/v1/websites (websites:read).
reveata login --api-url https://analytics.example.com
reveata login --token "$REVEATA_TOKEN" --api-url http://localhost:3000reveata logout
Remove the saved token from the config file.
No options beyond the global ones.
reveata logoutreveata whoami
Show the credential in use, its scopes and (with --site) its access there.
Options:
--site <id|domain>: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
Calls GET /api/v1/whoami.
reveata whoami
reveata whoami --site example.com --jsonreveata account get
Your profile, sign-in methods and preferences.
No options beyond the global ones.
Calls GET /api/v1/account (account:read).
reveata account getreveata account update
Change your name and preferences.
Options:
--name <name>: Display name--theme <theme>: light, dark or system--email-notifications <true|false>: Receive account emails (alerts and reports have their own settings)
Calls PATCH /api/v1/account (account:write).
reveata account update --name "Jane Doe"
reveata account update --theme dark --email-notifications falseEvery command
- reveata sites: list, add and inspect websites, and change their settings and attribution.
- reveata stats: headline metrics, time series, breakdowns and new versus returning visitors.
- reveata realtime: visitors online right now.
- reveata goals: goal completions and the revenue they bring, recent completions, and goal display settings.
- reveata funnels: create, change and delete funnels, and read their conversion.
- reveata visitors: visitor profiles and journeys.
- reveata events: send goals from your server.
- reveata payments, customers and revenue: send and list payments, customers and subscription metrics.
- reveata bots: crawler traffic and rules, and forwarding crawler requests from your access logs.
- reveata team, keys and tokens: members and invites, website API keys and account access tokens.
- reveata alerts: alerts and scheduled reports, their tests and history.
- reveata segments and notes: saved segments and chart notes.
- reveata config and completion: a default website and shell completion.