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 commetnpm install -g commetyarn global add commetRequires Node.js 18+.
Authentication
commet login
Authenticate via browser. Opens a device-code flow and stores your token at ~/.commet/auth.json.
commet loginIn CI, set COMMET_API_KEY as an environment variable instead.
| Priority | Source | How to set |
|---|---|---|
| 1 (highest) | COMMET_API_KEY env var | export COMMET_API_KEY=ck_... |
| 2 | Project API key | Auto-generated by commet link (stored in .commet/config.json) |
| 3 (lowest) | Saved credentials | commet login |
commet logout # Remove stored credentialsSetup
commet link
Link this project to a Commet organization. Re-run to switch organizations.
commet linkcommet link --org acme # By slug or ID
commet link --clear # Unlink project| Flag | Required | Description |
|---|---|---|
--org <slug-or-id> | No | Organization slug or ID. Skips interactive selection |
--clear | No | Unlink project from its organization |
commet pull
Fetch your billing config and generate commet.config.ts with typed features and plans.
commet pullcommet pull --dry-run # Preview changes without writing
commet pull --yes # Skip confirmation| Flag | Required | Description |
|---|---|---|
--dry-run | No | Show what would change without writing any files |
-y, --yes | No | Skip 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 pushcommet push --dry-run # Preview what would change on remote
commet push --yes # Push without confirmation| Flag | Required | Description |
|---|---|---|
--dry-run | No | Show what would change without pushing |
-y, --yes | No | Skip 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 createcommet create myapp -t metered --org acme -y
commet create --list # List available templates| Flag | Required | Description |
|---|---|---|
-t, --template <name> | No | Template: fixed, seats, metered, credits, balance-ai, balance-fixed |
--org <slug> | No | Sandbox organization slug or ID |
--skills | No | Install agent skills |
--no-skills | No | Skip agent skills installation |
-y, --yes | No | Accept defaults for optional prompts |
--ref <ref> | No | Git 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 3000The 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/apiFilter by event type:
commet listen 3000 --events invoice.paid,subscription.activated| Flag | Required | Description |
|---|---|---|
<url> | Yes | Target URL: port (3000), host:port, or full URL |
--events <types> | No | Comma-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_123commet customers create \
--email billing@corp.com \
--full-name "Acme Corp" \
--metadata '{"plan":"enterprise"}'| Flag | Required | Description |
|---|---|---|
--email <email> | Yes | Billing email |
--id <id> | No | Custom customer ID |
--full-name <name> | No | Full name |
--domain <domain> | No | Domain |
--website <url> | No | Website URL |
--timezone <tz> | No | Timezone |
--language <lang> | No | Language code |
--industry <industry> | No | Industry |
--metadata <json> | No | Metadata as JSON object |
--address <json> | No | Address as JSON: {line1, city, postalCode, country} |
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 --start-date 2026-01-01 --end-date 2026-06-01 # Filter by date
commet customers list --search "acme" # Search customers
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 monthlycommet subscriptions create \
--customer-id user_123 \
--plan-id plan_xxx \
--billing-interval yearly \
--initial-seats '{"team_member":5}' \
--skip-trial true| Flag | Required | Description |
|---|---|---|
--customer-id <id> | Yes | Customer ID |
--plan-code <code> | One of plan-code / plan-id | Plan code |
--plan-id <id> | One of plan-code / plan-id | Plan ID |
--billing-interval <interval> | No | weekly, monthly, quarterly, yearly, one_time |
--initial-seats <json> | No | Initial seats as JSON: {featureCode: count} |
--skip-trial <bool> | No | Skip trial period |
--name <name> | No | Subscription name |
--start-date <date> | No | Start date (ISO 8601) |
--success-url <url> | No | Redirect URL after successful checkout |
commet subscriptions cancel
Cancel a subscription. Cancels at period end by default.
commet subscriptions cancel --id sub_xxxcommet subscriptions cancel --id sub_xxx --immediate true --reason "Customer requested"| Flag | Required | Description |
|---|---|---|
--id <id> | Yes | Subscription ID |
--reason <reason> | No | Cancellation reason |
--immediate <bool> | No | Cancel 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 change-plan --id sub_xxx --new-plan-id plan_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 list --limit 25 --cursor cur_xxx # Paginate
commet subscriptions preview-change --id sub_xxx --plan-id plan_xxx --billing-interval yearly # Preview proration
commet subscriptions activate-addon --id sub_xxx --addon-id addon_xxx
commet subscriptions deactivate-addon --id sub_xxx --addon-id addon_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 cp_xxxPlans
Create plans, attach features and prices, and configure regional pricing.
commet plans create
Create a plan.
commet plans create --name "Pro" --code procommet plans create \
--name "Developer" \
--code developer \
--consumption-model metered \
--is-public true \
--block-on-exhaustion true| Flag | Required | Description |
|---|---|---|
--name <name> | Yes | Plan name |
--code <code> | Yes | Plan code |
--description <desc> | No | Plan description |
--consumption-model <model> | No | metered, credits, or balance |
--is-public <bool> | No | Whether plan is publicly visible |
--is-free <bool> | No | Whether plan is free |
--block-on-exhaustion <bool> | No | Block usage when balance/credits exhausted |
--plan-group-id <id> | No | Plan group ID |
--metadata <json> | No | Metadata as JSON object |
commet plans add-feature
Add a feature to a plan with pricing and limits.
commet plans add-feature \
--plan-id plan_xxx \
--feature-id feat_xxx \
--included-amount 1000 \
--overage-enabled true \
--overage-unit-price 100commet plans add-feature \
--plan-id plan_xxx \
--feature-id feat_xxx \
--pricing-mode ai_model \
--margin 30| Flag | Required | Description |
|---|---|---|
--plan-id <id> | Yes | Plan ID |
--feature-id <id> | Yes | Feature ID |
--enabled <bool> | No | Whether feature is enabled |
--included-amount <n> | No | Included usage amount |
--unlimited <bool> | No | Unlimited usage |
--overage-enabled <bool> | No | Enable overage billing |
--overage-unit-price <n> | No | Overage price per unit (fixed pricing) |
--pricing-mode <mode> | No | fixed or ai_model |
--margin <n> | No | Margin percentage (ai_model pricing) |
--credits-per-unit <n> | No | Credits per unit |
commet plans add-price
Add a price to a plan.
commet plans add-price \
--plan-id plan_xxx \
--billing-interval monthly \
--price 2900commet plans add-price \
--plan-id plan_xxx \
--billing-interval yearly \
--price 29000 \
--trial-days 14 \
--intro-offer-enabled true \
--intro-offer-discount-type percentage \
--intro-offer-discount-value 50 \
--intro-offer-duration-cycles 3| Flag | Required | Description |
|---|---|---|
--plan-id <id> | Yes | Plan ID |
--billing-interval <interval> | Yes | weekly, monthly, quarterly, yearly, one_time |
--price <n> | Yes | Price in cents |
--trial-days <n> | No | Trial period in days |
--is-default <bool> | No | Set as default price |
--included-balance <n> | No | Included balance amount |
--included-credits <n> | No | Included credits amount |
--intro-offer-enabled <bool> | No | Enable intro offer |
--intro-offer-discount-type <type> | No | percentage or amount |
--intro-offer-discount-value <n> | No | Discount value |
--intro-offer-duration-cycles <n> | No | Duration in billing cycles |
commet plans list # List all plans
commet plans list --limit 25 --cursor cur_xxx # Paginate
commet plans list --include-private true # Include private plans
commet plans get --id pro # Get plan details
commet plans update --id plan_xxx --name "Pro Plus" --description "For growing teams" --metadata '{}' --is-public true # Update a plan
commet plans delete --id plan_xxx # Delete a plan
commet plans set-visibility --id plan_xxx --is-public false
commet plans update-feature --plan-id plan_xxx --feature-id feat_xxx --included-amount 2000
commet plans remove-feature --plan-id plan_xxx --feature-id feat_xxx
commet plans update-price --plan-id plan_xxx --price-id price_xxx --price 3900
commet plans delete-price --plan-id plan_xxx --price-id price_xxx
commet plans set-default-price --plan-id plan_xxx --price-id price_xxxRegional prices
Set local currency overrides for a price.
commet plans set-regional-prices \
--plan-id plan_xxx \
--price-id price_xxx \
--overrides '[{"currency":"EUR","price":2700},{"currency":"BRL","price":14900}]'commet plans delete-regional-prices --plan-id plan_xxx --price-id price_xxxFeatures
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| Flag | Required | Description |
|---|---|---|
--code <code> | Yes | Feature code |
--name <name> | Yes | Feature name |
--type <type> | Yes | boolean, usage, or seats |
--description <desc> | No | Feature description |
--unit-name <name> | No | Unit 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 featureFeature 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
commet feature-access can-use --customer-id user_123 --code api_calls # Check if customer can use one more unitSeats
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_membercommet seats add --customer-id user_123 --feature-code team_member --count 5| Flag | Required | Description |
|---|---|---|
--customer-id <id> | Yes | Customer ID |
--feature-code <code> | Yes | Feature code |
--count <n> | No | Number 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_123Usage
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 api_calls --customer-id user_123 --value 1commet usage track \
--feature gpt-4o \
--customer-id user_123 \
--model gpt-4o \
--input-tokens 500 \
--output-tokens 150 \
--cache-read-tokens 200| Flag | Required | Description |
|---|---|---|
--feature <code> | Yes | Feature code |
--customer-id <id> | Yes | Customer ID |
--value <n> | One of value / model | Usage value (standard tracking) |
--model <model> | One of value / model | AI model name (token tracking) |
--input-tokens <n> | No | Input tokens (model tracking) |
--output-tokens <n> | No | Output tokens (model tracking) |
--cache-read-tokens <n> | No | Cache read tokens (model tracking) |
--cache-write-tokens <n> | No | Cache write tokens (model tracking) |
--idempotency-key <key> | No | Prevents duplicate events. Max 256 characters |
--timestamp <ts> | No | Event timestamp (ISO 8601) |
--properties <json> | No | Event properties as JSON object |
commet usage check --customer-id user_123 --feature-code api_calls --quantity 1Addons
Create and manage purchasable feature extensions.
commet addons create
Create an addon.
commet addons create \
--name "Extra Storage" \
--base-price 500 \
--feature-id feat_xxx \
--consumption-model meteredcommet addons create \
--name "Priority Support" \
--base-price 2900 \
--feature-id feat_xxx \
--consumption-model boolean| Flag | Required | Description |
|---|---|---|
--name <name> | Yes | Addon name |
--base-price <n> | Yes | Base price in cents |
--feature-id <id> | Yes | Feature ID |
--consumption-model <model> | Yes | boolean, metered, credits, or balance |
--description <desc> | No | Addon description |
--included-units <n> | No | Included units (metered) |
--overage-rate <n> | No | Overage rate (metered/balance) |
--credit-cost <n> | No | Credit cost (credits) |
commet addons list # List all addons
commet addons list --limit 25 --cursor cur_xxx # Paginate
commet addons get --id addon_xxx # Get addon details
commet addons update --id addon_xxx --name "Extra Storage Pro" --description "100GB extra" --base-price 900 --included-units 100 --overage-rate 10 # Update an addon
commet addons delete --id addon_xxx # Delete an addon
commet addons list-active --customer-id user_123 # List active addons for a customerCredit 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 cp_xxx --price 3900 # Update a credit pack
commet credit-packs delete --id cp_xxx # Delete a credit pack| Flag | Required | Description |
|---|---|---|
--name <name> | Yes (create) | Credit pack name |
--credits <n> | Yes (create) | Number of credits |
--price <n> | Yes (create) | Price in cents |
--description <desc> | No | Credit pack description |
--is-active <bool> | No | Whether 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 pg_xxx # Get plan group details
commet plan-groups add-plan --id pg_xxx --plan-id plan_xxx --sort-order 1
commet plan-groups remove-plan --id pg_xxx --plan-id plan_xxx
commet plan-groups reorder-plans --id pg_xxx --plan-ids '["plan_a","plan_b","plan_c"]'
commet plan-groups update --id pg_xxx --name "Updated Plans" --description "New description" --is-public false
commet plan-groups delete --id pg_xxx # Delete a plan groupInvoices
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"| Flag | Required | Description |
|---|---|---|
--customer-id <id> | Yes | Customer ID |
--amount <n> | Yes | Amount in cents. Negative for credit |
--description <desc> | No | Adjustment description |
--metadata <json> | No | Metadata 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)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 paymentPromo Codes
Create and manage discount codes.
commet promo-codes create
Create a promo code.
commet promo-codes create \
--code SUMMER25 \
--discount-type percentage \
--discount-value 25 \
--duration-cycles 3 \
--max-redemptions 100commet promo-codes create \
--code FLAT10 \
--discount-type amount \
--discount-value 1000 \
--plan-ids '["plan_pro","plan_team"]' \
--expires-at 2026-12-31| Flag | Required | Description |
|---|---|---|
--code <code> | Yes | Promo code string |
--discount-type <type> | Yes | percentage or amount |
--discount-value <n> | Yes | Discount value |
--duration-cycles <n> | No | Duration in billing cycles |
--max-redemptions <n> | No | Maximum number of redemptions |
--expires-at <date> | No | Expiration date (ISO 8601) |
--plan-ids <json> | No | Restrict 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 promo_xxx # Get promo code details
commet promo-codes update --id promo_xxx --active false --max-redemptions 50 --expires-at 2026-12-31 --plan-ids '["plan_pro"]' # UpdateWebhooks
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"]'| Flag | Required | Description |
|---|---|---|
--url <url> | Yes | Webhook URL |
--events <json> | Yes | Events to subscribe to (JSON array) |
--description <desc> | No | Webhook 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 wh_xxx # Delete endpoint
commet webhooks test --id wh_xxx # Send a test eventAPI 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| Flag | Required | Description |
|---|---|---|
--name <name> | Yes (create) | API key name |
--expires-in-days <n> | No | Expiration 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.comProvide 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"| Flag | Required | Description |
|---|---|---|
--amount <n> | Yes | Amount in cents (USD, minimum 1000) |
--description <desc> | No | Payout 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| Flag | Required | Description |
|---|---|---|
--account-number <number> | Yes | Bank account number |
--account-holder-name <name> | Yes | Account holder name |
--routing-number <number> | No | Routing number |
--account-type <type> | No | checking or savings |
--set-default <bool> | No | Set 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"}'| Flag | Required | Description |
|---|---|---|
--email <email> | Yes | Contact email |
--business-type <type> | Yes | individual or company |
--business-url <url> | Yes | Business website URL |
--document-url <url> | Yes | Identity document URL |
--bank <json> | Yes | Bank account as JSON: {accountNumber, accountHolderName, ...} |
--individual <json> | No | Individual KYC details (JSON, individual businesses) |
--company <json> | No | Company 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 30commet test-clock advance --frozen-time 2026-07-01T00:00:00Z| Flag | Required | Description |
|---|---|---|
--advance-days <n> | One of advance-days / frozen-time | Days to move the clock forward |
--frozen-time <ts> | One of advance-days / frozen-time | Absolute 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 timeQuota
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| Flag | Required | Description |
|---|---|---|
--feature-code <code> | Yes | Feature code |
--customer-id <id> | One of customer-id / external-id | Customer ID |
--external-id <id> | One of customer-id / external-id | Customer external ID |
--count <n> | No | Amount to add. Default: 1 |
--idempotency-key <key> | No | Idempotency key for 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 allowancesGlobal Options
These flags work on every command:
| Flag | Description |
|---|---|
--output <format> | human (default) or agent (JSON) |
--help | Show help for any command |
--version | Print 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 agentenv:
COMMET_API_KEY: ${{ secrets.COMMET_API_KEY }}
steps:
- run: |
npx commet subscriptions create \
--customer-id user_123 \
--plan-code pro \
--billing-interval monthly \
--output agentConfiguration Files
| File | Created by | Purpose |
|---|---|---|
~/.commet/auth.json | commet login | Global auth credentials |
.commet/config.json | commet link | Project-to-organization link and auto-generated API key |
commet.config.ts | commet pull | Generated billing config with types |
Run commet <command> --help for the full list of flags and options on any command.
How is this guide?