Skip to developer documentation
Browse developer documentation

Terminal reports and exports

CLI documentation

Read reports, export JSON or CSV, and approve website setup from your terminal. Find every released command and its options below.

Official CLI 0.1.5Requires Node.js >=20
Install and make your first request
npm install -g https://www.attriboo.com/downloads/attriboo-cli-0.1.5.tgz
attriboo --version
attriboo login
attriboo sites list
attriboo reports overview --site shop.example.com --period 7d --json

The package is hosted by Attriboo. No npm account is required. After listing your websites, replace the example domain with a returned website ID or domain.

All commands

Installation and session

CommandPurpose
attriboo --helpPrint the installed CLI's command list and supported options.
attriboo --versionPrint the installed CLI version.
attriboo loginOpen browser sign-in and save the approved workspace's rotating OAuth credentials.
attriboo logoutRevoke the saved OAuth session and remove its local credentials file.
attriboo whoamiShow the workspace and websites associated with the active credential.

Websites

CommandPurpose
attriboo sites listDiscover the real website IDs, domains, currencies and timezones in your workspace.
attriboo sites addCreate or reuse a website after confirming its details with the account holder.
attriboo sites scriptRetrieve a real website's snippet with its saved tracking and consent choices.
attriboo sites verifyInspect tracking activity timestamps and collection pause state.

Reports

CommandPurpose
attriboo reports overviewRead headline revenue, traffic, conversion and advertising metrics with comparison changes.
attriboo reports timeseriesRead traffic and revenue over daily, weekly, monthly or quarterly buckets.
attriboo reports sourcesCompare recorded marketing sources and their attributed revenue.
attriboo reports channelsCompare channel groups such as Organic Search, Paid Ads and AI Referral.
attriboo reports campaignsRead campaign revenue, recorded costs and return on ad spend.
attriboo reports pagesRead landing-page visits, AI referrals, crawler activity and revenue credit.
attriboo reports hostnamesGroup visitors by the hostname where they first arrived.
attriboo reports countriesRead countries audience counts, conversion and revenue.
attriboo reports citiesRead cities audience counts, conversion and revenue.
attriboo reports devicesRead devices audience counts, conversion and revenue.
attriboo reports browsersRead browsers audience counts, conversion and revenue.
attriboo reports osRead operating systems audience counts, conversion and revenue.
attriboo reports goalsRead goal completion counts and the revenue of visitors who completed each goal.
attriboo reports realtimeRead visitors active in the last five minutes.
attriboo reports salesRead recorded payments and refunds, newest first, with observed attribution details.
attriboo reports funnelsRead independent standard stages, list saved definitions, or inspect an ordered saved funnel.
attriboo reports ai-searchKeep crawler activity, referred human visitors and revenue credit separate for each AI engine.
attriboo reports time-to-purchaseGroup purchases by time since a preceding recorded entry visit.

Login, setup and CI access

attriboo login opens browser sign-in and requests analytics:read. Complete it on the same computer so the temporary loopback callback can return. --no-browser prints the link for you to open on that computer.

For website creation, script retrieval or verification, run attriboo login --setup and complete the separate owner/admin approval for sites:write. It does not buy an upgrade, deploy your website or connect a payment provider.

On a remote server or CI machine, configure ATTRIBOO_API_KEY privately for reports. It takes precedence over saved OAuth tokens and cannot use setup endpoints. Remove that override when you intend to use your approved setup session. There is no device-code login flow.

Report flags

Each command page lists the flags that affect that command. The parser recognizes shared flags globally; an unrelated flag is not evidence a command supports that behavior. Use the documented command-specific options.

Current CLI report options
FieldTypeDescription
--sitestringWebsite ID or domain. Required when the workspace has more than one website.
--periodstringUTC date selection. from and to override period.

Values: realtime, today, yesterday, 7d, 30d, 90d, 12m, wtd, mtd, qtd, ytd, all.

Default: 30d.

--fromstringInclusive start date. Supply to as well.
--tostringInclusive end date. Supply from as well.
--comparestringComparison range.

Values: previous_period, mom, qoq, yoy, none.

Default: previous_period.

--modelstringHow recorded sources share revenue credit.

Values: first_touch, last_touch, linear, time_decay.

Default: first_touch.

