Commet
  • Pricing
Log InTry out
Introduction

Quickstart

Learn

Resources

SDK ReferenceAPI VersioningError HandlingTestingCLI

Plugins

Better Auth
System status
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

CLI

The official command-line tool for Commet. Manage billing, forward webhooks, and automate your workflow from the terminal.

The official command-line tool for Commet. Manage billing, forward webhooks, and automate your workflow from the terminal.

Install

pnpm add -g commet
npm install -g commet
yarn global add commet

Requires Node.js 18+.

Authentication

commet login

Authenticate via browser. Opens a device-code flow and stores your token at ~/.commet/auth.json.

commet login

In CI, set COMMET_API_KEY as an environment variable instead.

The CLI uses two kinds of credentials, depending on the command:

Command typeCredential resolution
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
Platform commands (orgs, link, listen, create)COMMET_API_KEY env var → saved credentials from commet login

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.

commet logout     # Remove stored credentials

Setup

commet link

Link this project to a Commet organization. Re-run to switch organizations.

commet link
commet link --org acme       # By slug or ID
commet link --clear          # Unlink project
FlagRequiredDescription
--org <slug-or-id>NoOrganization slug or ID. Skips interactive selection
--clearNoUnlink project from its organization

commet pull

Fetch your billing config and generate commet.config.ts with typed features and plans.

commet pull
commet pull --dry-run        # Preview changes without writing
commet pull --yes            # Skip confirmation
FlagRequiredDescription
--dry-runNoShow what would change without writing any files
-y, --yesNoSkip confirmation prompt

After commet pull, your SDK calls get autocomplete for plan codes and feature codes.

commet push

Push your local commet.config.ts to Commet. Creates or updates features and plans to match your config.

commet push
commet push --dry-run        # Preview what would change on remote
commet push --yes            # Push without confirmation
FlagRequiredDescription
--dry-runNoShow what would change without pushing
-y, --yesNoSkip confirmation prompt

Feature type changes (boolean to usage, etc.) are blocked via push. Change them in the dashboard.

commet create

Scaffold a new Commet project from a template. Creates plans and features in your sandbox organization, generates an API key, and links the project.

commet create
commet create myapp -t metered --org acme -y
commet create --list              # List available templates
FlagRequiredDescription
-t, --template <name>NoTemplate: fixed, seats, metered, credits, balance-ai, balance-fixed
--org <slug>NoSandbox organization slug or ID
--skillsNoInstall agent skills
--no-skillsNoSkip agent skills installation
-y, --yesNoAccept defaults for optional prompts
--ref <ref>NoGit ref to fetch templates from. Default: main

commet listen

Forward webhook events from Commet to your local server. No ngrok or external tunneling needed.

commet listen 3000

The argument accepts a port, host:port, or full URL:

commet listen 3000                              # http://localhost:3000/
commet listen localhost:3000/webhooks            # http://localhost:3000/webhooks
commet listen http://local.commet.co:3010/api    # http://local.commet.co:3010/api

Filter by event type:

commet listen 3000 --events invoice.created,subscription.activated
FlagRequiredDescription
<url>YesTarget URL: port (3000), host:port, or full URL
--events <types>NoComma-separated event types to forward
  ✓ Authenticated (org: Acme Inc)
  ✓ Connected to Commet webhook stream
  ⟶ Forwarding to http://localhost:3000/
  ⟶ Signing secret: whsec_...

  Ready! Listening for webhook events...

  14:32:01  customer.created              →  200 OK     (12ms)
  14:32:05  subscription.updated          →  200 OK     (8ms)

The session stays open until Ctrl+C. Events are signed with the displayed secret.

commet orgs               # List all organizations (name, slug, mode)

Customers

Create and manage customers, retrieve details, and handle batch operations.

commet customers create

Create a customer.

commet customers create --email user@acme.com --id user_123
commet customers create \
  --email billing@corp.com \
  --full-name "Acme Corp" \
  --metadata '{"plan":"enterprise"}'
