creem-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Creem CLI

Creem CLI

creem
is the official Creem command-line interface for managing products, customers, checkouts, subscriptions, transactions, and CLI configuration from the terminal.
Use this skill when the user wants to operate Creem from a terminal or through an AI agent. Prefer the CLI over dashboard instructions when the task is supported directly by
creem
.
creem
是Creem官方的命令行界面,用于从终端管理产品、客户、结账、订阅、交易以及CLI配置。
当用户希望从终端或通过AI Agent操作Creem时,使用此技能。如果任务可直接通过
creem
完成,优先使用CLI而非仪表盘操作指南。

Prerequisites

前提条件

  • The
    creem
    CLI must already be installed.
  • The user must already be authenticated before agent-driven work starts.
  • Start in test mode unless the user explicitly asks to use live mode.
  • Confirm the current session with:
bash
creem whoami --json
  • 必须已安装
    creem
    CLI。
  • 在Agent驱动的任务开始前,用户必须已完成身份验证。
  • 除非用户明确要求使用生产模式,否则默认使用测试模式。
  • 使用以下命令确认当前会话:
bash
creem whoami --json

Secret Safety

密钥安全注意事项

  • Never read, print, summarize, upload, or parse
    ~/.creem/config.json
    .
  • Never ask the user to paste API keys into chat.
  • Never run
    creem login --api-key ...
    inside an agent or LLM session.
  • If authentication is missing, tell the user to authenticate manually outside the session, then continue with
    creem whoami --json
    .
  • Never switch to live mode unless the user explicitly asks for production operations.
  • 切勿读取、打印、总结、上传或解析
    ~/.creem/config.json
    文件。
  • 切勿要求用户在聊天中粘贴API密钥。
  • 切勿在Agent或LLM会话中运行
    creem login --api-key ...
    命令。
  • 如果未完成身份验证,请告知用户在会话外手动完成身份验证,然后使用
    creem whoami --json
    继续。
  • 除非用户明确要求进行生产环境操作,否则切勿切换到生产模式。

Agent Rules

Agent操作规则

  • Prefer
    --json
    on every command so outputs are machine-readable.
  • Run
    creem whoami --json
    before mutating operations.
  • List or inspect resources before mutating them. Do not guess IDs.
  • Do not use the interactive browser mode (
    creem products
    ,
    creem customers
    , etc.) in agent sessions.
  • Do not change the global CLI output format unless the user explicitly asks. Use per-command
    --json
    instead.
  • For cancellations, recommend
    --mode scheduled
    unless the user explicitly wants immediate access removal.
  • Treat CLI money amounts as minor units, not major units. For EUR and USD,
    500
    means
    5.00
    , not
    500.00
    .
  • When summarizing prices or transactions for humans, convert minor units into a decimal amount with currency. Do not repeat raw CLI numbers as if they were full euros or dollars.
  • For
    --success-url
    , use
    http://
    (not
    https://
    ) when pointing to localhost. Local dev servers don't serve TLS, so
    https://localhost
    causes
    ERR_SSL_PROTOCOL_ERROR
    .
  • 所有命令优先使用
    --json
    参数,以便输出为机器可读格式。
  • 在执行修改类操作前,先运行
    creem whoami --json
  • 在修改资源前,先列出或检查资源。切勿猜测ID。
  • 在Agent会话中,请勿使用交互式浏览器模式(如
    creem products
    creem customers
    等)。
  • 除非用户明确要求,否则请勿修改全局CLI输出格式。应使用单命令的
    --json
    参数替代。
  • 对于取消操作,推荐使用
    --mode scheduled
    参数,除非用户明确要求立即移除访问权限。
  • CLI中的金额为最小单位,而非主单位。对于欧元(EUR)和美元(USD),
    500
    代表
    5.00
    ,而非
    500.00
  • 当向用户总结价格或交易时,将最小单位转换为带货币的小数金额。切勿直接将原始CLI数字当作完整的欧元或美元金额告知用户。
  • 设置
    --success-url
    时,指向localhost请使用
    http://
    而非
    https://
    。本地开发服务器不支持TLS,使用
    https://localhost
    会导致
    ERR_SSL_PROTOCOL_ERROR
    错误。

