@commet/node 9.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.mts +333 -111
  3. package/dist/index.d.ts +333 -111
  4. package/dist/index.js +162 -40
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +162 -40
  7. package/dist/index.mjs.map +1 -1
  8. package/docs/README.md +20 -0
  9. package/docs/ai-onboarding/ai-onboarding.md +90 -0
  10. package/docs/ai-onboarding/billing-best-practices-skill.md +29 -0
  11. package/docs/ai-onboarding/commet-skill.md +58 -0
  12. package/docs/ai-onboarding/mcp-server.md +207 -0
  13. package/docs/ai-onboarding/meta.json +17 -0
  14. package/docs/ai-onboarding/pricing-models-skill.md +29 -0
  15. package/docs/ai-onboarding/subscription-patterns-skill.md +29 -0
  16. package/docs/api-reference/addons.md +127 -0
  17. package/docs/api-reference/api-keys.md +57 -0
  18. package/docs/api-reference/credit-packs.md +80 -0
  19. package/docs/api-reference/customers.md +274 -0
  20. package/docs/api-reference/feature-access.md +36 -0
  21. package/docs/api-reference/features.md +94 -0
  22. package/docs/api-reference/generated-webhooks.md +120 -0
  23. package/docs/api-reference/index.md +31 -0
  24. package/docs/api-reference/invoices.md +123 -0
  25. package/docs/api-reference/markets.md +92 -0
  26. package/docs/api-reference/meta.json +7 -0
  27. package/docs/api-reference/offers.md +104 -0
  28. package/docs/api-reference/payments.md +106 -0
  29. package/docs/api-reference/payouts.md +66 -0
  30. package/docs/api-reference/plan-groups.md +157 -0
  31. package/docs/api-reference/plans.md +358 -0
  32. package/docs/api-reference/portal.md +30 -0
  33. package/docs/api-reference/promo-codes.md +86 -0
  34. package/docs/api-reference/provisioning.md +19 -0
  35. package/docs/api-reference/quota.md +120 -0
  36. package/docs/api-reference/seats.md +123 -0
  37. package/docs/api-reference/subscriptions.md +387 -0
  38. package/docs/api-reference/test-clock.md +59 -0
  39. package/docs/api-reference/transactions.md +78 -0
  40. package/docs/api-reference/usage.md +83 -0
  41. package/docs/documentation/api-versioning.md +100 -0
  42. package/docs/documentation/better-auth.md +361 -0
  43. package/docs/documentation/choose-a-billing-model.md +38 -0
  44. package/docs/documentation/cli.md +1024 -0
  45. package/docs/documentation/create-api-key.md +47 -0
  46. package/docs/documentation/customers/customer-credits.md +48 -0
  47. package/docs/documentation/customers/customer-portal.md +107 -0
  48. package/docs/documentation/customers/manage-customers.md +346 -0
  49. package/docs/documentation/customers/meta.json +5 -0
  50. package/docs/documentation/error-handling.md +239 -0
  51. package/docs/documentation/examples.md +37 -0
  52. package/docs/documentation/finance/acceptable-use.md +145 -0
  53. package/docs/documentation/finance/finance-overview.md +32 -0
  54. package/docs/documentation/finance/local-currency-taxes.md +40 -0
  55. package/docs/documentation/finance/merchant-of-record.md +48 -0
  56. package/docs/documentation/finance/meta.json +13 -0
  57. package/docs/documentation/finance/payouts-verification.md +186 -0
  58. package/docs/documentation/finance/payouts.md +41 -0
  59. package/docs/documentation/finance/supported-countries.md +28 -0
  60. package/docs/documentation/go/integrate-with-encore.md +229 -0
  61. package/docs/documentation/go/integrate-with-go.md +258 -0
  62. package/docs/documentation/go/meta.json +5 -0
  63. package/docs/documentation/introduction.md +58 -0
  64. package/docs/documentation/invoicing/handle-failed-payments.md +283 -0
  65. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +73 -0
  66. package/docs/documentation/invoicing/manage-invoices.md +340 -0
  67. package/docs/documentation/invoicing/meta.json +9 -0
  68. package/docs/documentation/java/integrate-with-java.md +117 -0
  69. package/docs/documentation/java/meta.json +5 -0
  70. package/docs/documentation/meta.json +36 -0
  71. package/docs/documentation/nodejs/integrate-with-astro.md +129 -0
  72. package/docs/documentation/nodejs/integrate-with-bun.md +113 -0
  73. package/docs/documentation/nodejs/integrate-with-express.md +127 -0
  74. package/docs/documentation/nodejs/integrate-with-hono.md +141 -0
  75. package/docs/documentation/nodejs/integrate-with-nextjs.md +118 -0
  76. package/docs/documentation/nodejs/integrate-with-nuxt.md +125 -0
  77. package/docs/documentation/nodejs/integrate-with-remix.md +136 -0
  78. package/docs/documentation/nodejs/integrate-with-sveltekit.md +127 -0
  79. package/docs/documentation/nodejs/meta.json +14 -0
  80. package/docs/documentation/payments/accept-one-time-payments.md +314 -0
  81. package/docs/documentation/payments/meta.json +10 -0
  82. package/docs/documentation/payments/payment-orchestration.md +43 -0
  83. package/docs/documentation/payments/payment-providers.md +59 -0
  84. package/docs/documentation/payments/transactions-refunds-and-retries.md +199 -0
  85. package/docs/documentation/php/integrate-with-laravel.md +222 -0
  86. package/docs/documentation/php/integrate-with-php.md +103 -0
  87. package/docs/documentation/php/integrate-with-symfony.md +214 -0
  88. package/docs/documentation/php/meta.json +9 -0
  89. package/docs/documentation/plans/add-ons.md +257 -0
  90. package/docs/documentation/plans/balance-and-top-ups.md +169 -0
  91. package/docs/documentation/plans/configure-features.md +335 -0
  92. package/docs/documentation/plans/consumption-models.md +93 -0
  93. package/docs/documentation/plans/create-plans.md +162 -0
  94. package/docs/documentation/plans/credit-packs.md +89 -0
  95. package/docs/documentation/plans/meta.json +14 -0
  96. package/docs/documentation/plans/one-time-payments.md +142 -0
  97. package/docs/documentation/plans/plan-groups.md +31 -0
  98. package/docs/documentation/platform/custom-domains.md +27 -0
  99. package/docs/documentation/platform/dashboard-metrics-and-events.md +25 -0
  100. package/docs/documentation/platform/members-and-permissions.md +21 -0
  101. package/docs/documentation/platform/meta.json +10 -0
  102. package/docs/documentation/platform/organization-settings.md +29 -0
  103. package/docs/documentation/python/integrate-with-django.md +161 -0
  104. package/docs/documentation/python/integrate-with-fastapi.md +164 -0
  105. package/docs/documentation/python/integrate-with-flask.md +153 -0
  106. package/docs/documentation/python/integrate-with-python.md +90 -0
  107. package/docs/documentation/python/meta.json +10 -0
  108. package/docs/documentation/sales/card-promotions.md +41 -0
  109. package/docs/documentation/sales/introductory-offers.md +64 -0
  110. package/docs/documentation/sales/meta.json +13 -0
  111. package/docs/documentation/sales/offers.md +65 -0
  112. package/docs/documentation/sales/promo-codes.md +65 -0
  113. package/docs/documentation/sales/promotional-offers.md +58 -0
  114. package/docs/documentation/sales/regional-prices.md +100 -0
  115. package/docs/documentation/sales/trial-periods.md +88 -0
  116. package/docs/documentation/sdk-reference.md +68 -0
  117. package/docs/documentation/subscriptions/manage-subscriptions.md +505 -0
  118. package/docs/documentation/subscriptions/meta.json +9 -0
  119. package/docs/documentation/subscriptions/plan-grants.md +132 -0
  120. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +35 -0
  121. package/docs/documentation/testing-sandbox.md +251 -0
  122. package/docs/documentation/usage/ai-token-billing.md +294 -0
  123. package/docs/documentation/usage/meta.json +10 -0
  124. package/docs/documentation/usage/quota-management.md +341 -0
  125. package/docs/documentation/usage/seat-management.md +377 -0
  126. package/docs/documentation/usage/track-usage.md +282 -0
  127. package/docs/errors/addon_already_active.md +22 -0
  128. package/docs/errors/addon_has_activations.md +22 -0
  129. package/docs/errors/addon_not_active.md +22 -0
  130. package/docs/errors/addon_not_found.md +22 -0
  131. package/docs/errors/already_has_active_subscription.md +22 -0
  132. package/docs/errors/already_scheduled.md +22 -0
  133. package/docs/errors/api_key_not_found.md +22 -0
  134. package/docs/errors/card_promotions_not_available.md +22 -0
  135. package/docs/errors/charge_failed.md +22 -0
  136. package/docs/errors/charge_in_progress.md +22 -0
  137. package/docs/errors/claim_not_pending.md +22 -0
  138. package/docs/errors/credit_pack_not_found.md +22 -0
  139. package/docs/errors/customer_not_found.md +22 -0
  140. package/docs/errors/duplicate.md +22 -0
  141. package/docs/errors/endpoint_deprecated.md +22 -0
  142. package/docs/errors/endpoint_not_available.md +22 -0
  143. package/docs/errors/feature_already_exists.md +22 -0
  144. package/docs/errors/feature_disabled.md +22 -0
  145. package/docs/errors/feature_in_use.md +22 -0
  146. package/docs/errors/feature_not_found.md +22 -0
  147. package/docs/errors/feature_not_in_plan.md +22 -0
  148. package/docs/errors/forbidden.md +22 -0
  149. package/docs/errors/free_plan_change_not_supported.md +22 -0
  150. package/docs/errors/idempotency_in_progress.md +22 -0
  151. package/docs/errors/idempotency_key_mismatch.md +22 -0
  152. package/docs/errors/idempotency_unavailable.md +22 -0
  153. package/docs/errors/included_limit_reached.md +22 -0
  154. package/docs/errors/index.md +89 -0
  155. package/docs/errors/insufficient_balance.md +22 -0
  156. package/docs/errors/insufficient_credits.md +22 -0
  157. package/docs/errors/insufficient_seats.md +22 -0
  158. package/docs/errors/internal_error.md +22 -0
  159. package/docs/errors/invalid_json.md +22 -0
  160. package/docs/errors/invalid_subscription_status.md +22 -0
  161. package/docs/errors/invoice_not_found.md +22 -0
  162. package/docs/errors/market_group_in_use.md +22 -0
  163. package/docs/errors/market_group_not_found.md +22 -0
  164. package/docs/errors/market_in_use.md +22 -0
  165. package/docs/errors/market_not_found.md +22 -0
  166. package/docs/errors/missing_regional_price.md +22 -0
  167. package/docs/errors/model_not_found.md +22 -0
  168. package/docs/errors/no_active_subscription.md +22 -0
  169. package/docs/errors/no_change_requested.md +22 -0
  170. package/docs/errors/no_outstanding_invoice.md +22 -0
  171. package/docs/errors/no_payment_method.md +22 -0
  172. package/docs/errors/no_prices_configured.md +22 -0
  173. package/docs/errors/not_found.md +22 -0
  174. package/docs/errors/not_scheduled_for_cancellation.md +22 -0
  175. package/docs/errors/offer_not_applicable.md +22 -0
  176. package/docs/errors/offer_not_found.md +22 -0
  177. package/docs/errors/one_time_subscription_not_cancelable.md +22 -0
  178. package/docs/errors/organization_already_claimed.md +22 -0
  179. package/docs/errors/payment_failed.md +22 -0
  180. package/docs/errors/payment_method_not_found.md +22 -0
  181. package/docs/errors/payment_not_cancelable.md +22 -0
  182. package/docs/errors/payment_not_found.md +22 -0
  183. package/docs/errors/payouts_not_available_in_sandbox.md +22 -0
  184. package/docs/errors/plan_change_scheduled.md +22 -0
  185. package/docs/errors/plan_group_not_found.md +22 -0
  186. package/docs/errors/plan_not_found.md +22 -0
  187. package/docs/errors/plan_unavailable.md +22 -0
  188. package/docs/errors/plans_not_in_same_group.md +22 -0
  189. package/docs/errors/price_in_use.md +22 -0
  190. package/docs/errors/price_not_found.md +22 -0
  191. package/docs/errors/pricing_mode_mismatch.md +22 -0
  192. package/docs/errors/promo_code_expired.md +22 -0
  193. package/docs/errors/promo_code_not_found.md +22 -0
  194. package/docs/errors/provider_unsupported.md +22 -0
  195. package/docs/errors/rate_limited.md +22 -0
  196. package/docs/errors/sandbox_only.md +22 -0
  197. package/docs/errors/seat_limit_exceeded.md +22 -0
  198. package/docs/errors/subscription_activation_failed.md +22 -0
  199. package/docs/errors/subscription_already_canceled.md +22 -0
  200. package/docs/errors/subscription_cancel_failed.md +22 -0
  201. package/docs/errors/subscription_creation_failed.md +22 -0
  202. package/docs/errors/subscription_has_open_dispute.md +22 -0
  203. package/docs/errors/subscription_not_active.md +22 -0
  204. package/docs/errors/subscription_not_found.md +22 -0
  205. package/docs/errors/subscription_required.md +22 -0
  206. package/docs/errors/subscription_uncancel_failed.md +22 -0
  207. package/docs/errors/transaction_not_found.md +22 -0
  208. package/docs/errors/unauthorized.md +22 -0
  209. package/docs/errors/validation_error.md +22 -0
  210. package/docs/errors/webhook_not_found.md +22 -0
  211. package/docs/errors.md +34 -0
  212. package/docs/getting-started.md +35 -0
  213. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +22 -0
  214. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +20 -0
  215. package/docs/knowledge-base/how-do-discounts-work.md +65 -0
  216. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +88 -0
  217. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +77 -0
  218. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +20 -0
  219. package/docs/knowledge-base/how-do-trial-periods-work.md +54 -0
  220. package/docs/knowledge-base/how-does-billing-work.md +73 -0
  221. package/docs/knowledge-base/how-does-payment-routing-work.md +17 -0
  222. package/docs/knowledge-base/how-does-quota-based-billing-work.md +106 -0
  223. package/docs/knowledge-base/how-does-seat-based-billing-work.md +88 -0
  224. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +89 -0
  225. package/docs/knowledge-base/meta.json +29 -0
  226. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +110 -0
  227. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +40 -0
  228. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +74 -0
  229. package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +21 -0
  230. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +101 -0
  231. package/docs/manifest.json +1677 -0
  232. package/docs/meta.json +11 -0
  233. package/docs/platform-documentation.md +175 -0
  234. package/docs/schemas.md +995 -0
  235. package/docs/webhooks/addon-activated.md +44 -0
  236. package/docs/webhooks/addon-deactivated.md +40 -0
  237. package/docs/webhooks/balance-depleted.md +37 -0
  238. package/docs/webhooks/balance-low.md +39 -0
  239. package/docs/webhooks/balance-topped-up.md +41 -0
  240. package/docs/webhooks/checkout-ready.md +43 -0
  241. package/docs/webhooks/credits-depleted.md +35 -0
  242. package/docs/webhooks/credits-expired.md +35 -0
  243. package/docs/webhooks/credits-granted.md +37 -0
  244. package/docs/webhooks/credits-low.md +39 -0
  245. package/docs/webhooks/credits-purchased.md +41 -0
  246. package/docs/webhooks/customer-created.md +49 -0
  247. package/docs/webhooks/customer-state-changed.md +134 -0
  248. package/docs/webhooks/customer-updated.md +49 -0
  249. package/docs/webhooks/introduction.md +499 -0
  250. package/docs/webhooks/invoice-created.md +45 -0
  251. package/docs/webhooks/invoice-overdue.md +53 -0
  252. package/docs/webhooks/invoice-upcoming.md +43 -0
  253. package/docs/webhooks/invoice-voided.md +53 -0
  254. package/docs/webhooks/meta.json +78 -0
  255. package/docs/webhooks/payment-dispute-resolved.md +52 -0
  256. package/docs/webhooks/payment-disputed.md +49 -0
  257. package/docs/webhooks/payment-failed.md +37 -0
  258. package/docs/webhooks/payment-link-canceled.md +41 -0
  259. package/docs/webhooks/payment-link-completed.md +47 -0
  260. package/docs/webhooks/payment-link-created.md +41 -0
  261. package/docs/webhooks/payment-link-failed.md +45 -0
  262. package/docs/webhooks/payment-method-attached.md +40 -0
  263. package/docs/webhooks/payment-method-updated.md +38 -0
  264. package/docs/webhooks/payment-received.md +45 -0
  265. package/docs/webhooks/payment-recovered.md +39 -0
  266. package/docs/webhooks/payment-refunded.md +47 -0
  267. package/docs/webhooks/payment-retry-failed.md +39 -0
  268. package/docs/webhooks/payout-available.md +33 -0
  269. package/docs/webhooks/payout-created.md +48 -0
  270. package/docs/webhooks/payout-failed.md +52 -0
  271. package/docs/webhooks/payout-paid.md +48 -0
  272. package/docs/webhooks/quota-exceeded.md +44 -0
  273. package/docs/webhooks/quota-threshold-reached.md +41 -0
  274. package/docs/webhooks/seats-limit-reached.md +39 -0
  275. package/docs/webhooks/seats-updated.md +39 -0
  276. package/docs/webhooks/subscription-activated.md +43 -0
  277. package/docs/webhooks/subscription-canceled.md +57 -0
  278. package/docs/webhooks/subscription-cancellation-revoked.md +37 -0
  279. package/docs/webhooks/subscription-cancellation-scheduled.md +45 -0
  280. package/docs/webhooks/subscription-created.md +35 -0
  281. package/docs/webhooks/subscription-past-due.md +43 -0
  282. package/docs/webhooks/subscription-plan-change-revoked.md +50 -0
  283. package/docs/webhooks/subscription-plan-change-scheduled.md +55 -0
  284. package/docs/webhooks/subscription-plan-changed.md +43 -0
  285. package/docs/webhooks/subscription-reactivated.md +53 -0
  286. package/docs/webhooks/subscription-updated.md +39 -0
  287. package/docs/webhooks/trial-checkout-ready.md +39 -0
  288. package/docs/webhooks/trial-converted.md +39 -0
  289. package/docs/webhooks/trial-expired.md +39 -0
  290. package/docs/webhooks/trial-started.md +46 -0
  291. package/docs/webhooks/trial-will-end.md +41 -0
  292. package/docs/webhooks/usage-recorded.md +41 -0
  293. package/docs/webhooks.md +782 -0
  294. package/package.json +2 -1