FlagRequiredDescription
--email <email>YesBilling email
--id <id>NoCustom customer ID
--external-id <id>NoID from your system
--full-name <name>NoFull name
--tax-document <value>NoTax document
--timezone <tz>NoTimezone
--metadata <json>NoMetadata as JSON object
--address <json>NoAddress as JSON: {line1, city, postalCode, country}
--address-id <id>NoExisting customer address ID
commet customers get --id cus_xxx                   # Get a customer by ID
commet customers update --id cus_xxx --email new@acme.com  # Update a customer
commet customers list                                # List all customers
commet customers list --limit 25 --cursor cur_xxx    # Paginate
commet customers list --external-id user_123         # Find by external ID
commet customers create-batch --customers '[{"email":"a@co.com"},{"email":"b@co.com"}]'

Subscriptions

Create, cancel, and manage subscriptions. Change plans, activate addons, and handle balance operations.

commet subscriptions create

Create a subscription for a customer.

commet subscriptions create \
  --customer-id user_123 \
  --plan-code pro \
  --billing-interval monthly
commet subscriptions create \
  --customer-id user_123 \
  --plan-id pln_xxx \
  --price-id pp_argentina \
  --billing-interval yearly \
  --initial-seats '{"team_member":5}' \
  --skip-trial true
FlagRequiredDescription
--customer-id <id>YesCustomer ID
--plan-code <code>One of plan-code / plan-idPlan code
--plan-id <id>One of plan-code / plan-idPlan ID
--billing-interval <interval>Noweekly, monthly, quarterly, yearly, one_time
--price-id <id>NoSelectable plan price. Omit it to use the interval default and its market pricing
--initial-seats <json>NoInitial seats as JSON: {featureCode: count}
--skip-trial <bool>NoSkip trial period
--custom-trial-days <n>NoOverride the catalog trial duration
--offer-id <id>NoExplicit Promotional Offer. Cannot be combined with promo-code or a custom trial
--promo-code <code>NoApply a Promotional Offer through a promo code
--provider <provider>NoInitial checkout provider override: stripe, commet, or dlocal
--name <name>NoSubscription name
--start-date <date>NoStart date (ISO 8601)
--success-url <url>NoRedirect URL after successful checkout

commet subscriptions cancel

Cancel a subscription. Cancels at period end by default.

commet subscriptions cancel --id sub_xxx
commet subscriptions cancel --id sub_xxx --immediate true --reason "Customer requested"
FlagRequiredDescription
--id <id>YesSubscription ID
--reason <reason>NoCancellation reason
--immediate <bool>NoCancel immediately instead of at period end
commet subscriptions get-active --customer-id user_123           # Get active subscription
commet subscriptions uncancel --id sub_xxx                       # Revert pending cancellation
commet subscriptions reactivate --id sub_xxx --offer-id ofr_xxx  # Reactivate a canceled subscription with a Promotional Offer
commet subscriptions change-plan --id sub_xxx --new-plan-id pln_xxx --new-billing-interval yearly  # Change plan
commet subscriptions list                                            # List all subscriptions
commet subscriptions list --customer-id user_123 --status active     # Filter by customer/status
commet subscriptions preview-change --id sub_xxx --plan-id pln_xxx --billing-interval yearly  # Preview proration
commet subscriptions activate-addon --id sub_xxx --addon-id adn_xxx
commet subscriptions deactivate-addon --id sub_xxx --addon-id adn_xxx
commet subscriptions adjust-balance --id sub_xxx --amount 1000 --type balance --reason "Courtesy credit"
commet subscriptions topup-balance --id sub_xxx --amount 5000
commet subscriptions purchase-credits --id sub_xxx --credit-pack-id cpk_xxx

Plans

Create plans, attach features and prices, and configure regional pricing.

commet plans create

Create a plan.

commet plans create --name "Pro" --code pro
commet plans create \
  --name "Developer" \
  --code developer \
  --consumption-model metered \
  --is-public true \
  --block-on-exhaustion true