Money Amounts

金额说明

Creem CLI prices and transaction amounts are returned in minor units.
  • --price 1999
    means
    19.99
    , not
    1999.00
    .
  • 500 EUR
    from the CLI means
    5.00 EUR
    , not
    500.00 EUR
    .
  • If you are explaining a transaction to the user, present both forms when helpful: raw CLI value plus human value.
Example:
text
tran_6QWuvWPj9s9twH6vvdpOI8 | paid | 500 EUR
Interpret that as:
text
paid transaction for 5.00 EUR (CLI raw amount: 500 minor units)
Creem CLI返回的价格和交易金额均为最小单位。
  • --price 1999
    代表
    19.99
    ,而非
    1999.00
  • CLI返回的
    500 EUR
    代表
    5.00 EUR
    ,而非
    500.00 EUR
  • 当向用户解释交易时,如有帮助可同时呈现两种格式:原始CLI值和便于人类阅读的金额。
示例:
text
tran_6QWuvWPj9s9twH6vvdpOI8 | paid | 500 EUR
应解释为:
text
已支付交易,金额为5.00 EUR(CLI原始金额:500最小单位)

Quick Reference

快速参考

ActionCommand
Check auth and environment
creem whoami --json
Show config
creem config show --json
List config keys
creem config list --json
List products
creem products list --json
Get product
creem products get prod_XXXXX --json
Create 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 --json
List customers
creem customers list --json
Get customer by ID
creem customers get cust_XXXXX --json
Get customer by email
creem customers get --email user@example.com --json
Billing portal link
creem customers billing cust_XXXXX --json
Create checkout
creem checkouts create --product prod_XXXXX --success-url http://localhost:3000/success --json
Get checkout
creem checkouts get chk_XXXXX --json
List subscriptions
creem subscriptions list --json
Filter subscriptions
creem subscriptions list --status active --json
Get subscription
creem subscriptions get sub_XXXXX --json
Pause subscription
creem subscriptions pause sub_XXXXX --json
Resume subscription
creem subscriptions resume sub_XXXXX --json
Cancel subscription safely
creem subscriptions cancel sub_XXXXX --mode scheduled --json
List transactions
creem transactions list --limit 50 --json
Get transaction
creem transactions get txn_XXXXX --json
操作命令
检查身份验证和环境
creem whoami --json
查看配置
creem config show --json
列出配置键
creem config list --json
列出产品
creem products list --json
获取产品详情
creem products get prod_XXXXX --json
创建产品
creem products create --name "Pro Plan" --description "Monthly pro subscription with all features" --price 1999 --currency USD --billing-type recurring --billing-period every-month --json
列出客户
creem customers list --json
通过ID获取客户详情
creem customers get cust_XXXXX --json
通过邮箱获取客户详情
creem customers get --email user@example.com --json
获取账单门户链接
creem customers billing cust_XXXXX --json
创建结账链接
creem checkouts create --product prod_XXXXX --success-url http://localhost:3000/success --json
获取结账详情
creem checkouts get chk_XXXXX --json
列出订阅
creem subscriptions list --json
筛选订阅
creem subscriptions list --status active --json
获取订阅详情
creem subscriptions get sub_XXXXX --json
暂停订阅
creem subscriptions pause sub_XXXXX --json
恢复订阅
creem subscriptions resume sub_XXXXX --json
安全取消订阅
creem subscriptions cancel sub_XXXXX --mode scheduled --json
列出交易
creem transactions list --limit 50 --json
获取交易详情
creem transactions get txn_XXXXX --json

High-Value Workflows

高价值工作流

Create a checkout and verify it

创建结账链接并验证

