Skip to main content
The trackrev CLI puts your link analytics in the terminal: performance per channel, per link, the raw click stream, and any single visitor’s full journey. It is a thin, zero-dependency client for the Analytics API, so every number matches the dashboard.
The CLI is free and MIT-licensed on npm. Link and account commands work on every plan, including free, and respect the same limits as the dashboard (50 links on the free tier). The analytics commands — channels, links perf, clicks, journey — need a paid plan; on a free workspace they exit 3 with an upgrade message. Requires Node 20 or newer.

Install

Install it once and you get a trackrev command on your PATH:
Check it worked:
Don’t want to install it? npx runs an npm package without installing it — it downloads the CLI into a temporary cache, runs one command, and leaves nothing on your PATH. Useful for a one-off check or a CI step:
Everything below assumes the global install, so commands read trackrev channels. With npx, prefix them: npx trackrev channels.

Authenticate

1

Create a secret key

Go to Settings → Developers and create a secret key (lk_…). See Authentication.
2

Save it

The key is prompted for without echoing, verified against the API before anything is written, and stored at ~/.config/trackrev/config.json with mode 0600. A typo fails here rather than on your next command.In CI, set the environment variable instead — it overrides any saved login:
3

Check what you are pointed at

Prints the workspace, plan, current limits and which key is in use — the first thing to run when a command returns something you did not expect.
The key is sent as a Bearer token over HTTPS. Keep several environments side by side with --profile:

Commands

Generated from apps/cli/src/registry.js — edit there, then run pnpm --filter trackrev sync-docs.

Analytics

trackrev channels

performance per traffic source (paid plan)
conversions is a decimal on purpose — attribution splits credit, so one sale touched by two channels counts 0.5 on each. performance per short link (bare trackrev links still works) (paid plan)

trackrev clicks

the raw click stream — newest first, bots excluded (paid plan)
—all stops after 200 pages and says so on stderr, so a runaway cursor can never loop forever.

trackrev visitors journey <visitor-id>

one visitor’s timeline — every click, identify event and order, in order (paid plan)
The visitor caption goes to stderr, so the rows stay pipe-clean. the links themselves — newest first, no window
create a campaign: one link per channel, or one Smart Link
Prints one row per link created. Channels: facebook instagram youtube linkedin twitter tiktok newsletter website other. one link by id, slug or short code
change a link’s slug, UTMs, expiry, password or targeting
delete one link (its campaign and other channels stay) (asks to confirm; --yes in scripts)
create up to 500 links from a CSV
Optional columns: utm_campaign, utm_term, utm_content, tags, campaign_id. Rows that fail are listed with the reason; the rest are created. the link’s QR code as SVG

Developers

trackrev keys list

the workspace’s API keys (prefixes only)

trackrev keys create

mint a key — the plaintext is shown once, never again
The key goes to stdout and everything else to stderr, so trackrev keys create > key.txt captures only the key.

trackrev keys revoke <id>

revoke a key immediately (asks to confirm; --yes in scripts)

trackrev webhooks list

outbound endpoints, with their last delivery status

trackrev webhooks events

every event an endpoint can subscribe to

trackrev webhooks create

add an endpoint — the signing secret is shown once
https only. Run trackrev webhooks events for the valid names.

trackrev webhooks update <id>

change the URL or events, or pause and resume delivery

trackrev webhooks delete <id>

remove an endpoint (asks to confirm; --yes in scripts)

Setup

trackrev attribution get

the model and lookback window this workspace uses

trackrev attribution set

change the model or the window
Both settings apply retroactively — every past order is re-credited against them.

trackrev folders list

campaign folders, with how many campaigns each holds

trackrev folders create

create a folder to group campaigns under

trackrev folders update <id>

rename a folder or change its dates

trackrev folders delete <id>

delete a folder — its campaigns become ungrouped, not deleted (asks to confirm; --yes in scripts)

trackrev folders assign <destination-id>

file a campaign under a folder, or un-file it
The id is a CAMPAIGN (the destination behind a set of links), not a single link.

Revenue

trackrev revenue list

connected payment providers and their last sync

trackrev revenue providers

what can be connected, and the credentials each needs
Stripe is absent by design — its restricted key lives on the workspace, not here.

trackrev revenue connect

connect a provider — credentials are verified before saving

trackrev revenue sync

pull charges now and attribute them (paid plan)
Reports imported and attributed per provider. A provider that fails does not stop the others.