--filtersstringJSON array string of up to twenty visitor filters, for example [{"dim":"country","op":"is","value":"US"}]. Dimensions: source, channel, campaign, entry_page, page, hostname, country, device, browser, os, goal. Operators: is, is_not. Values are exact strings up to 500 characters. All filters must match the visitor across available history; report dates then select activity for that cohort. Unmatched payments are excluded. Crawler counts remain website-wide; spend requires every filter to be source/channel/campaign. Preserve filters when paging.
--jsonbooleanCompact JSON instead of formatted JSON.
--csvbooleanCSV for the main row collection; nested values remain JSON cells. Cannot be combined with --json.
--granularitystringRequested bucket size.

Values: daily, weekly, monthly, quarterly.

Default: daily.

--limitintegerMaximum rows where supported.

Default: 50.

--cursorstringA returned next_cursor. Keep the same website, report, dates, model, visitor filters and funnel selection.
--funnelstringOmit for standard stages; saved lists definitions; a saved funnel UUID reads its exact ordered results.

Money stays in integer cents in the website currency. The dedicated realtime command always reads a five-minute window. It does not take a historical date selection.

Output, pagination and shell examples

The CLI prints the API’s data directly, without the REST status/data envelope. sites script prints only the snippet unless you select JSON or CSV. Errors go to stderr with an Attriboo: prefix; check the exit code before consuming stdout.

CSV selects the main returned row collection. Nested values remain JSON cells; text that could be interpreted as spreadsheet formulas is escaped. Empty row collections produce empty CSV. Pagination is manual: CSV contains only the returned page.

Export one source page as CSV
attriboo reports sources --site shop.example.com --period 30d --csv > sources.csv
Continue a sales report using a returned cursor
attriboo reports sales --site shop.example.com --from 2026-10-01 --to 2026-10-07 --compare none --limit 50 --json
attriboo reports sales --site shop.example.com --from 2026-10-01 --to 2026-10-07 --compare none --limit 50 --cursor NEXT_CURSOR --json

Replace NEXT_CURSOR with the response’s value. Preserve the report, site, dates, model and funnel selector. Some small-site reports omit a cursor; that does not guarantee every stored record was exported. Detailed and breakdown cursors expire after 24 hours, and live continuation pages preserve the original window.

Examples use ordinary shell syntax. For Bash, check $?; in PowerShell, check $LASTEXITCODE. Follow your shell’s encoding rules when saving CSV.

Environment and saved credentials

Environment variableBehavior
ATTRIBOO_API_KEYPrivate workspace key. Takes precedence over saved OAuth credentials; can read reports but cannot authorize website setup.
ATTRIBOO_URLService origin. Defaults to https://www.attriboo.com. Only HTTPS or loopback HTTP is accepted; no path, query, fragment or embedded credentials.
ATTRIBOO_CONFIG_DIRPrivate alternative directory containing credentials.json.
LOCALAPPDATAWindows default credentials directory: %LOCALAPPDATA%/Attriboo/credentials.json; falls back to the user home when unavailable.
XDG_CONFIG_HOMENon-Windows default credentials directory: $XDG_CONFIG_HOME/attriboo/credentials.json; otherwise ~/.config/attriboo/credentials.json.

Credentials are kept under your user profile, never in the website project. POSIX files use 0600 permissions and the created folder uses 0700; Windows inherits the user profile’s permissions. Do not commit or share the credentials file.

The CLI refreshes expiring OAuth tokens and stores the replacement. Saved credentials are not sent to a different service origin. Authentication requests do not follow redirects.

attriboo logout revokes the saved refresh-token session and removes the credentials file. If revocation fails, it retains the file so you can retry. It does not remove or rotate a separate environment key.

Exit codes and troubleshooting

CodeMeaning
0Command completed. Read the result to confirm the intended outcome.
1Invalid command/input, authentication failure, permission error or request failure.
2sites verify returned waiting or paused. Tracking verification is pending.

For unknown commands, run attriboo --help. For an expired or revoked grant, run login again. For setup permission failures, approve setup with the current workspace owner/admin and check for an environment key overriding OAuth.

Reports share the API’s 120-requests-per-minute-per-credential-per-instance limit. The CLI does not promise automatic retry for rate or capacity errors. Retry reads with bounded backoff or shorten the date range; never replace a failed report with zeros.