Skip to main content
The Creem CLI lets you manage products, customers, subscriptions, and transactions directly from the terminal. It’s designed for both human developers and AI agents building automation workflows.

Installation

Prerequisite: Node.js 22 or newer.
After installing, run creem --version to check your version and creem --help to explore commands. With npx, replace creem with npx @creem_io/cli in the examples below.

Authentication

Run creem login for a masked local prompt. For automation, set CREEM_API_KEY using your CI secret store or shell environment, then run:
Environment keys take precedence over stored credentials and are never written to disk. The key determines test/live mode. --environment test|live must match it. Local login writes ~/.creem/config.json with mode 0600 in a 0700 directory. creem logout clears stored credentials; an environment key remains active.

Configuration

Inspect your saved settings or choose a default output format:
Configuration output redacts the stored API key. Use creem login to change credentials; switching between test and live requires a matching API key. Pass --json or --output table|json|ndjson to override the saved output format for a command.

Interactive browsing

Run a resource command without a subcommand to browse your store:
Search records, open details, and manage subscriptions from the terminal. See the interactive guide for navigation and examples.

Command reference

Use --help on any command to see its accepted flags. credits, cust, subs, and txn are aliases. IDs are positional where shown. Authentication, configuration, and migrate lemon-squeezy are also available.

Request bodies

Every operation with a body supports --data with camelCase field names. Choose body flags or --data; mixing them is rejected. Path IDs and header/query flags remain available with --data.
Repeat --metadata key=value for string metadata (last duplicate wins). Use --data for numeric or nested metadata. Repeat --custom-field, --item, or --recipient with JSON objects, and --image-url with ordered URLs. Credit amounts are strings and retain full precision. Free products accept --price 0. Custom billing accepts --billing-period custom with both recurring interval flags. Use customFields instead of the deprecated customField.

Pagination and automation

Global flags work before or after commands: --json, --output table|json|ndjson, --no-color, --timeout <ms>, --environment, and --yes. The default timeout is 30000 ms. Numbered lists accept --page and --limit; credit lists use --starting-after or --ending-before. --all traverses from the supplied page/cursor. NDJSON streams one item per line without buffering the entire collection.
Single-page JSON returns the result without transport fields. --all --json aggregates results and recomputes totals. The legacy subscription --status filter traverses every page, rejects --page/--limit, and labels the output with filter.scope: "client" and a recomputed totalRecords.

Errors and safety

Result data goes to stdout. JSON errors go to stderr as { "error": { "type", "message", "status", "traceId", "details", "cause", "suggestion", "retryAfter" } }. Exit codes are 0 success, 1 unexpected, 2 usage/validation, 3 auth/config, 4 API response, and 5 network/timeout. A late NDJSON failure can leave earlier records on stdout; always check the exit code. Destructive operations require a TEST/LIVE confirmation in a terminal or --yes in noninteractive/JSON/NDJSON mode. This includes updates, upgrades, refunds, immediate/default cancellation, pause, archive/delete, license deactivation, credit freeze/debit/reverse/close, and posting or reversing credit transactions. Scheduled cancellation does not prompt. No writes are automatically retried; check ambiguous outcomes before retrying manually. Human output masks license keys; successful JSON retains the full response.

Upgrading existing scripts

subscriptions list now lists subscriptions directly instead of deriving them from transactions; the old transaction-derived note field is removed. discounts list now supports search filters and pagination. Scripts invoking destructive actions must supply --yes. See the agent workflow or interactive guide for your preferred interface.