trackrev revenue disconnect <id>

disconnect a provider; imported orders are kept (asks to confirm; --yes in scripts)

Audience

trackrev visitors list

visitors, most recently seen first (paid plan)

trackrev visitors get <id>

one visitor (paid plan)

trackrev orders list

synced purchases, newest first
amount is blank on the free plan, where revenue figures are hidden.

trackrev export

any dataset as CSV (paid plan)

Domains

trackrev domains list

branded short-link domains and their DNS status

trackrev domains add <domain>

attach a domain — prints the DNS records to add

trackrev domains verify <domain-or-id>

re-check DNS now; exits non-zero until it is active
Exits 1 while still pending, so a deploy script can poll until it passes.

trackrev domains remove <domain-or-id>

detach a domain; links keep working on the default host (asks to confirm; --yes in scripts)

trackrev retargeting list

the ad pixels fired on opted-in link clicks

trackrev retargeting set <provider>

set a provider’s pixel id
The id must match that provider’s shape — only validated ids are ever put into a loader snippet.

trackrev retargeting remove <provider>

remove a provider’s pixel (asks to confirm; --yes in scripts)

Affiliate

trackrev programs list

the workspace’s affiliate programs and their terms

trackrev programs get <id>

one program in full

trackrev programs update <id>

change commission terms, or pause and archive (paid plan)
Changes apply to NEW conversions; commissions already earned are untouched.

trackrev partners list

affiliates with their clicks, sales and earnings (paid plan)

trackrev partners approve <partner-id>

approve a pending affiliate (paid plan)
Does NOT send the approval email the dashboard sends — a re-run would mail them again.

trackrev partners reject <partner-id>

reject an application (paid plan) (asks to confirm; --yes in scripts)

trackrev partners ban <partner-id>

ban an affiliate (paid plan) (asks to confirm; --yes in scripts)

trackrev partners group <partner-id>

move an affiliate into a group, or back to program terms (paid plan)

trackrev groups list <program-id>

a program’s tiers, showing the terms each one resolves to (paid plan)

Money

trackrev commissions list

the commission ledger, newest first (paid plan)
level 1 is the affiliate who sold; 2+ is an upline earning from their network.

trackrev commissions add

record an off-platform deal by hand (paid plan)
Earnings is not derived — a manual commission exists because the normal rate did not apply. It counts toward your monthly commission cap.

trackrev commissions void <id>

void a commission entered in error (paid plan) (asks to confirm; --yes in scripts)
Refused if it is already on a payout batch — cancel the payout first.

trackrev payouts list

payout batches, with open and all-time totals (paid plan)
Creating a batch stays in the dashboard: it applies per-group payout floors and platform fees, and a second implementation would eventually pay someone wrong.

trackrev payouts mark-paid <id>

settle a payout sent off-platform (paid plan) (asks to confirm; --yes in scripts)
Does NOT email the affiliate — the dashboard sends that, and a re-run would send it twice.

Settings

trackrev settings notifications

every transactional email, and whether it is on
default=yes means no override is stored and the catalogue default applies.

trackrev settings notify <key>

turn one transactional email on or off

trackrev settings branding

the white-label settings affiliates see

trackrev settings set-branding

set the partner-facing logo and accent colour
The affiliate subdomain is read-only here — claiming one is a namespace reservation and belongs in one place.

Account

trackrev me

which workspace, plan, limits and key you’re using

trackrev login

save a secret key so you don’t need TRACKREV_KEY
Stored at ~/.config/trackrev/config.json with mode 0600. TRACKREV_KEY in the environment always wins, for CI.

trackrev logout

forget a saved key

Global flags

Reporting window

channels and links accept: --from / --to win over --days.

Output

The same data comes out three ways, so a command works both as something you read and as something you pipe:
Piped output is deliberately unformatted — 2410.5, not 2,410.50 — so cut and awk see real numbers. Warnings, errors and the journey caption always go to stderr, never into your pipe.

Recipes

Exit codes

A 401 names where the key came from; a 402 exits 3 with the upgrade link, so CI can tell “wrong plan” apart from “the call broke”; an unknown flag is a one-line usage error rather than a stack trace.

All flags

The tables above are generated from the CLI’s own command registry, so they list every flag the binary accepts. trackrev --help prints the same set, and trackrev <command> --help narrows it to one command.