revenuecat-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineserevenuecat-cli: driving RevenueCat from the terminal
revenuecat-cli:从终端操作RevenueCat
rcrcInstall and authenticate
安装与认证
- Run without installing: (good for CI and agent sandboxes).
npx @revenuecat/cli <command> - Or install: , or
brew install RevenueCat/tap/rc.npm install -g @revenuecat/cli - Authenticate once with (browser OAuth), or set
rc auth login. Non-interactively, passRC_API_KEYor set--api-key.RC_API_KEY - The CLI authenticates with a RevenueCat secret key (); that is correct because the CLI is a server-side tool. This is not the same as the public SDK keys (
sk_.../appl_/goog_) you fetch for client app code. Never put a secret key in an app.amzn_
- 无需安装即可运行:(适用于CI和Agent沙箱环境)。
npx @revenuecat/cli <command> - 或进行安装:,或
brew install RevenueCat/tap/rc。npm install -g @revenuecat/cli - 使用(浏览器OAuth)完成一次认证,或设置
rc auth login。非交互式场景下,传递RC_API_KEY参数或设置--api-key环境变量。RC_API_KEY - CLI使用RevenueCat的密钥()进行认证;这是正确的,因为CLI是一款服务器端工具。它与客户端应用代码使用的公开SDK密钥(
sk_.../appl_/goog_)不同。切勿将密钥放入应用程序中。amzn_
Discover the surface
探索命令体系
The CLI is self-describing. Don't guess a command or flag, ask the binary:
- lists the full command tree. Capability IDs appear in colon form (
rc commands --json,apps:create).products:store:plan - returns every command's flags, args, and examples in one call. This is the most reliable way for an agent to discover per-command detail.
rc commands --schemas --json - returns detail for a single command, but the command must be space-separated tokens (
rc schema <command> --json), not the colon form fromrc schema apps create.rc commandssilently returns the root schema, so when in doubt userc schema apps:create.rc commands --schemas - and
rc --helpgive human-readable help.rc <noun> --help
CLI具备自描述特性。无需猜测命令或参数,直接向二进制文件查询:
- 列出完整的命令树。功能ID以冒号形式呈现(如
rc commands --json、apps:create)。products:store:plan - 一次性返回所有命令的参数、选项和示例。这是Agent获取各命令详细信息最可靠的方式。
rc commands --schemas --json - 返回单个命令的详细信息,但命令必须以空格分隔的令牌形式传入(如
rc schema <command> --json),而非rc schema apps create返回的冒号形式。rc commands会静默返回根模式,因此不确定时请使用rc schema apps:create。rc commands --schemas - 和
rc --help提供人类可读的帮助信息。rc <名词> --help
Output conventions
输出规范
- gives stable, machine-readable output. Data goes to stdout, progress and chatter to stderr.
--json - The envelope is , but the shape under
{ "data": ... }varies by command: lists are usuallydata, though some commands use other keys (charts usedata.items[]). Inspect the schema or the response rather than assumingdata.names[].data.items - never prompts, it fails instead. Use it in scripts, CI, and agents.
--no-input - /
--yesskips confirmation prompts on mutating commands.-y - selects the project (or set a default with
--project-id <id>). Pass it explicitly in scripts.rc projects use - Exit codes: success,
0error,1bad usage,2auth,4not found,5rate limited.6
- 参数提供稳定的、机器可读的输出。数据输出到stdout,进度和提示信息输出到stderr。
--json - 输出结构为,但
{ "data": ... }下的结构因命令而异:列表通常为data,不过部分命令使用其他键(图表使用data.items[])。请查看模式或响应内容,不要默认使用data.names[]。data.items - 参数从不触发提示,若需要输入则直接失败。适用于脚本、CI和Agent场景。
--no-input - /
--yes参数跳过变更命令的确认提示。-y - 参数选择项目(或使用
--project-id <id>设置默认项目)。在脚本中请显式传递该参数。rc projects use - 退出码:表示成功,
0表示错误,1表示使用不当,2表示认证失败,4表示未找到资源,5表示请求受限。6
Common operations
常见操作
Look up exact flags with (or ). The common nouns:
rc commands --schemas --jsonrc schema <space-separated command>- Projects and apps: ,
rc projects list|create|userc apps list|create|keys - Catalog: ,
rc products ...,rc entitlements ...,rc offerings ...rc packages ... - Store credentials and state: ,
rc setup apple|googlerc products store plan|apply|sync - Data: ,
rc charts list|showrc customers ... - Paywalls:
rc paywalls generate|edit|publish
Prefer the specific command. Drop to only for endpoints not yet in the CLI surface.
rc api <METHOD> <path>使用(或)查看具体参数。常见的命令类别:
rc commands --schemas --jsonrc schema <空格分隔的命令>- 项目与应用:、
rc projects list|create|userc apps list|create|keys - 商品目录:、
rc products ...、rc entitlements ...、rc offerings ...rc packages ... - 商店凭证与状态:、
rc setup apple|googlerc products store plan|apply|sync - 数据:、
rc charts list|showrc customers ... - 付费墙:
rc paywalls generate|edit|publish
优先使用特定命令。仅当CLI未覆盖相关端点时,才使用。
rc api <METHOD> <path>