FlagRequiredDescription
--name <name>YesPlan name
--code <code>YesPlan code
--description <desc>NoPlan description
--consumption-model <model>Nometered, credits, or balance
--is-public <bool>NoWhether plan is publicly visible
--is-free <bool>NoWhether plan is free
--block-on-exhaustion <bool>NoBlock usage when balance/credits exhausted
--plan-group-id <id>NoPlan group ID
--metadata <json>NoMetadata as JSON object

commet plans add-feature

Add a feature to a plan with pricing and limits.

commet plans add-feature \
  --plan-id pln_xxx \
  --feature-id ftr_xxx \
  --included-amount 1000 \
  --overage-enabled true \
  --overage-unit-price 100
commet plans add-feature \
  --plan-id pln_xxx \
  --feature-id ftr_xxx \
  --pricing-mode ai_model \
  --margin 30
FlagRequiredDescription
--plan-id <id>YesPlan ID
--feature-id <id>YesFeature ID
--enabled <bool>NoWhether feature is enabled
--included-amount <n>NoIncluded usage amount
--unlimited <bool>NoUnlimited usage
--overage-enabled <bool>NoEnable overage billing
--overage-unit-price <n>NoOverage price per unit (fixed pricing)
--pricing-mode <mode>Nofixed or ai_model
--margin <n>NoMargin percentage (ai_model pricing)
--credits-per-unit <n>NoCredits per unit

commet plans add-price

Add a price to a plan.

commet plans add-price \
  --plan-id pln_xxx \
  --billing-interval monthly \
  --price 2900
commet plans add-price \
  --plan-id pln_xxx \
  --billing-interval yearly \
  --price 29000 \
  --trial-days 14
FlagRequiredDescription
--plan-id <id>YesPlan ID
--billing-interval <interval>Yesweekly, monthly, quarterly, yearly, one_time
--price <n>One of price / inherits-from-price-idBase price in the currency's minor unit
--inherits-from-price-id <id>One of price / inherits-from-price-idBase price inherited by a selectable variant
--trial-days <n>NoTrial period in days
--is-default <bool>NoSet as default price
--included-balance <n>NoIncluded balance amount
--included-credits <n>NoIncluded credits amount
--market-prices <json>Required for a variantMarket prices as {marketGroupId, currency, price} objects
--metadata <json>NoPrice metadata

Create a selectable variant that changes only Argentina and inherits the rest of the base price:

commet plans add-price \
  --plan-id pln_xxx \
  --billing-interval monthly \
  --inherits-from-price-id pp_base \
  --market-prices '[{"marketGroupId":"pmg_argentina","currency":"ars","price":1500000}]'
commet plans list                                    # List all plans
commet plans list --include-private true              # Include private plans
commet plans get --id pro                            # Get plan details
commet plans update --id pln_xxx --name "Pro Plus" --description "For growing teams" --metadata '{}' --is-public true  # Update a plan
commet plans delete --id pln_xxx                    # Delete a plan
commet plans set-visibility --id pln_xxx --is-public false
commet plans update-feature --plan-id pln_xxx --feature-id ftr_xxx --included-amount 2000
commet plans remove-feature --plan-id pln_xxx --feature-id ftr_xxx
commet plans update-price --plan-id pln_xxx --price-id pp_xxx --price 3900
commet plans delete-price --plan-id pln_xxx --price-id pp_xxx
commet plans set-default-price --plan-id pln_xxx --price-id pp_xxx

Regional prices

Set local currency overrides for a price.

commet plans set-regional-prices \
  --plan-id pln_xxx \
  --price-id pp_xxx \
  --overrides '[{"currency":"EUR","price":2700},{"currency":"BRL","price":14900}]'
commet plans delete-regional-prices --plan-id pln_xxx --price-id pp_xxx

Features

Manage the organization's feature catalog.

commet features create

Create a feature.

