CLI

Manage CashSDK from your terminal — model catalog, inspect setup, tail events, and scaffold code.

The CashSDK CLI (@cashsdk/cli) brings the platform to your terminal. Use it to authenticate, model your catalog, check your go-live status, diagnose problems, and pull integration snippets — everything you'd otherwise do in the dashboard, scriptable and CI-friendly.

Install#

bash
npm i -g @cashsdk/cli
bash
npx @cashsdk/cli <command>

The binary is cashsdk. Once installed globally, run cashsdk <command>; otherwise prefix with npx @cashsdk/cli.

Authenticate#

The CLI needs a secret key (csk_sk_…) or setup token (csk_st_…) and the URL of your CashSDK API.

bash
cashsdk login
bash
export CASHSDK_TOKEN=csk_sk_...
export CASHSDK_API_URL=https://api.cashsdk.com

cashsdk login walks you through authenticating and stores the credentials locally. Alternatively, set CASHSDK_TOKEN and CASHSDK_API_URL in your environment — ideal for CI. CASHSDK_API_URL defaults to your CashSDK Cloud workspace at https://api.cashsdk.com.

CASHSDK_TOKEN grants API access. Keep it out of version control and scope it to a single app where possible.

What it's for#

  • Model your catalog — create products and entitlements with catalog.
  • Check setup — see live go-live status with checklist, diagnose issues with doctor.
  • Observe — stream recent activity with events.
  • Build — scaffold paywalls with draft, browse templates and paywalls, and pull integration snippets.

Next steps#