@@ -0,0 +1,1024 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: CLI
4
+ description: The official command-line tool for Commet. Manage billing, forward webhooks, and automate your workflow from the terminal.
5
+ ---
6
+
7
+ > The official command-line tool for Commet. Manage billing, forward webhooks, and automate your workflow from the terminal.
8
+
9
+ ## Install
10
+
11
+ ### pnpm
12
+
13
+ ```bash
14
+ pnpm add -g commet
15
+ ```
16
+
17
+ ### npm
18
+
19
+ ```bash
20
+ npm install -g commet
21
+ ```
22
+
23
+ ### yarn
24
+
25
+ ```bash
26
+ yarn global add commet
27
+ ```
28
+
29
+ Requires Node.js 18+.
30
+
31
+ ## Authentication
32
+
33
+ **`commet login`**
34
+
35
+ Authenticate via browser. Opens a device-code flow and stores your token at `~/.commet/auth.json`.
36
+
37
+ ```bash
38
+ commet login
39
+ ```
40
+
41
+ In CI, set `COMMET_API_KEY` as an environment variable instead.
42
+
43
+ The CLI uses two kinds of credentials, depending on the command:
44
+
45
+ | Command type | Credential resolution |
46
+ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
47
+ | Resource commands (`customers`, `plans`, `subscriptions`, `usage`, …) | `COMMET_API_KEY` env var → project API key (auto-generated by `commet link`, stored in `.commet/config.json`) → error |
48
+ | Platform commands (`orgs`, `link`, `listen`, `create`) | `COMMET_API_KEY` env var → saved credentials from `commet login` |
49
+
50
+ Resource commands never fall back to your `commet login` credentials — without an API key from the environment or a linked project, they fail and point you to `commet link`.
51
+
52
+ ```bash
53
+ commet logout # Remove stored credentials
54
+ ```
55
+
56
+ ## Setup
57
+
58
+ **`commet agents setup`**
59
+
60
+ Prepare an existing repository for coding agents. The command preserves the rest of `AGENTS.md` and manages only its own delimited block, so it is safe to run again or remove later.
61
+
62
+ ```bash
63
+ commet agents setup
64
+ commet agents setup --check --output agent
65
+ ```
66
+
67
+ Use `--check --output agent` in automated workflows to verify that the managed instructions are current without rewriting the file.
68
+
69
+ **`commet doctor`**
70
+
71
+ Check the installed SDK, project configuration, agent instructions, and local environment before asking an agent to implement billing. Doctor is read-only: it does not contact Commet, modify files, or print secret values.
72
+
73
+ ```bash
74
+ commet doctor
75
+ commet doctor --output agent
76
+ ```
77
+
78
+ The agent output is compact and machine-readable enough to paste into an implementation task. For version-specific SDK guidance, start at `node_modules/@commet/node/docs/README.md`.
79
+
80
+ **`commet link`**
81
+
82
+ Link this project to a Commet organization. Re-run to switch organizations.
83
+
84
+ ```bash
85
+ commet link
86
+ ```
87
+
88
+ ```bash
89
+ commet link --org acme # By slug or ID
90
+ commet link --clear # Unlink project
91
+ ```
92
+
93
+ | Flag | Required | Description |
94
+ | -------------------- | -------- | ---------------------------------------------------- |
95
+ | `--org <slug-or-id>` | No | Organization slug or ID. Skips interactive selection |
96
+ | `--clear` | No | Unlink project from its organization |
97
+
98
+ **`commet pull`**
99
+
100
+ Fetch your billing config and generate `commet.config.ts` with typed features and plans.
101
+
102
+ ```bash
103
+ commet pull
104
+ ```
105
+
106
+ ```bash
107
+ commet pull --dry-run # Preview changes without writing
108
+ commet pull --yes # Skip confirmation
109
+ ```
110
+
111
+ | Flag | Required | Description |
112
+ | ----------- | -------- | ------------------------------------------------ |
113
+ | `--dry-run` | No | Show what would change without writing any files |
114
+ | `-y, --yes` | No | Skip confirmation prompt |
115
+
116
+ After `commet pull`, your SDK calls get autocomplete for plan codes and feature codes.
117
+
118
+ **`commet push`**
119
+
120
+ Push your local `commet.config.ts` to Commet. Creates or updates features and plans to match your config.
121
+
122
+ ```bash
123
+ commet push
124
+ ```
125
+
126
+ ```bash
127
+ commet push --dry-run # Preview what would change on remote
128
+ commet push --yes # Push without confirmation
129
+ ```
130
+
131
+ | Flag | Required | Description |
132
+ | ----------- | -------- | -------------------------------------- |
133
+ | `--dry-run` | No | Show what would change without pushing |
134
+ | `-y, --yes` | No | Skip confirmation prompt |
135
+
136
+ > **Warning**
137
+ >
138
+ > Feature type changes (`boolean` to `usage`, etc.) are blocked via push. Change them in the dashboard.
139
+
140
+ **`commet create`**
141
+
142
+ Scaffold a new Commet project from a template. Creates plans and features in your sandbox organization, generates an API key, and links the project.
143
+
144
+ ```bash
145
+ commet create
146
+ ```
147
+
148
+ ```bash
149
+ commet create myapp -t metered --org acme -y
150
+ commet create --list # List available templates
151
+ ```
152
+
153
+ | Flag | Required | Description |
154
+ | ----------------------- | -------- | ------------------------------------------------------------------------------- |
155
+ | `-t, --template <name>` | No | Template: `fixed`, `seats`, `metered`, `credits`, `balance-ai`, `balance-fixed` |
156
+ | `--org <slug>` | No | Sandbox organization slug or ID |
157
+ | `--skills` | No | Install agent skills |
158
+ | `--no-skills` | No | Skip agent skills installation |
159
+ | `-y, --yes` | No | Accept defaults for optional prompts |
160
+ | `--ref <ref>` | No | Git ref to fetch templates from. Default: `main` |
161
+
162
+ **`commet listen`**
163
+
164
+ Forward webhook events from Commet to your local server. No ngrok or external tunneling needed.
165
+
166
+ ```bash
167
+ commet listen 3000
168
+ ```
169
+
170
+ The argument accepts a port, host:port, or full URL:
171
+
172
+ ```bash
173
+ commet listen 3000 # http://localhost:3000/
174
+ commet listen localhost:3000/webhooks # http://localhost:3000/webhooks
175
+ commet listen http://local.commet.co:3010/api # http://local.commet.co:3010/api
176
+ ```
177
+
178
+ Filter by event type:
179
+
180
+ ```bash
181
+ commet listen 3000 --events invoice.created,subscription.activated
182
+ ```
183
+
184
+ | Flag | Required | Description |
185
+ | ------------------ | -------- | ------------------------------------------------- |
186
+ | `<url>` | Yes | Target URL: port (`3000`), host:port, or full URL |
187
+ | `--events <types>` | No | Comma-separated event types to forward |
188
+
189
+ ```
190
+ ✓ Authenticated (org: Acme Inc)
191
+ ✓ Connected to Commet webhook stream
192
+ ⟶ Forwarding to http://localhost:3000/
193
+ ⟶ Signing secret: whsec_...
194
+
195
+ Ready! Listening for webhook events...
196
+
197
+ 14:32:01 customer.created → 200 OK (12ms)
198
+ 14:32:05 subscription.updated → 200 OK (8ms)
199
+ ```
200
+
201
+ The session stays open until `Ctrl+C`. Events are signed with the displayed secret.
202
+
203
+ ```bash
204
+ commet orgs # List all organizations (name, slug, mode)
205
+ ```
206
+
207
+ ## Customers
208
+
209
+ Create and manage customers, retrieve details, and handle batch operations.
210
+
211
+ **`commet customers create`**
212
+
213
+ Create a customer.
214
+
215
+ ```bash
216
+ commet customers create --email user@acme.com --id user_123
217
+ ```
218
+
219
+ ```bash
220
+ commet customers create \
221
+ --email billing@corp.com \
222
+ --full-name "Acme Corp" \
223
+ --metadata '{"plan":"enterprise"}'
224
+ ```
225
+
226
+ | Flag | Required | Description |
227
+ | ------------------------ | -------- | ----------------------------------------------------- |
228
+ | `--email <email>` | Yes | Billing email |
229
+ | `--id <id>` | No | Custom customer ID |
230
+ | `--external-id <id>` | No | ID from your system |
231
+ | `--full-name <name>` | No | Full name |
232
+ | `--tax-document <value>` | No | Tax document |
233
+ | `--timezone <tz>` | No | Timezone |
234
+ | `--metadata <json>` | No | Metadata as JSON object |
235
+ | `--address <json>` | No | Address as JSON: `{line1, city, postalCode, country}` |
236
+ | `--address-id <id>` | No | Existing customer address ID |
237
+
238
+ ```bash
239
+ commet customers get --id cus_xxx # Get a customer by ID
240
+ commet customers update --id cus_xxx --email new@acme.com # Update a customer
241
+ commet customers list # List all customers
242
+ commet customers list --limit 25 --cursor cur_xxx # Paginate
243
+ commet customers list --external-id user_123 # Find by external ID
244
+ commet customers create-batch --customers '[{"email":"a@co.com"},{"email":"b@co.com"}]'
245
+ ```
246
+
247
+ ## Subscriptions
248
+
249
+ Create, cancel, and manage subscriptions. Change plans, activate addons, and handle balance operations.
250
+
251
+ **`commet subscriptions create`**
252
+
253
+ Create a subscription for a customer.
254
+
255
+ ```bash
256
+ commet subscriptions create \
257
+ --customer-id user_123 \
258
+ --plan-code pro \
259
+ --billing-interval monthly
260
+ ```
261
+
262
+ ```bash
263
+ commet subscriptions create \
264
+ --customer-id user_123 \
265
+ --plan-id pln_xxx \
266
+ --price-id pp_argentina \
267
+ --billing-interval yearly \
268
+ --initial-seats '{"team_member":5}' \
269
+ --skip-trial true
270
+ ```
271
+
272
+ | Flag | Required | Description |
273
+ | ------------------------------- | ------------------------------ | --------------------------------------------------------------------------------- |
274
+ | `--customer-id <id>` | Yes | Customer ID |
275
+ | `--plan-code <code>` | One of `plan-code` / `plan-id` | Plan code |
276
+ | `--plan-id <id>` | One of `plan-code` / `plan-id` | Plan ID |
277
+ | `--billing-interval <interval>` | No | `weekly`, `monthly`, `quarterly`, `yearly`, `one_time` |
278
+ | `--price-id <id>` | No | Selectable plan price. Omit it to use the interval default and its market pricing |
279
+ | `--initial-seats <json>` | No | Initial seats as JSON: `{featureCode: count}` |
280
+ | `--skip-trial <bool>` | No | Skip trial period |
281
+ | `--custom-trial-days <n>` | No | Override the catalog trial duration |
282
+ | `--offer-id <id>` | No | Apply an Offer directly. Cannot be combined with `promo-code` or a custom trial |
283
+ | `--promo-code <code>` | No | Apply the Offer referenced by a customer-entered code |
284
+ | `--provider <provider>` | No | Initial checkout provider override: `stripe`, `commet`, or `dlocal` |
285
+ | `--name <name>` | No | Subscription name |
286
+ | `--start-date <date>` | No | Start date (ISO 8601) |
287
+ | `--success-url <url>` | No | Redirect URL after successful checkout |
288
+
289
+ **`commet subscriptions cancel`**
290
+
291
+ Cancel a subscription. Cancels at period end by default.
292
+
293
+ ```bash
294
+ commet subscriptions cancel --id sub_xxx
295
+ ```
296
+
297
+ ```bash
298
+ commet subscriptions cancel --id sub_xxx --immediate true --reason "Customer requested"
299
+ ```
300
+
301
+ | Flag | Required | Description |
302
+ | -------------------- | -------- | ------------------------------------------- |
303
+ | `--id <id>` | Yes | Subscription ID |
304
+ | `--reason <reason>` | No | Cancellation reason |
305
+ | `--immediate <bool>` | No | Cancel immediately instead of at period end |
306
+
307
+ ```bash
308
+ commet subscriptions get-active --customer-id user_123 # Get active subscription
309
+ commet subscriptions uncancel --id sub_xxx # Revert pending cancellation
310
+ commet subscriptions reactivate --id sub_xxx --offer-id ofr_xxx # Reactivate a canceled subscription with a direct Offer
311
+ commet subscriptions change-plan --id sub_xxx --new-plan-id pln_xxx --new-billing-interval yearly # Change plan
312
+ commet subscriptions list # List all subscriptions
313
+ commet subscriptions list --customer-id user_123 --status active # Filter by customer/status
314
+ commet subscriptions preview-change --id sub_xxx --plan-id pln_xxx --billing-interval yearly # Preview proration
315
+ commet subscriptions activate-addon --id sub_xxx --addon-id adn_xxx
316
+ commet subscriptions deactivate-addon --id sub_xxx --addon-id adn_xxx
317
+ commet subscriptions adjust-balance --id sub_xxx --amount 1000 --type balance --reason "Courtesy credit"
318
+ commet subscriptions topup-balance --id sub_xxx --amount 5000
319
+ commet subscriptions purchase-credits --id sub_xxx --credit-pack-id cpk_xxx
320
+ ```
321
+
322
+ ## Plans
323
+
324
+ Create plans, attach features and prices, and configure regional pricing.
325
+
326
+ **`commet plans create`**
327
+
328
+ Create a plan.
329
+
330
+ ```bash
331
+ commet plans create --name "Pro" --code pro
332
+ ```
333
+
334
+ ```bash
335
+ commet plans create \
336
+ --name "Developer" \
337
+ --code developer \
338
+ --consumption-model metered \
339
+ --is-public true \
340
+ --block-on-exhaustion true
341
+ ```
342
+
343
+ | Flag | Required | Description |
344
+ | ------------------------------ | -------- | ------------------------------------------ |
345
+ | `--name <name>` | Yes | Plan name |
346
+ | `--code <code>` | Yes | Plan code |
347
+ | `--description <desc>` | No | Plan description |
348
+ | `--consumption-model <model>` | No | `metered`, `credits`, or `balance` |
349
+ | `--is-public <bool>` | No | Whether plan is publicly visible |
350
+ | `--is-free <bool>` | No | Whether plan is free |
351
+ | `--block-on-exhaustion <bool>` | No | Block usage when balance/credits exhausted |
352
+ | `--plan-group-id <id>` | No | Plan group ID |
353
+ | `--metadata <json>` | No | Metadata as JSON object |
354
+
355
+ **`commet plans add-feature`**
356
+
357
+ Add a feature to a plan with pricing and limits.
358
+
359
+ ```bash
360
+ commet plans add-feature \
361
+ --plan-id pln_xxx \
362
+ --feature-id ftr_xxx \
363
+ --included-amount 1000 \
364
+ --overage-enabled true \
365
+ --overage-unit-price 100
366
+ ```
367
+
368
+ ```bash
369
+ commet plans add-feature \
370
+ --plan-id pln_xxx \
371
+ --feature-id ftr_xxx \
372
+ --pricing-mode ai_model \
373
+ --margin 30
374
+ ```
375
+
376
+ | Flag | Required | Description |
377
+ | -------------------------- | -------- | -------------------------------------- |
378
+ | `--plan-id <id>` | Yes | Plan ID |
379
+ | `--feature-id <id>` | Yes | Feature ID |
380
+ | `--enabled <bool>` | No | Whether feature is enabled |
381
+ | `--included-amount <n>` | No | Included usage amount |
382
+ | `--unlimited <bool>` | No | Unlimited usage |
383
+ | `--overage-enabled <bool>` | No | Enable overage billing |
384
+ | `--overage-unit-price <n>` | No | Overage price per unit (fixed pricing) |
385
+ | `--pricing-mode <mode>` | No | `fixed` or `ai_model` |
386
+ | `--margin <n>` | No | Margin percentage (ai\_model pricing) |
387
+ | `--credits-per-unit <n>` | No | Credits per unit |
388
+
389
+ **`commet plans add-price`**
390
+
391
+ Add a price to a plan.
392
+
393
+ ```bash
394
+ commet plans add-price \
395
+ --plan-id pln_xxx \
396
+ --billing-interval monthly \
397
+ --price 2900
398
+ ```
399
+
400
+ ```bash
401
+ commet plans add-price \
402
+ --plan-id pln_xxx \
403
+ --billing-interval yearly \
404
+ --price 29000 \
405
+ --trial-days 14
406
+ ```
407
+
408
+ | Flag | Required | Description |
409
+ | ------------------------------- | ----------------------------------------- | ----------------------------------------------------------- |
410
+ | `--plan-id <id>` | Yes | Plan ID |
411
+ | `--billing-interval <interval>` | Yes | `weekly`, `monthly`, `quarterly`, `yearly`, `one_time` |
412
+ | `--price <n>` | One of `price` / `inherits-from-price-id` | Base price in the currency's minor unit |
413
+ | `--inherits-from-price-id <id>` | One of `price` / `inherits-from-price-id` | Base price inherited by a selectable variant |
414
+ | `--trial-days <n>` | No | Trial period in days |
415
+ | `--is-default <bool>` | No | Set as default price |
416
+ | `--included-balance <n>` | No | Included balance amount |
417
+ | `--included-credits <n>` | No | Included credits amount |
418
+ | `--market-prices <json>` | Required for a variant | Market prices as `{marketGroupId, currency, price}` objects |
419
+ | `--metadata <json>` | No | Price metadata |
420
+
421
+ Create a selectable variant that changes only Argentina and inherits the rest of the base price:
422
+
423
+ ```bash
424
+ commet plans add-price \
425
+ --plan-id pln_xxx \
426
+ --billing-interval monthly \
427
+ --inherits-from-price-id pp_base \
428
+ --market-prices '[{"marketGroupId":"pmg_argentina","currency":"ars","price":1500000}]'
429
+ ```
430
+
431
+ ```bash
432
+ commet plans list # List all plans
433
+ commet plans list --include-private true # Include private plans
434
+ commet plans get --id pro # Get plan details
435
+ commet plans update --id pln_xxx --name "Pro Plus" --description "For growing teams" --metadata '{}' --is-public true # Update a plan
436
+ commet plans delete --id pln_xxx # Delete a plan
437
+ commet plans set-visibility --id pln_xxx --is-public false
438
+ commet plans update-feature --plan-id pln_xxx --feature-id ftr_xxx --included-amount 2000
439
+ commet plans remove-feature --plan-id pln_xxx --feature-id ftr_xxx
440
+ commet plans update-price --plan-id pln_xxx --price-id pp_xxx --price 3900
441
+ commet plans delete-price --plan-id pln_xxx --price-id pp_xxx
442
+ commet plans set-default-price --plan-id pln_xxx --price-id pp_xxx
443
+ ```
444
+
445
+ ### Regional prices
446
+
447
+ Set local currency overrides for a price.
448
+
449
+ ```bash
450
+ commet plans set-regional-prices \
451
+ --plan-id pln_xxx \
452
+ --price-id pp_xxx \
453
+ --overrides '[{"currency":"EUR","price":2700},{"currency":"BRL","price":14900}]'
454
+ ```
455
+
456
+ ```bash
457
+ commet plans delete-regional-prices --plan-id pln_xxx --price-id pp_xxx
458
+ ```
459
+
460
+ ## Features
461
+
462
+ Manage the organization's feature catalog.
463
+
464
+ **`commet features create`**
465
+
466
+ Create a feature.
467
+
468
+ ```bash
469
+ commet features create --code api_calls --name "API Calls" --type usage --unit-name calls
470
+ ```
471
+
472
+ | Flag | Required | Description |
473
+ | ---------------------- | -------- | --------------------------------------- |
474
+ | `--code <code>` | Yes | Feature code |
475
+ | `--name <name>` | Yes | Feature name |
476
+ | `--type <type>` | Yes | `boolean`, `usage`, `seats`, or `quota` |
477
+ | `--description <desc>` | No | Feature description |
478
+ | `--unit-name <name>` | No | Unit name for metered features |
479
+
480
+ ```bash
481
+ commet features list # List the feature catalog
482
+ commet features get --code api_calls # Get a feature definition
483
+ commet features update --code api_calls --name "API Requests" --description "HTTP API calls" --unit-name requests # Update a feature
484
+ commet features delete --code api_calls # Delete a feature
485
+ ```
486
+
487
+ ## Feature Access
488
+
489
+ Check a customer's feature access and usage.
490
+
491
+ ```bash
492
+ commet feature-access list --customer-id user_123 # List feature access for a customer
493
+ commet feature-access get --customer-id user_123 --code api_calls # Get feature access details
494
+ ```
495
+
496
+ Use `commet usage check --customer-id user_123 --feature-code api_calls --quantity 1` for a prospective consumption decision.
497
+
498
+ ## Seats
499
+
500
+ Manage seat allocations for per-seat billing.
501
+
502
+ **`commet seats add`**
503
+
504
+ Add seats for a customer.
505
+
506
+ ```bash
507
+ commet seats add --customer-id user_123 --feature-code team_member
508
+ ```
509
+
510
+ ```bash
511
+ commet seats add --customer-id user_123 --feature-code team_member --count 5
512
+ ```
513
+
514
+ | Flag | Required | Description |
515
+ | ----------------------- | -------- | ------------------------------------ |
516
+ | `--customer-id <id>` | Yes | Customer ID |
517
+ | `--feature-code <code>` | Yes | Feature code |
518
+ | `--count <n>` | No | Number of seats to add. Default: `1` |
519
+
520
+ ```bash
521
+ commet seats remove --customer-id user_123 --feature-code team_member
522
+ commet seats set --customer-id user_123 --feature-code team_member --count 10
523
+ commet seats set-all --customer-id user_123 --seats '{"team_member":5,"admin":2}'
524
+ commet seats get-balance --customer-id user_123 --feature-code team_member
525
+ commet seats get-all-balances --customer-id user_123
526
+ ```
527
+
528
+ ## Usage
529
+
530
+ Track consumption events and check remaining allowance.
531
+
532
+ **`commet usage track`**
533
+
534
+ Track a usage event. Supports value-based tracking and AI model token tracking.
535
+
536
+ ```bash
537
+ commet usage track --feature-code api_calls --customer-id user_123 --value 1
538
+ ```
539
+
540
+ ```bash
541
+ commet usage track \
542
+ --feature-code gpt-4o \
543
+ --customer-id user_123 \
544
+ --model gpt-4o \
545
+ --input-tokens 500 \
546
+ --output-tokens 150 \
547
+ --cache-read-tokens 200
548
+ ```
549
+
550
+ | Flag | Required | Description |
551
+ | -------------------------- | ------------------------ | ------------------------------------------------------------------------------------- |
552
+ | `--feature-code <code>` | Yes | Feature code |
553
+ | `--customer-id <id>` | Yes | Customer ID |
554
+ | `--value <n>` | One of `value` / `model` | Usage value (standard tracking) |
555
+ | `--model <model>` | One of `value` / `model` | AI model name (token tracking) |
556
+ | `--input-tokens <n>` | No | Input tokens (model tracking) |
557
+ | `--output-tokens <n>` | No | Output tokens (model tracking) |
558
+ | `--cache-read-tokens <n>` | No | Cache read tokens (model tracking) |
559
+ | `--cache-write-tokens <n>` | No | Cache write tokens (model tracking) |
560
+ | `--event-id <id>` | No | Caller-owned event ID for deduplication. Max 200 characters |
561
+ | `--timestamp <ts>` | No | Event timestamp (ISO 8601) |
562
+ | `--properties <json>` | No | Event properties as a JSON array of `{ "property": string, "value": string }` entries |
563
+
564
+ ```bash
565
+ commet usage check --customer-id user_123 --feature-code api_calls --quantity 1
566
+ ```
567
+
568
+ ## Addons
569
+
570
+ Create and manage purchasable feature extensions.
571
+
572
+ **`commet addons create`**
573
+
574
+ Create an addon.
575
+
576
+ ```bash
577
+ commet addons create \
578
+ --name "Extra Storage" \
579
+ --base-price 500 \
580
+ --feature-id ftr_xxx \
581
+ --consumption-model metered
582
+ ```
583
+
584
+ ```bash
585
+ commet addons create \
586
+ --name "Priority Support" \
587
+ --base-price 2900 \
588
+ --feature-id ftr_xxx \
589
+ --consumption-model boolean
590
+ ```
591
+
592
+ | Flag | Required | Description |
593
+ | ----------------------------- | -------- | --------------------------------------------- |
594
+ | `--name <name>` | Yes | Addon name |
595
+ | `--base-price <n>` | Yes | Base price in cents |
596
+ | `--feature-id <id>` | Yes | Feature ID |
597
+ | `--consumption-model <model>` | Yes | `boolean`, `metered`, `credits`, or `balance` |
598
+ | `--description <desc>` | No | Addon description |
599
+ | `--included-units <n>` | No | Included units (metered) |
600
+ | `--overage-rate <n>` | No | Overage rate (metered/balance) |
601
+ | `--credit-cost <n>` | No | Credit cost (credits) |
602
+
603
+ ```bash
604
+ commet addons list # List all addons
605
+ commet addons list --limit 25 --cursor cur_xxx # Paginate
606
+ commet addons get --id adn_xxx # Get addon details
607
+ commet addons update --id adn_xxx --name "Extra Storage Pro" --description "100GB extra" --base-price 900 --included-units 100 --overage-rate 10 # Update an addon
608
+ commet addons delete --id adn_xxx # Delete an addon
609
+ commet addons list-active --customer-id user_123 # List active addons for a customer
610
+ ```
611
+
612
+ ## Credit Packs
613
+
614
+ Create and manage credit packs for credit-based plans.
615
+
616
+ ```bash
617
+ commet credit-packs create --name "500 Credits" --credits 500 --price 4900
618
+ commet credit-packs list # List all credit packs
619
+ commet credit-packs update --id cpk_xxx --price 3900 # Update a credit pack
620
+ commet credit-packs delete --id cpk_xxx # Delete a credit pack
621
+ ```
622
+
623
+ | Flag | Required | Description |
624
+ | ---------------------- | ------------ | ----------------------------- |
625
+ | `--name <name>` | Yes (create) | Credit pack name |
626
+ | `--credits <n>` | Yes (create) | Number of credits |
627
+ | `--price <n>` | Yes (create) | Price in cents |
628
+ | `--description <desc>` | No | Credit pack description |
629
+ | `--is-active <bool>` | No | Whether credit pack is active |
630
+
631
+ ## Plan Groups
632
+
633
+ Organize plans into groups for pricing tables and the customer portal.
634
+
635
+ ```bash
636
+ commet plan-groups create --name "Main Plans" --description "Primary pricing tiers" --is-public true
637
+ commet plan-groups list # List all plan groups
638
+ commet plan-groups list --limit 25 --cursor cur_xxx # Paginate
639
+ commet plan-groups get --id plg_xxx # Get plan group details
640
+ commet plan-groups add-plan --id plg_xxx --plan-id pln_xxx --sort-order 1
641
+ commet plan-groups remove-plan --id plg_xxx --plan-id pln_xxx
642
+ commet plan-groups reorder-plans --id plg_xxx --plan-ids '["pln_a","pln_b","pln_c"]'
643
+ commet plan-groups update --id plg_xxx --name "Updated Plans" --description "New description" --is-public false
644
+ commet plan-groups delete --id plg_xxx # Delete a plan group
645
+ ```
646
+
647
+ ## Invoices
648
+
649
+ List invoices, download PDFs, and create adjustments.
650
+
651
+ **`commet invoices create-adjustment`**
652
+
653
+ Create an adjustment invoice. Use a negative amount for credits.
654
+
655
+ ```bash
656
+ commet invoices create-adjustment \
657
+ --customer-id cus_xxx \
658
+ --amount -500 \
659
+ --description "Courtesy credit"
660
+ ```
661
+
662
+ | Flag | Required | Description |
663
+ | ---------------------- | -------- | ------------------------------------ |
664
+ | `--customer-id <id>` | Yes | Customer ID |
665
+ | `--amount <n>` | Yes | Amount in cents. Negative for credit |
666
+ | `--description <desc>` | No | Adjustment description |
667
+ | `--metadata <json>` | No | Metadata as JSON object |
668
+
669
+ ```bash
670
+ commet invoices list # List all invoices
671
+ commet invoices list --limit 25 --cursor cur_xxx # Paginate
672
+ commet invoices list --subscription-id sub_xxx # Filter by subscription
673
+ commet invoices list --customer-id cus_xxx --status paid # Filter by customer/status
674
+ commet invoices get --id inv_xxx # Get invoice details
675
+ commet invoices get-download-url --id inv_xxx # Get signed PDF URL
676
+ commet invoices send --id inv_xxx # Send invoice by email
677
+ commet invoices update-status --id inv_xxx --status void # Update status (paid, void)
678
+ ```
679
+
680
+ ## Payments
681
+
682
+ Create hosted payment links and charge saved payment methods. One-time payments, no subscription or plan required. See [Accept One-Time Payments](/docs/accept-one-time-payments) for the full lifecycle.
683
+
684
+ **`commet payments create`**
685
+
686
+ Create a hosted payment link. The customer opens the returned `url` and pays with any card.
687
+
688
+ ```bash
689
+ commet payments create \
690
+ --amount 25000 \
691
+ --currency usd \
692
+ --description "Annual report"
693
+ ```
694
+
695
+ ```bash
696
+ commet payments create \
697
+ --amount 25000 \
698
+ --currency usd \
699
+ --description "Annual report" \
700
+ --customer-id user_123 \
701
+ --success-url https://yourapp.com/thanks
702
+ ```
703
+
704
+ | Flag | Required | Description |
705
+ | ----------------------- | -------- | ----------------------------------------------- |
706
+ | `--amount <n>` | Yes | Amount in cents |
707
+ | `--currency <currency>` | Yes | Currency code (e.g. `usd`) |
708
+ | `--description <desc>` | Yes | Shown on the payment link, invoice, and receipt |
709
+ | `--customer-id <id>` | No | Customer ID |
710
+ | `--success-url <url>` | No | Redirect URL after successful payment |
711
+ | `--metadata <json>` | No | Metadata as JSON object |
712
+
713
+ ```bash
714
+ commet payments charge --customer-id user_123 --amount 25000 --currency usd --description "Annual report" # Charge a vaulted payment method off-session
715
+ commet payments get --id pay_xxx # Get payment details
716
+ commet payments list --customer-id user_123 --limit 20 # List payments
717
+ commet payments cancel --id pay_xxx # Cancel a pending payment link
718
+ ```
719
+
720
+ ## Transactions
721
+
722
+ List transactions, process refunds, and retry failed payments.
723
+
724
+ ```bash
725
+ commet transactions list # List all transactions
726
+ commet transactions list --limit 20 --cursor cur_xxx # Paginate
727
+ commet transactions list --status succeeded # Filter by status
728
+ commet transactions list --customer-email user@acme.com # Filter by customer email
729
+ commet transactions get --id txn_xxx # Get transaction details
730
+ commet transactions refund --id txn_xxx # Full refund
731
+ commet transactions retry --id txn_xxx # Retry failed payment
732
+ ```
733
+
734
+ ## Offers
735
+
736
+ Create reusable Offers independently from plans and distribution channels.
737
+
738
+ ```bash
739
+ commet offers create \
740
+ --name "14 days free, then 25% off" \
741
+ --phases '[{"type":"free_trial","durationDays":14},{"type":"percentage","percentage":2500,"durationCycles":3}]'
742
+ ```
743
+
744
+ `percentage` uses basis points, so `2500` means 25%. Other phase types are `free_trial`, `amount_off`, and `fixed_price`.
745
+
746
+ ```bash
747
+ commet offers list --active true
748
+ commet offers get --id ofr_xxx
749
+ commet offers update --id ofr_xxx --name "Launch offer" --phases '[{"type":"fixed_price","prices":[{"currency":"usd","amount":900}],"durationCycles":2}]'
750
+ commet offers delete --id ofr_xxx
751
+ ```
752
+
753
+ An Offer does not contain `purpose` or plan-price associations. Attach a compatible Offer to a base price in the Dashboard for automatic introductory selection, pass its ID directly as `offerId`, or reference a single-discount Offer from a Promo Code.
754
+
755
+ ## Promo Codes
756
+
757
+ Create and manage customer-entered distribution codes for Offers.
758
+
759
+ **`commet promo-codes create`**
760
+
761
+ Create a promo code.
762
+
763
+ ```bash
764
+ commet promo-codes create \
765
+ --code SUMMER25 \
766
+ --offer-id ofr_summer25 \
767
+ --max-redemptions 100
768
+ ```
769
+
770
+ ```bash
771
+ commet promo-codes create \
772
+ --code ANNUAL \
773
+ --offer-id ofr_annual \
774
+ --billing-interval yearly \
775
+ --plan-ids '["pln_pro","pln_team"]' \
776
+ --expires-at 2026-12-31
777
+ ```
778
+
779
+ | Flag | Required | Description |
780
+ | ------------------------------- | -------- | ------------------------------------------------------------ |
781
+ | `--code <code>` | Yes | Promo code string |
782
+ | `--offer-id <id>` | Yes | Offer ID with exactly one `percentage` or `amount_off` phase |
783
+ | `--billing-interval <interval>` | No | Restrict redemption to one billing interval |
784
+ | `--max-redemptions <n>` | No | Maximum number of redemptions |
785
+ | `--expires-at <date>` | No | Expiration date (ISO 8601) |
786
+ | `--plan-ids <json>` | No | Restrict to specific plan IDs (JSON array) |
787
+
788
+ ```bash
789
+ commet promo-codes list # List all promo codes
790
+ commet promo-codes list --limit 25 --cursor cur_xxx # Paginate
791
+ commet promo-codes get --id prc_xxx # Get promo code details
792
+ commet promo-codes update --id prc_xxx --active false --max-redemptions 50 --expires-at 2026-12-31 --plan-ids '["pln_pro"]' # Update
793
+ ```
794
+
795
+ ## Markets
796
+
797
+ Define reusable country groups, then reference them from `--market-prices` when creating or updating plan prices.
798
+
799
+ ```bash
800
+ commet markets create \
801
+ --name "Argentina" \
802
+ --country-codes '["AR"]'
803
+
804
+ commet markets list
805
+ commet markets get --id pmg_argentina
806
+ commet markets update --id pmg_argentina --name "Southern Cone" --country-codes '["AR","BO","PY","UY"]'
807
+ commet markets delete --id pmg_argentina
808
+ ```
809
+
810
+ ## Webhooks
811
+
812
+ Create and test webhook endpoints.
813
+
814
+ **`commet webhooks create`**
815
+
816
+ Create a webhook endpoint.
817
+
818
+ ```bash
819
+ commet webhooks create \
820
+ --url https://example.com/webhooks \
821
+ --events '["subscription.activated","payment.received"]'
822
+ ```
823
+
824
+ | Flag | Required | Description |
825
+ | ---------------------- | -------- | ----------------------------------- |
826
+ | `--url <url>` | Yes | Webhook URL |
827
+ | `--events <json>` | Yes | Events to subscribe to (JSON array) |
828
+ | `--description <desc>` | No | Webhook description |
829
+
830
+ > **Note**
831
+ >
832
+ > For local development, use [`commet listen`](#setup) instead of creating a webhook endpoint.
833
+
834
+ ```bash
835
+ commet webhooks list # List all webhook endpoints
836
+ commet webhooks list --limit 25 --cursor cur_xxx # Paginate
837
+ commet webhooks delete --id whe_xxx # Delete endpoint
838
+ commet webhooks test --id whe_xxx # Send a test event
839
+ ```
840
+
841
+ ## Provisioning
842
+
843
+ Issue a fresh claim link for a headlessly provisioned organization that has not been claimed yet. The command uses that organization's API key; it cannot issue a link after a human has claimed the organization.
844
+
845
+ ```bash
846
+ commet provisioning create-claim-link \
847
+ --idempotency-key claim-acme-2026-08-16
848
+ ```
849
+
850
+ Use the same idempotency key when retrying the same request. Give the returned URL to the intended human owner; do not publish it or store it in source control.
851
+
852
+ ## API Keys
853
+
854
+ Create and manage API keys.
855
+
856
+ ```bash
857
+ commet api-keys create --name "Production" --expires-in-days 365
858
+ commet api-keys list # List all API keys
859
+ commet api-keys list --limit 25 --cursor cur_xxx # Paginate
860
+ commet api-keys delete --id key_xxx # Delete an API key
861
+ ```
862
+
863
+ | Flag | Required | Description |
864
+ | ----------------------- | ------------ | ------------------ |
865
+ | `--name <name>` | Yes (create) | API key name |
866
+ | `--expires-in-days <n>` | No | Expiration in days |
867
+
868
+ ## Portal
869
+
870
+ Generate a portal URL for customer self-service.
871
+
872
+ ```bash
873
+ commet portal get-url --customer-id user_123
874
+ commet portal get-url --email user@acme.com
875
+ ```
876
+
877
+ Provide either `--customer-id` or `--email`.
878
+
879
+ ## Payouts
880
+
881
+ Manage payout bank accounts and request payouts. Payout commands require a live organization API key; sandbox keys return `payouts_not_available_in_sandbox`.
882
+
883
+ **`commet payouts request`**
884
+
885
+ Request a payout of available balance.
886
+
887
+ ```bash
888
+ commet payouts request --amount 50000 --description "Weekly payout"
889
+ ```
890
+
891
+ | Flag | Required | Description |
892
+ | ---------------------- | -------- | ----------------------------------- |
893
+ | `--amount <n>` | Yes | Amount in cents (USD, minimum 1000) |
894
+ | `--description <desc>` | No | Payout description |
895
+
896
+ **`commet payouts add-bank-account`**
897
+
898
+ Add a destination bank account to the payout account.
899
+
900
+ ```bash
901
+ commet payouts add-bank-account \
902
+ --account-number 000123456789 \
903
+ --account-holder-name "Acme Inc." \
904
+ --routing-number 110000000 \
905
+ --account-type checking \
906
+ --set-default true
907
+ ```
908
+
909
+ | Flag | Required | Description |
910
+ | ------------------------------ | -------- | --------------------------- |
911
+ | `--account-number <number>` | Yes | Bank account number |
912
+ | `--account-holder-name <name>` | Yes | Account holder name |
913
+ | `--routing-number <number>` | No | Routing number |
914
+ | `--account-type <type>` | No | `checking` or `savings` |
915
+ | `--set-default <bool>` | No | Set as default bank account |
916
+
917
+ ## Test Clock
918
+
919
+ Control the sandbox test clock to simulate the passage of time.
920
+
921
+ > **Warning**
922
+ >
923
+ > **Sandbox only.** Test clock commands fail against live organizations.
924
+
925
+ **`commet test-clock advance`**
926
+
927
+ Move the test clock forward and process every billing deadline due before the target time.
928
+
929
+ ```bash
930
+ commet test-clock advance --advance-days 30
931
+ ```
932
+
933
+ ```bash
934
+ commet test-clock advance --frozen-time 2026-07-01T00:00:00Z
935
+ ```
936
+
937
+ | Flag | Required | Description |
938
+ | -------------------- | ------------------------------------- | -------------------------------------- |
939
+ | `--advance-days <n>` | One of `advance-days` / `frozen-time` | Days to move the clock forward |
940
+ | `--frozen-time <ts>` | One of `advance-days` / `frozen-time` | Absolute instant to move to (ISO 8601) |
941
+
942
+ ```bash
943
+ commet test-clock get # Get the current clock and latest run state
944
+ ```
945
+
946
+ The former `commet test-clock process-billing` command is deprecated. `advance` now starts billing processing automatically.
947
+
948
+ ## Quota
949
+
950
+ Manage quota allowances for quota-based features.
951
+
952
+ **`commet quota add`**
953
+
954
+ Add to a customer's quota allowance for a feature.
955
+
956
+ ```bash
957
+ commet quota add --feature-code api_calls --customer-id user_123 --count 100
958
+ ```
959
+
960
+ | Flag | Required | Description |
961
+ | ------------------------- | ------------------------------------ | ---------------------------------------------- |
962
+ | `--feature-code <code>` | Yes | Feature code |
963
+ | `--customer-id <id>` | One of `customer-id` / `external-id` | Customer ID |
964
+ | `--external-id <id>` | One of `customer-id` / `external-id` | Customer external ID |
965
+ | `--count <n>` | No | Amount to add. Default: `1` |
966
+ | `--idempotency-key <key>` | No | HTTP idempotency key for request deduplication |
967
+
968
+ ```bash
969
+ commet quota set --feature-code api_calls --customer-id user_123 --count 500 # Set exact allowance
970
+ commet quota remove --feature-code api_calls --customer-id user_123 --count 10 # Remove from allowance
971
+ commet quota get --customer-id user_123 --feature-code api_calls # Get allowance for a feature
972
+ commet quota get-all --customer-id user_123 # Get all allowances
973
+ ```
974
+
975
+ ## Global Options
976
+
977
+ These flags work on every command:
978
+
979
+ | Flag | Description |
980
+ | ------------------- | ----------------------------------- |
981
+ | `--output <format>` | `human` (default) or `agent` (JSON) |
982
+ | `--help` | Show help for any command |
983
+ | `--version` | Print CLI version |
984
+
985
+ Use `--output agent` for structured JSON output in scripts and CI pipelines:
986
+
987
+ ```bash
988
+ commet customers list --output agent | jq '.[0].id'
989
+ ```
990
+
991
+ ## CI/CD
992
+
993
+ Set `COMMET_API_KEY` as an environment variable. No `commet login` needed.
994
+
995
+ ```yaml .github/workflows/billing.yml
996
+ env:
997
+ COMMET_API_KEY: ${{ secrets.COMMET_API_KEY }}
998
+ steps:
999
+ - run: npx commet push --yes --output agent
1000
+ ```
1001
+
1002
+ ```yaml .github/workflows/subscription.yml
1003
+ env:
1004
+ COMMET_API_KEY: ${{ secrets.COMMET_API_KEY }}
1005
+ steps:
1006
+ - run: |
1007
+ npx commet subscriptions create \
1008
+ --customer-id user_123 \
1009
+ --plan-code pro \
1010
+ --billing-interval monthly \
1011
+ --output agent
1012
+ ```
1013
+
1014
+ ## Configuration Files
1015
+
1016
+ | File | Created by | Purpose |
1017
+ | --------------------- | -------------- | ------------------------------------------------------- |
1018
+ | `~/.commet/auth.json` | `commet login` | Global auth credentials |
1019
+ | `.commet/config.json` | `commet link` | Project-to-organization link and auto-generated API key |
1020
+ | `commet.config.ts` | `commet pull` | Generated billing config with types |
1021
+
1022
+ > **Note**
1023
+ >
1024
+ > Run `commet <command> --help` for the full list of flags and options on any command.