commet features create --code api_calls --name "API Calls" --type usage --unit-name calls
FlagRequiredDescription
--code <code>YesFeature code
--name <name>YesFeature name
--type <type>Yesboolean, usage, seats, or quota
--description <desc>NoFeature description
--unit-name <name>NoUnit name for metered features
commet features list                                             # List the feature catalog
commet features get --code api_calls                             # Get a feature definition
commet features update --code api_calls --name "API Requests" --description "HTTP API calls" --unit-name requests  # Update a feature
commet features delete --code api_calls                          # Delete a feature

Feature Access

Check a customer's feature access and usage.

commet feature-access list --customer-id user_123                       # List feature access for a customer
commet feature-access get --customer-id user_123 --code api_calls       # Get feature access details

Use commet usage check --customer-id user_123 --feature-code api_calls --quantity 1 for a prospective consumption decision.

Seats

Manage seat allocations for per-seat billing.

commet seats add

Add seats for a customer.

commet seats add --customer-id user_123 --feature-code team_member
commet seats add --customer-id user_123 --feature-code team_member --count 5
FlagRequiredDescription
--customer-id <id>YesCustomer ID
--feature-code <code>YesFeature code
--count <n>NoNumber of seats to add. Default: 1
commet seats remove --customer-id user_123 --feature-code team_member
commet seats set --customer-id user_123 --feature-code team_member --count 10
commet seats set-all --customer-id user_123 --seats '{"team_member":5,"admin":2}'
commet seats get-balance --customer-id user_123 --feature-code team_member
commet seats get-all-balances --customer-id user_123

Usage

Track consumption events and check remaining allowance.

commet usage track

Track a usage event. Supports value-based tracking and AI model token tracking.

commet usage track --feature-code api_calls --customer-id user_123 --value 1
commet usage track \
  --feature-code gpt-4o \
  --customer-id user_123 \
  --model gpt-4o \
  --input-tokens 500 \
  --output-tokens 150 \
  --cache-read-tokens 200
FlagRequiredDescription
--feature-code <code>YesFeature code
--customer-id <id>YesCustomer ID
--value <n>One of value / modelUsage value (standard tracking)
--model <model>One of value / modelAI model name (token tracking)
--input-tokens <n>NoInput tokens (model tracking)
--output-tokens <n>NoOutput tokens (model tracking)
--cache-read-tokens <n>NoCache read tokens (model tracking)
--cache-write-tokens <n>NoCache write tokens (model tracking)
--event-id <id>NoCaller-owned event ID for deduplication. Max 200 characters
--timestamp <ts>NoEvent timestamp (ISO 8601)
--properties <json>NoEvent properties as a JSON array of { "property": string, "value": string } entries
commet usage check --customer-id user_123 --feature-code api_calls --quantity 1

Addons

Create and manage purchasable feature extensions.

commet addons create

Create an addon.

commet addons create \
  --name "Extra Storage" \
  --base-price 500 \
  --feature-id ftr_xxx \
  --consumption-model metered
commet addons create \
  --name "Priority Support" \
  --base-price 2900 \
  --feature-id ftr_xxx \
  --consumption-model boolean
FlagRequiredDescription
--name <name>YesAddon name
--base-price <n>YesBase price in cents
--feature-id <id>YesFeature ID
--consumption-model <model>Yesboolean, metered, credits, or balance
--description <desc>NoAddon description
--included-units <n>NoIncluded units (metered)
--overage-rate <n>NoOverage rate (metered/balance)
--credit-cost <n>NoCredit cost (credits)
commet addons list                                   # List all addons
commet addons list --limit 25 --cursor cur_xxx       # Paginate
commet addons get --id adn_xxx                     # Get addon details
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
commet addons delete --id adn_xxx                  # Delete an addon
commet addons list-active --customer-id user_123     # List active addons for a customer

Credit Packs

Create and manage credit packs for credit-based plans.

commet credit-packs create --name "500 Credits" --credits 500 --price 4900
commet credit-packs list                             # List all credit packs
commet credit-packs update --id cpk_xxx --price 3900  # Update a credit pack
commet credit-packs delete --id cpk_xxx               # Delete a credit pack
FlagRequiredDescription
--name <name>Yes (create)Credit pack name
--credits <n>Yes (create)Number of credits
--price <n>Yes (create)Price in cents
--description <desc>NoCredit pack description
--is-active <bool>NoWhether credit pack is active

