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#

CommandDescription
loginInteractive sign-in: explains the token kinds and stores the one you paste.
auth setSave a credential (--app, --token; also reads stdin or CASHSDK_TOKEN).
auth statusShow saved credentials, masked, with their kind and age.
auth clearRemove saved credentials (all, or one app's with --app).
whoamiWhich credential this invocation resolves to, verified against the API.
doctorReachability, credential validity, app and checklist in one pass.
setup guideWhat is done, what is next, and the exact command for each step.
setup runEvery deterministic setup step in one idempotent pass.
setup statusThe live checklist, computed from observed state (alias: checklist).
setup verifyCheck completion; --wait watches and prints each item as it passes.
snippetsCompilable iOS or Android integration snippets (--platform).
catalogProducts and entitlements, with each product's mapping.
catalog syncImport the catalog from the store (--store, --dry-run).
catalog pushPush local catalog changes to the store (--products to limit).
codegenTyped catalog constants (--lang swift|kotlin|typescript, --out).
paywalls / templatesList paywalls and the public template gallery.
appsList workspace apps (MCP token + --workspace) or show the configured app.
eventsRecent SDK and server events (--limit, --follow).
transactionsRecent store transactions (--limit).
connectMCP config for claude, cursor (--write), or codex.

Exit codes#

CodeMeaning
0Success.
1A gate failed (checklist --require-complete on an incomplete app).
2Usage error: unknown command or flag, bad value.
3Authentication: missing, expired, revoked, or a refused secret key.
4The API answered with an error.
5Blocked on a step only a human can do (credentials, console paste, device purchase).
6Finished, 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#

bash
# 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
bash
cashsdk auth set --app app_... --token csk_st_...
cashsdk whoami
cashsdk doctor
bash
cashsdk catalog sync --dry-run     # review the diff first
cashsdk catalog sync               # then apply it
cashsdk catalog                    # products, entitlements, mappings
bash
# 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
bash
cashsdk events --limit 50 --follow
cashsdk transactions --limit 20
bash
# 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
bash
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

Next steps#