CLI reference
Every ccat command. Add --json to any of them for machine output.
Setup
ccat init [--name n] [--api url] [--force] [--no-skills] | Register the project and write the files. With a key already in .env.local it reuses it; --force registers a new project. |
ccat skills install | Copy the agent skill into .claude/skills/. |
Experiments
ccat experiment create --page /p --variants a,b,c --goal g [--id x] [--segment source,device,country,visitor] [--mode header] | Create a test. The id defaults to the page name. --segment lets the router learn per segment. --mode header sends the variant as a request header instead of rewriting to a copy of the page. |
ccat variants scaffold [--exp id] [--force] | Copy the control page into app/%5Fv/<variant>/... with relative imports fixed. |
ccat promote <variant> [--exp id] | Every visitor gets that variant. The proxy picks it up within 30 s. |
ccat stop | resume [--exp id] | Stop serves the control to everyone; resume restarts learning. |
Goals
--goal /thanks | The visitor reaches that path after seeing the page. Counted by the proxy. |
--goal signup | A server event. Call trackConversion("signup") from lib/ccat.ts, or ccat track signup --vid <id>. |
--goal onchain:transfer:<token>[:min] | A linked wallet receives the token on Robinhood Chain. |
--goal onchain:call:<contract> | A linked wallet sends a transaction that makes the contract emit a log. |
--goal onchain:hold:<token>[:min] | A linked wallet holds at least min of the token. |
ccat track wallet <0x...> --vid <id> links a visitor to a wallet by hand; ccat index runs an onchain pass now.
Reading results
$ ccat results pricing --json
{
"experiment": "pricing",
"variants": [
{ "variant": "a", "control": true, "visitors": 1204, "conversions": 38, "rate": 0.0316, "p_best": 0.004, "traffic_share": 0.02 },
{ "variant": "b", "visitors": 2911, "conversions": 131, "rate": 0.045, "p_best": 0.971,
"p_beat_control": 0.993, "uplift": 0.424, "uplift_95": [0.061, 0.89], "traffic_share": 0.96 }
]
}ccat status prints one line per experiment. ccat attribution --by source|medium|campaign|referrer|click [--model first|last] [--exp id] prints visitors and conversions per channel.
Billing
ccat billing shows decisions used this month. ccat pay [--usdg n] prints the x402 requirements; ccat pay --tx <hash> credits a USDG transfer. See Pricing and x402.
Environment
CCAT_KEY | Project key, from .env.local or the environment. Secret. |
CCAT_API | API address. Defaults to this site. |
NO_COLOR | Plain output. |