bash
creem whoami --json
creem checkouts create --product prod_XXXXX --success-url http://localhost:3000/success --json
creem transactions list --limit 10 --json
creem subscriptions list --limit 10 --json
Use this flow when the user wants to create a payment link, inspect the returned checkout, then verify whether the resulting transaction or subscription exists.
When reading the returned amounts, convert minor units before explaining totals to the user.
bash
creem whoami --json
creem checkouts create --product prod_XXXXX --success-url http://localhost:3000/success --json
creem transactions list --limit 10 --json
creem subscriptions list --limit 10 --json
当用户希望创建支付链接、检查返回的结账信息,然后验证生成的交易或订阅是否存在时,使用此流程。
读取返回的金额时,需先将最小单位转换为便于理解的金额,再向用户说明总计。

Create and inspect products

创建并检查产品

bash
creem whoami --json
creem products create --name "Template Pack" --description "50 premium templates" --price 4999 --currency USD --billing-type onetime --tax-mode exclusive --tax-category digital-goods-service --json
creem products list --json
creem products get prod_XXXXX --json
bash
creem whoami --json
creem products create --name "Template Pack" --description "50 premium templates" --price 4999 --currency USD --billing-type onetime --tax-mode exclusive --tax-category digital-goods-service --json
creem products list --json
creem products get prod_XXXXX --json

Look up customers and open the billing portal

查询客户并打开账单门户

bash
creem customers list --json
creem customers get --email user@example.com --json
creem customers billing cust_XXXXX --json
Use customer lookup before subscription or transaction investigations so the next commands use real IDs.
bash
creem customers list --json
creem customers get --email user@example.com --json
creem customers billing cust_XXXXX --json
在调查订阅或交易前,先查询客户,以便后续命令使用真实ID。

Pause, resume, or cancel subscriptions

暂停、恢复或取消订阅

bash
creem subscriptions list --status active --json
creem subscriptions pause sub_XXXXX --json
creem subscriptions resume sub_XXXXX --json
creem subscriptions cancel sub_XXXXX --mode scheduled --json
Prefer
--mode scheduled
for cancellation unless the user explicitly asks for immediate removal of access.
bash
creem subscriptions list --status active --json
creem subscriptions pause sub_XXXXX --json
creem subscriptions resume sub_XXXXX --json
creem subscriptions cancel sub_XXXXX --mode scheduled --json
除非用户明确要求立即移除访问权限,否则取消订阅优先使用
--mode scheduled
参数。

Review transactions and subscription health

查看交易和订阅健康状态

bash
creem transactions list --limit 20 --json
creem subscriptions list --status active --json
creem subscriptions list --status paused --json
creem subscriptions list --status canceled --json
creem subscriptions list --status scheduled_cancel --json
For scripted monitoring, parse JSON with
jq
instead of relying on table output.
bash
creem transactions list --limit 20 --json
creem subscriptions list --status active --json
creem subscriptions list --status paused --json
creem subscriptions list --status canceled --json
creem subscriptions list --status scheduled_cancel --json
对于脚本化监控,使用
jq
解析JSON而非依赖表格输出。

Inspect or change CLI configuration only when requested

仅在用户要求时检查或修改CLI配置

bash
creem config show --json
creem config get environment --json
creem config set environment test
Do not change
environment
or
output_format
unless the user explicitly asks.
bash
creem config show --json
creem config get environment --json
creem config set environment test
除非用户明确要求,否则请勿修改
environment
output_format

Automation Patterns

自动化模式

bash
undefined
bash
undefined

Latest transaction ID

获取最新交易ID

creem transactions list --limit 1 --json | jq -r '.[0].id'
creem transactions list --limit 1 --json | jq -r '.[0].id'

Count active subscriptions

统计活跃订阅数量

creem subscriptions list --status active --json | jq 'length'
creem subscriptions list --status active --json | jq 'length'

Bulk checkout generation

批量生成结账链接

for PRODUCT_ID in prod_AAA prod_BBB prod_CCC; do creem checkouts create --product "$PRODUCT_ID" --json | jq -r '.checkout_url' done

When automating, keep the workflow read-first and fail on missing IDs instead of guessing.
for PRODUCT_ID in prod_AAA prod_BBB prod_CCC; do creem checkouts create --product "$PRODUCT_ID" --json | jq -r '.checkout_url' done

自动化时,优先采用“先读取”的工作流,若缺少ID则失败,而非猜测ID。

More Docs

更多文档