Documentation

CLI guide

A small command-line client for the Read API. It is handy for cron jobs, quick checks in a terminal, and piping JSON into other tools.

The CLI is not published to npm yet. Run it from a checkout of the AnalyticFast repository with Node 18 or later:

export ANALYTICFAST_TOKEN=afx_api_...
export ANALYTICFAST_URL=https://app.analyticfast.com
node packages/cli/bin/analyticfast.mjs sites
node packages/cli/bin/analyticfast.mjs overview --site SITE_ID --period 7d
node packages/cli/bin/analyticfast.mjs breakdown --site SITE_ID --dim country --json

On Windows, use set instead of export.

CommandWhat it prints
sitesSites the token can read
overview --site SITE_IDTotals for the period
breakdown --site SITE_ID --dim NAMETop values for a dimension (default source)

Options: --period, --from, --to, --limit, --filters (JSON) and --json to print the raw API response. The token and URL come only from the environment, never from flags, so they stay out of your shell history.

Questions, answered.

How do I use cli with AnalyticFast?

Follow the CLI instructions on this page using your own website’s Site ID and configuration. Verify a real event before relying on the reports.

Where can I get setup help?

Contact support@analyticfast.com with the website domain and a redacted description. Do not send API tokens, signing secrets or personal customer data.