Your affiliate program, run by an AI agent.
Give Claude, Cursor, or any agent with a shell one secret key. It approves partners, answers revenue questions, builds launch links and reconciles commissions — and anything destructive stays locked until you type ‑‑yes.
npm i -g trackrev && export TRACKREV_KEY=lk_live_…- Any agent with a shell
- One revocable key
- Zero dependencies
Which channel actually made us money last week?
$ trackrev channels --days 7 --ltv --json4 channels · 2,143 clicks · $5,812.50 attributed
Newsletter: $1,890 from 310 clicks, against YouTube's $2,410 from 1,204 — six times the revenue per click. Want me to weight the next campaign that way?
Connect an agent
Live in two minutes.
Nothing to install on our side, nothing to approve. Put the CLI where the agent runs, hand it a key, and it has your reach — same workspace, same plan limits, same audit trail.
- TRACKREV_KEY in the environment — no config files, no OAuth
- One labelled key per agent, revoked in one command
- TRACKREV_API_URL points it at staging first
# 1. The binary (Node 20+, zero dependencies)npm install -g trackrev # 2. A key of its own — the plaintext prints once, to stdout onlytrackrev keys create --scope secret --label 'agent' > agent.key # 3. Hand it overexport TRACKREV_KEY=$(cat agent.key) # 4. Let it introduce itselftrackrev me --jsonOpen Settings → Developers to mint the first key by hand · package on npm
Listed because they can run a shell command — there is nothing of ours to install. No shell? The same surface is plain HTTPS at /api/v1. No MCP server yet — the FAQ says why.
One key. The whole program.
Everything the dashboard does, as 63 commands — same limits, same attribution model, same audit trail.
Partners & programs
9 commandsWork the application queue, move affiliates between tiers, rewrite a program's rate and cookie window.
- $ trackrev partners list --status pending --json
- $ trackrev programs update prg_41 --rate 0.25
Commissions & payouts
5 commandsRead the ledger, record off-platform deals, void mistakes, settle payouts sent over PayPal or Wise.
- $ trackrev commissions list --status pending --json
- $ trackrev payouts list --status pending
Attribution & analytics
4 commandsRevenue per channel, per link, per click, per visitor.
- $ trackrev channels --days 30 --ltv --json
Campaign links
7 commandsLaunch links with expiry, passwords, QR — 500 at a time from CSV.
- $ trackrev links create --url … --channel youtube
Revenue sync
5 commandsConnect Polar, Paddle, Lemon Squeezy & co. Pull charges on demand.
- $ trackrev revenue sync --json
Visitors & orders
4 commandsLook anyone up by email; export any dataset as CSV.
- $ trackrev visitors list --email @acme.com
Workspace setup
7 commandsThe attribution model, the lookback window, the folders.
- $ trackrev attribution set --model linear
Domains & pixels
7 commandsBranded short domains, DNS checks, retargeting pixels.
- $ trackrev domains verify go.acme.com
Keys & webhooks
8 commandsMint and revoke keys; point events at your stack.
- $ trackrev keys create --scope secret
Email & branding
4 commandsTransactional emails on or off; partner-facing branding.
- $ trackrev settings notify affiliate.approved --off
Orientation
3 commandsThe first call: which workspace, which plan, which key.
- $ trackrev me --json
Typing them yourself? The CLI page covers the same commands for humans.
Plain English in. Commands out.
No prompt pack to install — the agent reads trackrev --help and lands here.
“Where should next quarter's budget go?”
$ trackrev channels --days 90 --ltv --json
“Approve the affiliates who already sent traffic.”
$ trackrev partners list --status pending --json$ trackrev partners approve ptr_8fd2 --program prg_41
“Why was this sale credited to email?”
$ trackrev visitors list --email sara@acme.io --json$ trackrev journey 3f1b8c22-… --json
“One launch link per channel, expiring Dec 31.”
$ trackrev links create --url https://acme.com/launch --name Launch \--channel youtube --channel newsletter --expires 2026-12-31T23:59:59Z
“What do we owe partners right now?”
$ trackrev commissions list --status eligible --json
“Export the quarter's orders for finance.”
$ trackrev export --kind orders --days 90 --out q3-orders.csv
Destructive commands wait for a human.
Delete, revoke, ban, void, mark-paid — 11 of the 63 commands demand a confirmation an agent can't give. No terminal to answer on means exit 2 and nothing happens. Typing ‑‑yes stays your job.
- No TTY and no ‑‑yes → refused, every time
- Exit 2 is the same code as a typo — retry loops die here
- Enforced by the binary, not by a system prompt
$ trackrev links delete lnk_3b91$ trackrev links delete lnk_3b91 --yes
Deleted lnk_3b91
Four exit codes
0 ok · 1 failed · 2 misused · 3 wrong plan. Agents branch instead of guessing.
stdout is only data
TSV when piped, --json verbatim. Warnings and prompts go to stderr.
Keys you can yank
Scoped, labelled, last-use audited. Revoked in one command, dead instantly.
No payout batches
Fees and payout floors are computed in one place — the dashboard.
No surprise emails
CLI approvals don't email affiliates, so a retry loop can't spam them.
No Stripe access
Your restricted key lives on the workspace, out of the CLI's reach.
Brief it once.
Six rules cover it: where the key lives, how to discover commands, what each exit code means, and where the line is. Paste it into AGENTS.md, CLAUDE.md, or a system prompt — the file name changes, the content doesn't.
- --help over guessed flags
- Exit 2 means re-read, not retry
- --yes, rates and payouts stay human
# TrackRev Our affiliate program and link attribution live inTrackRev. Use the `trackrev` CLI (npm i -g trackrev).The key is in TRACKREV_KEY — never print it. - Run `trackrev --help` for the command list and `trackrev <command> --help` for one command's flags. Never guess a flag.- Always pass --json. stdout is data; warnings and captions go to stderr.- Exit codes: 0 ok · 1 failure · 2 you used it wrong · 3 needs a paid plan. On 2, re-read --help rather than retrying. On 3, stop and tell me.- Open with `trackrev me` to confirm the workspace.- Destructive commands (delete, revoke, ban, void, mark-paid) refuse to run without --yes. Never add --yes yourself. Show me the command and wait.- Money and terms are mine: don't change commission rates, attribution settings or program status without asking first.Runs while you sleep.
Cron it, CI it, or let the agent schedule itself — exit codes make failures loud.
trackrev channels --days 1 --json > /tmp/yesterday.json
trackrev commissions list --status pending --json >> /tmp/yesterday.jsontrackrev partners list --status pending --json \
| jq -e '.partners | length > 0' && echo 'affiliates waiting'trackrev domains verify go.acme.com # exits 1 while pendingtrackrev keys create --scope secret --label 'agent' > agent.key
trackrev keys revoke key_3f19 --yesFrequently asked
What teams ask before giving a model access to the system that decides who gets paid.
Pairs well with
Channel Analytics
Rank every channel by revenue — not clicks — and spot the real winners.
Learn moreVisitor Journey Timeline
Every step from first click to paid customer, stitched into one timeline.
Learn moreAnalytics Breakdown
OS, browser, device, and geo analytics on every click and conversion.
Learn moreGive it a key. Watch it work.
Mint a scoped key, drop it in your agent's environment, and start read-only — trackrev channels --days 7 --json is a fair first task. Revoke the key whenever you like.
MIT licensed · Zero dependencies · Node 20+