Plan Groups

Organize plans into groups for pricing tables and the customer portal.

commet plan-groups create --name "Main Plans" --description "Primary pricing tiers" --is-public true
commet plan-groups list                              # List all plan groups
commet plan-groups list --limit 25 --cursor cur_xxx  # Paginate
commet plan-groups get --id plg_xxx                   # Get plan group details
commet plan-groups add-plan --id plg_xxx --plan-id pln_xxx --sort-order 1
commet plan-groups remove-plan --id plg_xxx --plan-id pln_xxx
commet plan-groups reorder-plans --id plg_xxx --plan-ids '["pln_a","pln_b","pln_c"]'
commet plan-groups update --id plg_xxx --name "Updated Plans" --description "New description" --is-public false
commet plan-groups delete --id plg_xxx                # Delete a plan group

Invoices

List invoices, download PDFs, and create adjustments.

commet invoices create-adjustment

Create an adjustment invoice. Use a negative amount for credits.

commet invoices create-adjustment \
  --customer-id cus_xxx \
  --amount -500 \
  --description "Courtesy credit"
FlagRequiredDescription
--customer-id <id>YesCustomer ID
--amount <n>YesAmount in cents. Negative for credit
--description <desc>NoAdjustment description
--metadata <json>NoMetadata as JSON object
commet invoices list                                     # List all invoices
commet invoices list --limit 25 --cursor cur_xxx         # Paginate
commet invoices list --subscription-id sub_xxx           # Filter by subscription
commet invoices list --customer-id cus_xxx --status paid # Filter by customer/status
commet invoices get --id inv_xxx                          # Get invoice details
commet invoices get-download-url --id inv_xxx             # Get signed PDF URL
commet invoices send --id inv_xxx                         # Send invoice by email
commet invoices update-status --id inv_xxx --status void  # Update status (paid, void)

Payments

Create hosted payment links and charge saved payment methods. One-time payments, no subscription or plan required. See Accept One-Time Payments for the full lifecycle.

commet payments create

Create a hosted payment link. The customer opens the returned url and pays with any card.

commet payments create \
  --amount 25000 \
  --currency usd \
  --description "Annual report"
commet payments create \
  --amount 25000 \
  --currency usd \
  --description "Annual report" \
  --customer-id user_123 \
  --success-url https://yourapp.com/thanks
FlagRequiredDescription
--amount <n>YesAmount in cents
--currency <currency>YesCurrency code (e.g. usd)
--description <desc>YesShown on the payment link, invoice, and receipt
--customer-id <id>NoCustomer ID
--success-url <url>NoRedirect URL after successful payment
--metadata <json>NoMetadata as JSON object
commet payments charge --customer-id user_123 --amount 25000 --currency usd --description "Annual report"  # Charge a vaulted payment method off-session
commet payments get --id pay_xxx                          # Get payment details
commet payments list --customer-id user_123 --limit 20    # List payments
commet payments cancel --id pay_xxx                       # Cancel a pending payment link

Transactions

List transactions, process refunds, and retry failed payments.

commet transactions list                                  # List all transactions
commet transactions list --limit 20 --cursor cur_xxx     # Paginate
commet transactions list --status succeeded              # Filter by status
commet transactions list --customer-email user@acme.com  # Filter by customer email
commet transactions get --id txn_xxx                      # Get transaction details
commet transactions refund --id txn_xxx                   # Full refund
commet transactions retry --id txn_xxx                    # Retry failed payment

Offers

Create reusable Introductory and Promotional Offers. Offer phases own the economics; Promo Codes only distribute Promotional Offers.

commet offers create \
  --name "First 3 months at 25% off" \
  --purpose introductory \
  --plan-price-ids '["pp_monthly"]' \
  --phases '[{"type":"percentage","percentage":2500,"durationCycles":3}]'

