commet-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommet CLI
Commet CLI
Generate TypeScript types from your Commet dashboard for autocomplete, scaffold new projects from billing templates, and manage organizations. Requires Node.js 18+.
从你的Commet控制面板生成TypeScript类型用于自动补全,基于计费模板脚手架生成新项目,以及管理组织。需要Node.js 18及以上版本。
Install
安装
bash
npm install -g commetbash
npm install -g commetQuick Start
快速开始
bash
commet login # Authenticate in browser
commet link # Link project to organization
commet pull # Generate .commet/types.d.tsAfter , SDK calls get autocomplete for , , and parameters:
commet pullplanCodefeatureseatTypetypescript
await commet.usage.track({
externalId: "user_123",
feature: "api_calls", // autocomplete from pulled types
});
await commet.subscriptions.create({
externalId: "user_123",
planCode: "pro", // autocomplete from pulled types
});bash
commet login # 在浏览器中完成身份验证
commet link # 将项目关联到组织
commet pull # 生成 .commet/types.d.ts执行之后,SDK调用时、和参数将支持自动补全:
commet pullplanCodefeatureseatTypetypescript
await commet.usage.track({
externalId: "user_123",
feature: "api_calls", // 基于拉取的类型自动补全
});
await commet.subscriptions.create({
externalId: "user_123",
planCode: "pro", // 基于拉取的类型自动补全
});Commands
命令
| Command | Description |
|---|---|
| Authenticate with Commet (opens browser) |
| Remove credentials |
| Show auth status and current organization |
| Link project to an organization |
| Unlink project |
| Switch to a different organization |
| Show project and auth status |
| Generate |
| List features for the linked organization |
| List seat types |
| List plans |
| Scaffold new project from a billing template |
See references/commands.md for full details.
| 命令 | 描述 |
|---|---|
| 通过Commet完成身份验证(将打开浏览器) |
| 移除登录凭据 |
| 显示认证状态和当前组织 |
| 将项目关联到某个组织 |
| 取消项目关联 |
| 切换到其他组织 |
| 显示项目和认证状态 |
| 生成 |
| 列出所关联组织的功能项 |
| 列出席位类型 |
| 列出套餐 |
| 基于计费模板脚手架生成新项目 |
完整详情请查看references/commands.md。
Templates
模板
Scaffold a complete Next.js project with billing pre-configured:
bash
commet create my-app| Template | Billing Model |
|---|---|
| Fixed subscriptions with boolean features |
| Per-seat billing for team collaboration |
| Usage-based with included amounts and overage |
| Credit-based consumption with packs and top-ups |
| AI product with automatic token cost tracking |
| Prepaid balance with fixed unit prices |
See references/templates.md for details on each template.
脚手架生成预配置了计费功能的完整Next.js项目:
bash
commet create my-app| 模板 | 计费模式 |
|---|---|
| 带布尔型功能项的固定订阅 |
| 适用于团队协作的按席位计费 |
| 基于用量计费,包含固定额度和超额费用 |
| 基于点数消费,支持点数包和充值 |
| 支持自动token成本追踪的AI产品 |
| 固定单价的预付费余额 |
每个模板的详情请查看references/templates.md。
Key Gotchas
注意事项
-
is sandbox-only. Templates create plans and features in your sandbox organization. If you're logged into production, you need to
commet createand log back in to sandbox.commet logout -
Commit. The generated types file should be committed to your repo so the entire team gets autocomplete without each person running
.commet/types.d.ts.commet pull -
Two environments, two logins. Sandbox () and Production (
sandbox.commet.co) are isolated. Switch by logging out and back in.commet.co -
Runafter dashboard changes. When you add plans, features, or seat types in the dashboard, re-run
commet pullto update the local types file.commet pull
-
仅适用于沙箱环境。 模板会在你的沙箱组织中创建套餐和功能项。如果你登录的是生产环境,需要先执行
commet create再重新登录沙箱。commet logout -
提交到代码仓库。 生成的类型文件应该提交到你的代码仓库,这样整个团队无需每个人都运行
.commet/types.d.ts就能获得自动补全能力。commet pull -
两个环境两套登录凭证。 沙箱()和生产环境(
sandbox.commet.co)是相互隔离的。需要登出后重新登录来切换环境。commet.co -
在控制面板修改配置后请运行。 当你在控制面板中新增套餐、功能项或席位类型时,请重新执行
commet pull更新本地类型文件。commet pull
When to Load References
参考文档指引
- Full command flags and details -> references/commands.md
- Template descriptions and billing models -> references/templates.md
- Step-by-step project setup -> references/setup-workflow.md
- 完整命令参数和详情 -> references/commands.md
- 模板说明和计费模式 -> references/templates.md
- 分步项目设置指南 -> references/setup-workflow.md