revcat
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineserevcat CLI
revcat CLI
CLI wrapping RevenueCat API v2. All output is JSON. Requires env var (v2 secret key from RevenueCat Dashboard > Project Settings > API Keys).
REVENUECAT_API_KEYInstall:
bun install -g @metehankurucu/revcat基于RevenueCat API v2封装的CLI工具,所有输出均为JSON格式。需要配置环境变量(可从RevenueCat控制台 > 项目设置 > API密钥获取v2密钥)。
REVENUECAT_API_KEY安装:
bun install -g @metehankurucu/revcatSetup
配置步骤
bash
export REVENUECAT_API_KEY=sk_your_key
export REVENUECAT_PROJECT_ID=proj_your_id # optional defaultFind project ID:
revcat projects listbash
export REVENUECAT_API_KEY=sk_your_key
export REVENUECAT_PROJECT_ID=proj_your_id # 可选默认配置查询项目ID:
revcat projects listCommand Pattern
命令格式
revcat <resource> <action> --project <id> [options]All commands require (or env var) except .
--projectREVENUECAT_PROJECT_IDprojects listrevcat <资源类型> <操作> --project <项目ID> [可选参数]除外,所有命令均需指定参数(或配置环境变量)。
projects list--projectREVENUECAT_PROJECT_IDCore Workflows
核心工作流
Revenue Analysis
收入分析
bash
undefinedbash
undefinedOverview: MRR, revenue, active subs, trials, new customers
概览:MRR、收入、活跃订阅数、试用数、新客户数
revcat charts overview --project proj123
revcat charts overview --project proj123
MRR trend (monthly)
MRR趋势(月度)
revcat charts data --project proj123 --chart mrr --start 2025-01-01 --end 2025-12-31 --resolution month
revcat charts data --project proj123 --chart mrr --start 2025-01-01 --end 2025-12-31 --resolution month
Churn rate (weekly)
流失率(周度)
revcat charts data --project proj123 --chart churn --start 2026-01-01 --end 2026-02-21 --resolution week
revcat charts data --project proj123 --chart churn --start 2026-01-01 --end 2026-02-21 --resolution week
Available chart names: actives, arr, churn, mrr, mrr_movement, revenue, trials,
支持的图表类型:actives, arr, churn, mrr, mrr_movement, revenue, trials,
subscription_retention, initial_conversion, trial_conversion, realized_ltv_per_customer,
subscription_retention, initial_conversion, trial_conversion, realized_ltv_per_customer,
realized_ltv_per_paying_customer, refund_rate, new, store_top_products, store_top_countries,
realized_ltv_per_paying_customer, refund_rate, new, store_top_products, store_top_countries,
non_subscription_revenue, non_subscription_transactions
non_subscription_revenue, non_subscription_transactions
Discover chart options (resolutions, segments, filters)
查看图表可选参数(时间粒度、细分维度、筛选条件)
revcat charts options --project proj123 --chart revenue
undefinedrevcat charts options --project proj123 --chart revenue
undefinedCustomer Investigation
客户信息查询
bash
revcat customers get --project proj123 --customer cust_abc
revcat customers entitlements --project proj123 --customer cust_abc
revcat customers subscriptions --project proj123 --customer cust_abc
revcat customers purchases --project proj123 --customer cust_abc
revcat customers attributes --project proj123 --customer cust_abcbash
revcat customers get --project proj123 --customer cust_abc
revcat customers entitlements --project proj123 --customer cust_abc
revcat customers subscriptions --project proj123 --customer cust_abc
revcat customers purchases --project proj123 --customer cust_abc
revcat customers attributes --project proj123 --customer cust_abcTag for segmentation
为客户添加标签用于细分
revcat customers set-attributes --project proj123 --customer cust_abc
--data '{"segment": {"value": "power_user"}}'
--data '{"segment": {"value": "power_user"}}'
revcat customers set-attributes --project proj123 --customer cust_abc
--data '{"segment": {"value": "power_user"}}'
--data '{"segment": {"value": "power_user"}}'
A/B test: assign specific offering
A/B测试:为客户分配特定产品套餐
revcat customers assign-offering --project proj123 --customer cust_abc --offering ofrng_xyz
undefinedrevcat customers assign-offering --project proj123 --customer cust_abc --offering ofrng_xyz
undefinedOffering Management
产品套餐管理
bash
revcat offerings list --project proj123
revcat offerings create --project proj123 --lookup-key premium-v2 --display-name "Premium V2"
revcat offerings update --project proj123 --offering ofrng_abc --display-name "Updated Name" --is-currentbash
revcat offerings list --project proj123
revcat offerings create --project proj123 --lookup-key premium-v2 --display-name "Premium V2"
revcat offerings update --project proj123 --offering ofrng_abc --display-name "Updated Name" --is-currentPackages within offerings
套餐内的产品包管理
revcat packages create --project proj123 --offering ofrng_abc --lookup-key monthly --display-name "Monthly"
revcat packages attach-products --project proj123 --package pkg_abc --products '[{"product_id":"prod_xyz"}]'
revcat packages detach-products --project proj123 --package pkg_abc --product-ids prod_xyz
undefinedrevcat packages create --project proj123 --offering ofrng_abc --lookup-key monthly --display-name "Monthly"
revcat packages attach-products --project proj123 --package pkg_abc --products '[{"product_id":"prod_xyz"}]'
revcat packages detach-products --project proj123 --package pkg_abc --product-ids prod_xyz
undefinedEntitlement Management
权益管理
bash
revcat entitlements list --project proj123
revcat entitlements create --project proj123 --lookup-key premium --display-name "Premium Access"
revcat entitlements attach-products --project proj123 --entitlement entl_abc --product-ids prod_1,prod_2bash
revcat entitlements list --project proj123
revcat entitlements create --project proj123 --lookup-key premium --display-name "Premium Access"
revcat entitlements attach-products --project proj123 --entitlement entl_abc --product-ids prod_1,prod_2Subscription Lookup
订阅信息查询
bash
revcat subscriptions search --project proj123 --store-identifier "450001234567890"
revcat subscriptions get --project proj123 --subscription sub_abc
revcat subscriptions entitlements --project proj123 --subscription sub_abc
revcat subscriptions transactions --project proj123 --subscription sub_abcbash
revcat subscriptions search --project proj123 --store-identifier "450001234567890"
revcat subscriptions get --project proj123 --subscription sub_abc
revcat subscriptions entitlements --project proj123 --subscription sub_abc
revcat subscriptions transactions --project proj123 --subscription sub_abcWebhook Setup
Webhook配置
bash
revcat webhooks create --project proj123 --url "https://api.myapp.com/webhook" --name "Prod" --environment production
revcat webhooks update --project proj123 --webhook wh_abc --url "https://new-url.com/hook"bash
revcat webhooks create --project proj123 --url "https://api.myapp.com/webhook" --name "Prod" --environment production
revcat webhooks update --project proj123 --webhook wh_abc --url "https://new-url.com/hook"Available Resources
支持的资源类型
| Resource | Actions | Notes |
|---|---|---|
| list | |
| list, get, keys | |
| overview, data, options | 5 req/min rate limit |
| list, get, entitlements, aliases, attributes, set-attributes, purchases, subscriptions, vc-balances, assign-offering | |
| list, get, products, create, update, attach-products, detach-products | |
| list, get, create, update | |
| list, get, products, create, update, attach-products, detach-products | |
| list, get | read-only |
| search, get, entitlements, transactions, management-url | read-only |
| search, get, entitlements | read-only |
| list, get | read-only |
| list | read-only |
| list | read-only |
| list, get | read-only |
| list, get, create, update | |
| list, get, create |
For full command details with all options, see references/commands.md.
| 资源类型 | 支持操作 | 备注 |
|---|---|---|
| list | |
| list, get, keys | |
| overview, data, options | 每分钟5次请求限制 |
| list, get, entitlements, aliases, attributes, set-attributes, purchases, subscriptions, vc-balances, assign-offering | |
| list, get, products, create, update, attach-products, detach-products | |
| list, get, create, update | |
| list, get, products, create, update, attach-products, detach-products | |
| list, get | 仅可读 |
| search, get, entitlements, transactions, management-url | 仅可读 |
| search, get, entitlements | 仅可读 |
| list, get | 仅可读 |
| list | 仅可读 |
| list | 仅可读 |
| list, get | 仅可读 |
| list, get, create, update | |
| list, get, create |
如需查看包含所有参数的完整命令详情,请参考references/commands.md。
Rate Limits
请求频率限制
| Domain | Limit | Commands |
|---|---|---|
| 5/min | charts |
| 480/min | customers, subscriptions, purchases |
| 60/min | everything else |
Requests auto-wait when rate limited.
| 领域 | 限制 | 涉及命令 |
|---|---|---|
| 5次/分钟 | charts相关命令 |
| 480次/分钟 | customers、subscriptions、purchases相关命令 |
| 60次/分钟 | 其他所有命令 |
触发频率限制时,请求会自动等待后重试。
Safety
安全机制
Strict allowlist — only permitted operations execute. Blocked: all DELETE, refunds, grant/revoke entitlements, customer deletion/transfer, subscription cancellation, app/project creation/deletion, product store creation, virtual currency transactions.
采用严格的白名单机制——仅允许执行指定操作。禁止操作包括:所有DELETE操作、退款、授予/撤销权益、客户删除/转移、订阅取消、应用/项目创建/删除、产品商店创建、虚拟货币交易。
API Specification
API规范
Full RevenueCat API v2 OpenAPI spec: see references/api-spec.yaml.
完整的RevenueCat API v2 OpenAPI规范,请参考references/api-spec.yaml。