percentage uses basis points, so 2500 means 25%. Other phase types are free_trial, amount_off, and fixed_price.

commet offers list --purpose introductory --active true
commet offers get --id ofr_xxx
commet offers update --id ofr_xxx --name "Launch offer" --purpose promotional --plan-price-ids '["pp_monthly"]' --phases '[{"type":"fixed_price","prices":[{"currency":"usd","amount":900}],"durationCycles":2}]'
commet offers delete --id ofr_xxx

Promo Codes

Create and manage distribution codes for Promotional Offers.

commet promo-codes create

Create a promo code.

commet promo-codes create \
  --code SUMMER25 \
  --offer-id ofr_summer25 \
  --max-redemptions 100
commet promo-codes create \
  --code ANNUAL \
  --offer-id ofr_annual \
  --billing-interval yearly \
  --plan-ids '["pln_pro","pln_team"]' \
  --expires-at 2026-12-31
FlagRequiredDescription
--code <code>YesPromo code string
--offer-id <id>YesPromotional Offer ID
--billing-interval <interval>NoRestrict redemption to one billing interval
--max-redemptions <n>NoMaximum number of redemptions
--expires-at <date>NoExpiration date (ISO 8601)
--plan-ids <json>NoRestrict to specific plan IDs (JSON array)
commet promo-codes list                              # List all promo codes
commet promo-codes list --limit 25 --cursor cur_xxx  # Paginate
commet promo-codes get --id prc_xxx                  # Get promo code details
commet promo-codes update --id prc_xxx --active false --max-redemptions 50 --expires-at 2026-12-31 --plan-ids '["pln_pro"]'  # Update

Pricing Markets

Define reusable country groups, then reference them from --market-prices when creating or updating plan prices.

commet pricing create-market-group \
  --name "Argentina" \
  --country-codes '["AR"]'

commet pricing list-market-groups
commet pricing get-market-group --id pmg_argentina
commet pricing update-market-group --id pmg_argentina --name "Southern Cone" --country-codes '["AR","BO","PY","UY"]'
commet pricing delete-market-group --id pmg_argentina

Webhooks

Create and test webhook endpoints.

commet webhooks create

Create a webhook endpoint.

commet webhooks create \
  --url https://example.com/webhooks \
  --events '["subscription.activated","payment.received"]'
FlagRequiredDescription
--url <url>YesWebhook URL
--events <json>YesEvents to subscribe to (JSON array)
--description <desc>NoWebhook description

For local development, use commet listen instead of creating a webhook endpoint.

commet webhooks list                                 # List all webhook endpoints
commet webhooks list --limit 25 --cursor cur_xxx     # Paginate
commet webhooks delete --id whe_xxx                  # Delete endpoint
commet webhooks test --id whe_xxx                    # Send a test event

API Keys

Create and manage API keys.

commet api-keys create --name "Production" --expires-in-days 365
commet api-keys list                                 # List all API keys
commet api-keys list --limit 25 --cursor cur_xxx     # Paginate
commet api-keys delete --id key_xxx                  # Delete an API key
FlagRequiredDescription
--name <name>Yes (create)API key name
--expires-in-days <n>NoExpiration in days

Portal

Generate a portal URL for customer self-service.

commet portal get-url --customer-id user_123
commet portal get-url --email user@acme.com

Provide either --customer-id or --email.

Payouts

Manage payout bank accounts, request payouts, and complete account verification.

commet payouts request

Request a payout of available balance.

commet payouts request --amount 50000 --description "Weekly payout"
FlagRequiredDescription
--amount <n>YesAmount in cents (USD, minimum 1000)
--description <desc>NoPayout description

commet payouts add-bank-account

Add a destination bank account to the payout account.

commet payouts add-bank-account \
  --account-number 000123456789 \
  --account-holder-name "Acme Inc." \
  --routing-number 110000000 \
  --account-type checking \
  --set-default true
