revcat

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

revcat CLI

revcat CLI

CLI wrapping RevenueCat API v2. All output is JSON. Requires
REVENUECAT_API_KEY
env var (v2 secret key from RevenueCat Dashboard > Project Settings > API Keys).
Install:
bun install -g @metehankurucu/revcat
基于RevenueCat API v2封装的CLI工具,所有输出均为JSON格式。需要配置
REVENUECAT_API_KEY
环境变量(可从RevenueCat控制台 > 项目设置 > API密钥获取v2密钥)。
安装:
bun install -g @metehankurucu/revcat

Setup

配置步骤

bash
export REVENUECAT_API_KEY=sk_your_key
export REVENUECAT_PROJECT_ID=proj_your_id  # optional default
Find project ID:
revcat projects list
bash
export REVENUECAT_API_KEY=sk_your_key
export REVENUECAT_PROJECT_ID=proj_your_id  # 可选默认配置
查询项目ID:
revcat projects list

Command Pattern

命令格式

revcat <resource> <action> --project <id> [options]
All commands require
--project
(or
REVENUECAT_PROJECT_ID
env var) except
projects list
.
revcat <资源类型> <操作> --project <项目ID> [可选参数]
projects list
外,所有命令均需指定
--project
参数(或配置
REVENUECAT_PROJECT_ID
环境变量)。

Core Workflows

核心工作流

Revenue Analysis

收入分析

bash
undefined
bash
undefined

Overview: 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
undefined
revcat charts options --project proj123 --chart revenue
undefined

Customer 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_abc
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_abc

Tag for segmentation

为客户添加标签用于细分

revcat customers set-attributes --project proj123 --customer cust_abc
--data '{"segment": {"value": "power_user"}}'
revcat customers set-attributes --project proj123 --customer cust_abc
--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
undefined
revcat customers assign-offering --project proj123 --customer cust_abc --offering ofrng_xyz
undefined

Offering 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-current
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-current

Packages 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
undefined
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
undefined

Entitlement 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_2
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_2

Subscription 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_abc
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_abc

Webhook 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

支持的资源类型

ResourceActionsNotes
projects
list
apps
list, get, keys
charts
overview, data, options5 req/min rate limit
customers
list, get, entitlements, aliases, attributes, set-attributes, purchases, subscriptions, vc-balances, assign-offering
entitlements
list, get, products, create, update, attach-products, detach-products
offerings
list, get, create, update
packages
list, get, products, create, update, attach-products, detach-products
products
list, getread-only
subscriptions
search, get, entitlements, transactions, management-urlread-only
purchases
search, get, entitlementsread-only
invoices
list, getread-only
audit-logs
listread-only
collaborators
listread-only
virtual-currencies
list, getread-only
webhooks
list, get, create, update
paywalls
list, get, create
For full command details with all options, see references/commands.md.
资源类型支持操作备注
projects
list
apps
list, get, keys
charts
overview, data, options每分钟5次请求限制
customers
list, get, entitlements, aliases, attributes, set-attributes, purchases, subscriptions, vc-balances, assign-offering
entitlements
list, get, products, create, update, attach-products, detach-products
offerings
list, get, create, update
packages
list, get, products, create, update, attach-products, detach-products
products
list, get仅可读
subscriptions
search, get, entitlements, transactions, management-url仅可读
purchases
search, get, entitlements仅可读
invoices
list, get仅可读
audit-logs
list仅可读
collaborators
list仅可读
virtual-currencies
list, get仅可读
webhooks
list, get, create, update
paywalls
list, get, create
如需查看包含所有参数的完整命令详情,请参考references/commands.md

Rate Limits

请求频率限制

DomainLimitCommands
charts_metrics
5/mincharts
customer_information
480/mincustomers, subscriptions, purchases
project_configuration
60/mineverything else
Requests auto-wait when rate limited.
领域限制涉及命令
charts_metrics
5次/分钟charts相关命令
customer_information
480次/分钟customers、subscriptions、purchases相关命令
project_configuration
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