codegen keeps app code in sync with your catalog: product and entitlement
ids become typed symbols, so a rename that is not propagated fails to compile
instead of failing silently at runtime.
Commands
Every cashsdk CLI command with examples: guided setup, catalog sync, codegen, snippets, events, and the flags and exit codes they share.
Run any command as cashsdk <command> (Homebrew or global npm install) or
npx cashsdk-cli <command>. Credentials come from cashsdk auth set, or from
CASHSDK_TOKEN / CASHSDK_APP / CASHSDK_API_URL in the environment, or from
the matching --token / --app / --api-url flags. Add --json to any
command for machine-readable output: exactly one JSON document on stdout,
errors on stderr.
Reference#
| Command | Description |
|---|---|
login | Interactive sign-in: explains the token kinds and stores the one you paste. |
auth set | Save a credential (--app, --token; also reads stdin or CASHSDK_TOKEN). |
auth status | Show saved credentials, masked, with their kind and age. |
auth clear | Remove saved credentials (all, or one app's with --app). |
whoami | Which credential this invocation resolves to, verified against the API. |
doctor | Reachability, credential validity, app and checklist in one pass. |
setup guide | What is done, what is next, and the exact command for each step. |
setup run | Every deterministic setup step in one idempotent pass. |
setup status | The live checklist, computed from observed state (alias: checklist). |
setup verify | Check completion; --wait watches and prints each item as it passes. |
snippets | Compilable iOS or Android integration snippets (--platform). |
catalog | Products and entitlements, with each product's mapping. |
catalog sync | Import the catalog from the store (--store, --dry-run). |
catalog push | Push local catalog changes to the store (--products to limit). |
codegen | Typed catalog constants (--lang swift|kotlin|typescript, --out). |
paywalls / templates | List paywalls and the public template gallery. |
apps | List workspace apps (MCP token + --workspace) or show the configured app. |
events | Recent SDK and server events (--limit, --follow). |
transactions | Recent store transactions (--limit). |
connect | MCP config for claude, cursor (--write), or codex. |
Exit codes#
| Code | Meaning |
|---|---|
0 | Success. |
1 | A gate failed (checklist --require-complete on an incomplete app). |
2 | Usage error: unknown command or flag, bad value. |
3 | Authentication: missing, expired, revoked, or a refused secret key. |
4 | The API answered with an error. |
5 | Blocked on a step only a human can do (credentials, console paste, device purchase). |
6 | Finished, but some items need attention (for example unmapped products). |
Exit 5 is not a failure: the command's output says exactly what to do and
re-running after doing it is always safe.
Examples#
# One idempotent pass over everything deterministic
cashsdk setup run --map-all pro
# Map specific products to tiers instead
cashsdk setup run --map pro.monthly=pro --map pro.annual=pro
# Watch the checklist until the test purchase lands
cashsdk setup verify --wait --timeout 30m
cashsdk auth set --app app_... --token csk_st_...
cashsdk whoami
cashsdk doctor
cashsdk catalog sync --dry-run # review the diff first
cashsdk catalog sync # then apply it
cashsdk catalog # products, entitlements, mappings
# Typed constants, written into your project
cashsdk codegen --lang swift --out Sources/App/Catalog.swift
cashsdk codegen --lang kotlin --out app/src/main/java/Catalog.kt
cashsdk events --limit 50 --follow
cashsdk transactions --limit 20
# Fail the pipeline until the app is fully set up
cashsdk checklist --require-complete
# CI auth: set CASHSDK_TOKEN (an MCP token) and CASHSDK_APP in the environment
cashsdk connect claude # prints the claude mcp add one-liner
cashsdk connect cursor --write # writes .cursor/mcp.json
cashsdk connect codex # prints the config.toml block
cashsdk auth set stores the token once with 0600 permissions, so it never
has to appear on a command line, in shell history, or in a process list.