FlagRequiredDescription
--account-number <number>YesBank account number
--account-holder-name <name>YesAccount holder name
--routing-number <number>NoRouting number
--account-type <type>Nochecking or savings
--set-default <bool>NoSet as default bank account

commet payouts complete-verification

Provision the payout account with the full KYC payload.

commet payouts complete-verification \
  --email owner@acme.com \
  --business-type company \
  --business-url https://acme.com \
  --document-url https://files.acme.com/incorporation.pdf \
  --bank '{"accountNumber":"000123456789","accountHolderName":"Acme Inc."}' \
  --company '{"name":"Acme Inc.","taxId":"12-3456789"}'
FlagRequiredDescription
--email <email>YesContact email
--business-type <type>Yesindividual or company
--business-url <url>YesBusiness website URL
--document-url <url>YesIdentity document URL
--bank <json>YesBank account as JSON: {accountNumber, accountHolderName, ...}
--individual <json>NoIndividual KYC details (JSON, individual businesses)
--company <json>NoCompany KYC details (JSON, company businesses)

Test Clock

Control the sandbox test clock to simulate the passage of time.

Sandbox only. Test clock commands fail against live organizations.

commet test-clock advance

Move the test clock forward.

commet test-clock advance --advance-days 30
commet test-clock advance --frozen-time 2026-07-01T00:00:00Z
FlagRequiredDescription
--advance-days <n>One of advance-days / frozen-timeDays to move the clock forward
--frozen-time <ts>One of advance-days / frozen-timeAbsolute instant to move to (ISO 8601)
commet test-clock get                # Get the current test clock state
commet test-clock process-billing    # Run billing cycles due at the simulated time

Quota

Manage quota allowances for quota-based features.

commet quota add

Add to a customer's quota allowance for a feature.

commet quota add --feature-code api_calls --customer-id user_123 --count 100
FlagRequiredDescription
--feature-code <code>YesFeature code
--customer-id <id>One of customer-id / external-idCustomer ID
--external-id <id>One of customer-id / external-idCustomer external ID
--count <n>NoAmount to add. Default: 1
--idempotency-key <key>NoHTTP idempotency key for request deduplication
commet quota set --feature-code api_calls --customer-id user_123 --count 500    # Set exact allowance
commet quota remove --feature-code api_calls --customer-id user_123 --count 10  # Remove from allowance
commet quota get --customer-id user_123 --feature-code api_calls                # Get allowance for a feature
commet quota get-all --customer-id user_123                                     # Get all allowances

Global Options

These flags work on every command:

FlagDescription
--output <format>human (default) or agent (JSON)
--helpShow help for any command
--versionPrint CLI version

Use --output agent for structured JSON output in scripts and CI pipelines:

commet customers list --output agent | jq '.[0].id'

CI/CD

Set COMMET_API_KEY as an environment variable. No commet login needed.

env:
  COMMET_API_KEY: ${{ secrets.COMMET_API_KEY }}
steps:
  - run: npx commet push --yes --output agent
env:
  COMMET_API_KEY: ${{ secrets.COMMET_API_KEY }}
steps:
  - run: |
      npx commet subscriptions create \
        --customer-id user_123 \
        --plan-code pro \
        --billing-interval monthly \
        --output agent

Configuration Files

FileCreated byPurpose
~/.commet/auth.jsoncommet loginGlobal auth credentials
.commet/config.jsoncommet linkProject-to-organization link and auto-generated API key
commet.config.tscommet pullGenerated billing config with types

Run commet <command> --help for the full list of flags and options on any command.

How is this guide?

Testing

Test safely with sandbox environment

Better Auth

Better Auth Plugin for Billing and Subscriptions using Commet

On this page

Install
Authentication
Setup
Customers
Subscriptions
Plans
Regional prices
Features
Feature Access
Seats
Usage
Addons
Credit Packs
Plan Groups
Invoices
Payments
Transactions
Offers
Promo Codes
Pricing Markets
Webhooks
API Keys
Portal
Payouts
Test Clock
Quota
Global Options
CI/CD
Configuration Files