TrackRev
TrackRev for AI agents

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
your agent · trackrev
shell access

Which channel actually made us money last week?

ran
$ trackrev channels --days 7 --ltv --json

4 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?

63
Commands
11
Locked behind --yes
4
Exit codes
0
Dependencies

Connect an agent

Setup

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
wherever your agent runs
bash
# 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 --json

Open Settings → Developers to mint the first key by hand · package on npm

Claude CodeCodexCursorWindsurfCopilot CLIGemini CLIYour own loop

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.

Coverage

One key. The whole program.

Everything the dashboard does, as 63 commands — same limits, same attribution model, same audit trail.

Partners & programs

9 commands

Work 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 commands

Read 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 commands

Revenue per channel, per link, per click, per visitor.

  • $ trackrev channels --days 30 --ltv --json

Campaign links

7 commands

Launch links with expiry, passwords, QR — 500 at a time from CSV.

  • $ trackrev links create --url … --channel youtube

Revenue sync

5 commands

Connect Polar, Paddle, Lemon Squeezy & co. Pull charges on demand.

  • $ trackrev revenue sync --json

Visitors & orders

4 commands

Look anyone up by email; export any dataset as CSV.

  • $ trackrev visitors list --email @acme.com

Workspace setup

7 commands

The attribution model, the lookback window, the folders.

  • $ trackrev attribution set --model linear

Domains & pixels

7 commands

Branded short domains, DNS checks, retargeting pixels.

  • $ trackrev domains verify go.acme.com

Keys & webhooks

8 commands

Mint and revoke keys; point events at your stack.

  • $ trackrev keys create --scope secret

Email & branding

4 commands

Transactional emails on or off; partner-facing branding.

  • $ trackrev settings notify affiliate.approved --off

Orientation

3 commands

The first call: which workspace, which plan, which key.

  • $ trackrev me --json

Typing them yourself? The CLI page covers the same commands for humans.

In practice

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
Guardrails

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

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.

The brief

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
AGENTS.md
markdown
# 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.
Unattended

Runs while you sleep.

Cron it, CI it, or let the agent schedule itself — exit codes make failures loud.

Morning numbers, ready to summarise
bash
trackrev channels --days 1 --json > /tmp/yesterday.json
trackrev commissions list --status pending --json >> /tmp/yesterday.json
Flag waiting affiliates once a day
bash
trackrev partners list --status pending --json \
  | jq -e '.partners | length > 0' && echo 'affiliates waiting'
Gate the deploy on DNS
bash
trackrev domains verify go.acme.com   # exits 1 while pending
Give it a key, then take it back
bash
trackrev keys create --scope secret --label 'agent' > agent.key
trackrev keys revoke key_3f19 --yes
Questions, answered

Frequently asked

What teams ask before giving a model access to the system that decides who gets paid.

Not yet, and we'd rather say so than imply otherwise. Any agent that can run a shell command already has the full surface: trackrev --help to discover it, --json for structured output, nothing to host. If MCP is a hard requirement for you, tell us — the registry the CLI is generated from is exactly what a server would be generated from.

Give 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+

Run Your Affiliate Program With an AI Agent — TrackRev for Agents