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

Homebrew (macOS/Linux)

brew tap armitage-labs/creem
brew install creem
Verify installation:
creem --version

Authentication

# Login with your API key
creem login --api-key creem_test_YOUR_KEY_HERE

# Verify authentication
creem whoami

# Logout
creem logout
API Key Security: Never share your API key with any service, tool, or agent other than the Creem CLI or API. Keys are stored locally at ~/.creem/config.json.

Test vs Live Mode

The CLI automatically detects your environment based on the API key prefix:
Key PrefixEnvironmentAPI Base
creem_test_Test (sandbox)https://test-api.creem.io
creem_Live (production)https://api.creem.io
Always start in test mode. Switch to live only when you’re ready for real transactions.

Command Reference

Products

# List all products
creem products list

# List with pagination
creem products list --page 2 --limit 10

# Get a specific product
creem products get prod_XXXXX

# Create a product
creem products create \
  --name "Pro Plan" \
  --description "Monthly pro subscription with all features" \
  --price 1999 \
  --currency USD \
  --billing-type recurring \
  --billing-period every-month
Product Options:
OptionValues
--billing-typeonetime, recurring
--billing-periodevery-month, every-three-months, every-six-months, every-year
--tax-categorysaas, digital-goods-service, ebooks
--tax-modeinclusive, exclusive

Customers

# List all customers
creem customers list

# Get customer by ID
creem customers get cust_XXXXX

# Get customer by email
creem customers get --email user@example.com

# Generate billing portal link (self-service for payment methods, invoices)
creem customers billing cust_XXXXX

Subscriptions

# List all subscriptions
creem subscriptions list

# Filter by status
creem subscriptions list --status active

# Get subscription details
creem subscriptions get sub_XXXXX

# Cancel immediately
creem subscriptions cancel sub_XXXXX

# Cancel at period end (customer keeps access until billing period ends)
creem subscriptions cancel sub_XXXXX --mode scheduled

# Pause billing
creem subscriptions pause sub_XXXXX

# Resume billing
creem subscriptions resume sub_XXXXX
Subscription Statuses: active, trialing, paused, past_due, expired, canceled, scheduled_cancel
Best Practice: Use --mode scheduled for cancellations. Immediate cancellation cuts off access instantly, which frustrates customers.

Checkouts

# Create a checkout session
creem checkouts create --product prod_XXXXX

# Create with success URL
creem checkouts create --product prod_XXXXX --success-url https://app.com/welcome

# Get checkout details
creem checkouts get chk_XXXXX

Transactions

# List all transactions (newest first)
creem transactions list

# List with more results
creem transactions list --limit 50

# Filter by customer
creem transactions list --customer cust_XXXXX

# Filter by product
creem transactions list --product prod_XXXXX

# Get transaction details
creem transactions get txn_XXXXX

Configuration

# View all settings
creem config show

# Switch to live mode
creem config set environment live

# Switch to test mode
creem config set environment test

# Set default output format
creem config set output_format json
creem config set output_format table

# Get a specific setting
creem config get environment

# List all config keys
creem config list

Interactive Mode

Run a resource command without a subcommand to launch an interactive browser:
creem products
creem customers
creem subscriptions
creem transactions
Keys:
  • Arrow keys to navigate
  • Enter to view details
  • : to open the command bar
  • q to exit

Output Formats

Every command supports table (default) and JSON output:
# Per-command JSON output
creem products list --json
creem customers get cust_XXXXX --json

# Set JSON as global default
creem config set output_format json
For AI Agents: Always use --json and parse with jq for reliable automation:
creem products list --json | jq '.[].id'
creem customers get cust_XXXXX --json | jq '.email'
creem subscriptions list --status active --json | jq 'length'

Automation Examples

Check for new transactions

# Get the latest transaction ID
LATEST=$(creem transactions list --limit 1 --json | jq -r '.[0].id')
echo "Latest transaction: $LATEST"

Count active subscriptions

ACTIVE=$(creem subscriptions list --status active --json | jq 'length')
echo "Active subscriptions: $ACTIVE"

Check for payment issues

PAST_DUE=$(creem subscriptions list --status past_due --json | jq 'length')
EXPIRED=$(creem subscriptions list --status expired --json | jq 'length')

if [ "$PAST_DUE" -gt 0 ] || [ "$EXPIRED" -gt 0 ]; then
  echo "⚠️ Alert: $PAST_DUE past_due, $EXPIRED expired subscriptions"
fi
for PRODUCT_ID in prod_AAA prod_BBB prod_CCC; do
  URL=$(creem checkouts create --product "$PRODUCT_ID" --json | jq -r '.checkout_url')
  echo "$PRODUCT_ID: $URL"
done

Daily subscription health check

#!/bin/bash
# Run daily via cron to monitor subscription health

echo "πŸ“Š Subscription Report - $(date)"
echo "================================"
echo "Active: $(creem subscriptions list --status active --json | jq 'length')"
echo "Trialing: $(creem subscriptions list --status trialing --json | jq 'length')"
echo "Past Due: $(creem subscriptions list --status past_due --json | jq 'length')"
echo "Expired: $(creem subscriptions list --status expired --json | jq 'length')"
echo "Canceled: $(creem subscriptions list --status canceled --json | jq 'length')"

Tips for AI Agents

Use JSON Output

Always add --json to commands when processing output programmatically. Parse with jq for reliable automation.

Test Mode First

Mistakes in live mode affect real customers and money. Always develop against test mode.

Check whoami First

Run creem whoami before operations to confirm authentication and environment.

Don't Guess IDs

List resources first, then use actual IDs from the response. Don’t assume ID formats.

Going Live

Before accepting real payments:
  1. Complete account verification in the Dashboard β†’ Balances β†’ Payout Account
  2. Switch to your live API key:
creem login --api-key creem_LIVE_KEY_HERE
The CLI automatically switches to the production API based on the key prefix.

Next Steps