revenuecat-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

revenuecat-cli: driving RevenueCat from the terminal

revenuecat-cli:从终端操作RevenueCat

rc
is the official RevenueCat command line interface. It covers most of the same project, app, product, entitlement, offering, paywall, chart, and store-state operations as the RevenueCat MCP server (the CLI adds paywall generate/edit; the MCP server has some SDK feature-gate and experiment tools the CLI does not). Use whichever surface is available; this skill is the reference for the CLI path.
rc
是官方的RevenueCat命令行界面。它涵盖了与RevenueCat MCP服务器大部分相同的项目、应用、产品、权益、套餐、付费墙、图表和商店状态操作(CLI新增了付费墙生成/编辑功能;MCP服务器拥有一些CLI不具备的SDK功能门控和实验工具)。可根据可用场景选择使用;本技能是CLI路径的参考指南。

Install and authenticate

安装与认证

  • Run without installing:
    npx @revenuecat/cli <command>
    (good for CI and agent sandboxes).
  • Or install:
    brew install RevenueCat/tap/rc
    , or
    npm install -g @revenuecat/cli
    .
  • Authenticate once with
    rc auth login
    (browser OAuth), or set
    RC_API_KEY
    . Non-interactively, pass
    --api-key
    or set
    RC_API_KEY
    .
  • The CLI authenticates with a RevenueCat secret key (
    sk_...
    ); that is correct because the CLI is a server-side tool. This is not the same as the public SDK keys (
    appl_
    /
    goog_
    /
    amzn_
    ) you fetch for client app code. Never put a secret key in an app.
  • 无需安装即可运行:
    npx @revenuecat/cli <command>
    (适用于CI和Agent沙箱环境)。
  • 或进行安装:
    brew install RevenueCat/tap/rc
    ,或
    npm install -g @revenuecat/cli
  • 使用
    rc auth login
    (浏览器OAuth)完成一次认证,或设置
    RC_API_KEY
    。非交互式场景下,传递
    --api-key
    参数或设置
    RC_API_KEY
    环境变量。
  • CLI使用RevenueCat的密钥
    sk_...
    )进行认证;这是正确的,因为CLI是一款服务器端工具。它与客户端应用代码使用的公开SDK密钥(
    appl_
    /
    goog_
    /
    amzn_
    )不同。切勿将密钥放入应用程序中。

Discover the surface

探索命令体系

The CLI is self-describing. Don't guess a command or flag, ask the binary:
  • rc commands --json
    lists the full command tree. Capability IDs appear in colon form (
    apps:create
    ,
    products:store:plan
    ).
  • rc commands --schemas --json
    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 schema <command> --json
    returns detail for a single command, but the command must be space-separated tokens (
    rc schema apps create
    ), not the colon form from
    rc commands
    .
    rc schema apps:create
    silently returns the root schema, so when in doubt use
    rc commands --schemas
    .
  • rc --help
    and
    rc <noun> --help
    give human-readable help.
CLI具备自描述特性。无需猜测命令或参数,直接向二进制文件查询:
  • rc commands --json
    列出完整的命令树。功能ID以冒号形式呈现(如
    apps:create
    products:store:plan
    )。
  • rc commands --schemas --json
    一次性返回所有命令的参数、选项和示例。这是Agent获取各命令详细信息最可靠的方式。
  • rc schema <command> --json
    返回单个命令的详细信息,但命令必须以空格分隔的令牌形式传入(如
    rc schema apps create
    ),而非
    rc commands
    返回的冒号形式。
    rc schema apps:create
    会静默返回根模式,因此不确定时请使用
    rc commands --schemas
  • rc --help
    rc <名词> --help
    提供人类可读的帮助信息。

Output conventions

输出规范

  • --json
    gives stable, machine-readable output. Data goes to stdout, progress and chatter to stderr.
  • The envelope is
    { "data": ... }
    , but the shape under
    data
    varies by command: lists are usually
    data.items[]
    , though some commands use other keys (charts use
    data.names[]
    ). Inspect the schema or the response rather than assuming
    data.items
    .
  • --no-input
    never prompts, it fails instead. Use it in scripts, CI, and agents.
  • --yes
    /
    -y
    skips confirmation prompts on mutating commands.
  • --project-id <id>
    selects the project (or set a default with
    rc projects use
    ). Pass it explicitly in scripts.
  • Exit codes:
    0
    success,
    1
    error,
    2
    bad usage,
    4
    auth,
    5
    not found,
    6
    rate limited.
  • --json
    参数提供稳定的、机器可读的输出。数据输出到stdout,进度和提示信息输出到stderr。
  • 输出结构为
    { "data": ... }
    ,但
    data
    下的结构因命令而异:列表通常为
    data.items[]
    ,不过部分命令使用其他键(图表使用
    data.names[]
    )。请查看模式或响应内容,不要默认使用
    data.items
  • --no-input
    参数从不触发提示,若需要输入则直接失败。适用于脚本、CI和Agent场景。
  • --yes
    /
    -y
    参数跳过变更命令的确认提示。
  • --project-id <id>
    参数选择项目(或使用
    rc projects use
    设置默认项目)。在脚本中请显式传递该参数。
  • 退出码:
    0
    表示成功,
    1
    表示错误,
    2
    表示使用不当,
    4
    表示认证失败,
    5
    表示未找到资源,
    6
    表示请求受限。

Common operations

常见操作

Look up exact flags with
rc commands --schemas --json
(or
rc schema <space-separated command>
). The common nouns:
  • Projects and apps:
    rc projects list|create|use
    ,
    rc apps list|create|keys
  • Catalog:
    rc products ...
    ,
    rc entitlements ...
    ,
    rc offerings ...
    ,
    rc packages ...
  • Store credentials and state:
    rc setup apple|google
    ,
    rc products store plan|apply|sync
  • Data:
    rc charts list|show
    ,
    rc customers ...
  • Paywalls:
    rc paywalls generate|edit|publish
Prefer the specific command. Drop to
rc api <METHOD> <path>
only for endpoints not yet in the CLI surface.
使用
rc commands --schemas --json
(或
rc schema <空格分隔的命令>
)查看具体参数。常见的命令类别:
  • 项目与应用
    rc projects list|create|use
    rc apps list|create|keys
  • 商品目录
    rc products ...
    rc entitlements ...
    rc offerings ...
    rc packages ...
  • 商店凭证与状态
    rc setup apple|google
    rc products store plan|apply|sync
  • 数据
    rc charts list|show
    rc customers ...
  • 付费墙
    rc paywalls generate|edit|publish
优先使用特定命令。仅当CLI未覆盖相关端点时,才使用
rc api <METHOD> <path>