creem-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreem CLI
Creem CLI
creemUse 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 .
creemcreem当用户希望从终端或通过AI Agent操作Creem时,使用此技能。如果任务可直接通过完成,优先使用CLI而非仪表盘操作指南。
creemPrerequisites
前提条件
- The CLI must already be installed.
creem - 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- 必须已安装CLI。
creem - 在Agent驱动的任务开始前,用户必须已完成身份验证。
- 除非用户明确要求使用生产模式,否则默认使用测试模式。
- 使用以下命令确认当前会话:
bash
creem whoami --jsonSecret Safety
密钥安全注意事项
- Never read, print, summarize, upload, or parse .
~/.creem/config.json - Never ask the user to paste API keys into chat.
- Never run inside an agent or LLM session.
creem login --api-key ... - 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 on every command so outputs are machine-readable.
--json - Run before mutating operations.
creem whoami --json - List or inspect resources before mutating them. Do not guess IDs.
- Do not use the interactive browser mode (,
creem products, etc.) in agent sessions.creem customers - Do not change the global CLI output format unless the user explicitly asks. Use per-command instead.
--json - For cancellations, recommend unless the user explicitly wants immediate access removal.
--mode scheduled - Treat CLI money amounts as minor units, not major units. For EUR and USD, means
500, not5.00.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 , use
--success-url(nothttp://) when pointing to localhost. Local dev servers don't serve TLS, sohttps://causeshttps://localhost.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数字当作完整的欧元或美元金额告知用户。
- 设置时,指向localhost请使用
--success-url而非http://。本地开发服务器不支持TLS,使用https://会导致https://localhost错误。ERR_SSL_PROTOCOL_ERROR
Money Amounts
金额说明
Creem CLI prices and transaction amounts are returned in minor units.
- means
--price 1999, not19.99.1999.00 - from the CLI means
500 EUR, not5.00 EUR.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 EURInterpret 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
快速参考
| Action | Command |
|---|---|
| Check auth and environment | |
| Show config | |
| List config keys | |
| List products | |
| Get product | |
| Create product | |
| List customers | |
| Get customer by ID | |
| Get customer by email | |
| Billing portal link | |
| Create checkout | |
| Get checkout | |
| List subscriptions | |
| Filter subscriptions | |
| Get subscription | |
| Pause subscription | |
| Resume subscription | |
| Cancel subscription safely | |
| List transactions | |
| Get transaction | |
| 操作 | 命令 |
|---|---|
| 检查身份验证和环境 | |
| 查看配置 | |
| 列出配置键 | |
| 列出产品 | |
| 获取产品详情 | |
| 创建产品 | |
| 列出客户 | |
| 通过ID获取客户详情 | |
| 通过邮箱获取客户详情 | |
| 获取账单门户链接 | |
| 创建结账链接 | |
| 获取结账详情 | |
| 列出订阅 | |
| 筛选订阅 | |
| 获取订阅详情 | |
| 暂停订阅 | |
| 恢复订阅 | |
| 安全取消订阅 | |
| 列出交易 | |
| 获取交易详情 | |
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 --jsonUse 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 --jsonbash
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 --jsonLook 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 --jsonUse 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 --jsonPrefer for cancellation unless the user explicitly asks for immediate removal of access.
--mode scheduledbash
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 scheduledReview 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 --jsonFor scripted monitoring, parse JSON with instead of relying on table output.
jqbash
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对于脚本化监控,使用解析JSON而非依赖表格输出。
jqInspect or change CLI configuration only when requested
仅在用户要求时检查或修改CLI配置
bash
creem config show --json
creem config get environment --json
creem config set environment testDo not change or unless the user explicitly asks.
environmentoutput_formatbash
creem config show --json
creem config get environment --json
creem config set environment test除非用户明确要求,否则请勿修改或。
environmentoutput_formatAutomation Patterns
自动化模式
bash
undefinedbash
undefinedLatest 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
更多文档
- Docs index: https://docs.creem.io/llms.txt
- Creem docs home: https://docs.creem.io
- CLI reference: use the docs index above to locate the latest Creem CLI page before drilling deeper.
- 文档索引:https://docs.creem.io/llms.txt
- Creem文档主页:https://docs.creem.io
- CLI参考:在深入了解前,先通过上述文档索引找到最新的Creem CLI页面。