| name | commet-cli |
| description | Use when working with the Commet CLI -- logging in, linking projects, syncing billing config as code (commet pull/push), forwarding webhooks locally (commet listen), scaffolding new projects from templates (fixed, seats, metered, credits, balance-ai, balance-fixed), or running resource commands from the terminal. |
| license | MIT |
| metadata | {"author":"commet","version":"1.0.0","homepage":"https://commet.co","source":"https://github.com/commet-labs/commet-skills"} |
| references | ["references/commands.md","references/templates.md","references/setup-workflow.md"] |
Commet CLI
Billing infrastructure as code: sync features and plans between Commet and a local commet.config.ts, forward webhook events to your dev server, scaffold new projects from billing templates, and manage resources (customers, subscriptions, plans, ...) from the terminal. Requires Node.js 18+.
Install
npm install -g commet
Quick Start
commet login
commet link
commet pull
After commet pull, your billing config lives in commet.config.ts. Edit it locally and run commet push to apply changes to Commet:
import { defineConfig } from "@commet/node";
export default defineConfig({
features: {
api_calls: { name: "API Calls", type: "usage", unitName: "call" },
},
plans: {
pro: {
name: "Pro",
defaultInterval: "monthly",
prices: [{ interval: "monthly", amount: 9900 }],
features: { api_calls: { included: 10000 } },
},
},
});
Commands
| Command | Description |
|---|
commet create [name] | Scaffold new project from a billing template |
commet login | Authenticate with Commet (opens browser) |
commet logout | Remove credentials |
commet link | Link project to an organization; re-run to switch |
commet link --org <slug-or-id> | Link or switch non-interactively |
commet link --clear | Unlink project |
commet orgs | List organizations you have access to |
commet pull | Sync remote config into commet.config.ts |
commet push | Push commet.config.ts changes to Commet |
commet listen <url> | Forward webhook events to a local server |
commet <resource> <action> | Resource commands mirroring the SDK (see below) |
Resource commands exist for: customers, subscriptions, plans, features, feature-access, seats, usage, portal, addons, credit-packs, webhooks, api-keys, invoices, transactions, promo-codes, plan-groups, payments, payouts, test-clock, quota.
See references/commands.md for full details.
Templates
Scaffold a complete Next.js project with billing pre-configured:
commet create my-app
| Template | Billing Model |
|---|
fixed | Fixed subscriptions with boolean features |
seats | Per-seat billing for team collaboration |
metered | Usage-based with included amounts and overage |
credits | Credit-based consumption with packs and top-ups |
balance-ai | AI product with automatic token cost tracking |
balance-fixed | Prepaid balance with fixed unit prices |
See references/templates.md for details on each template.
Key Gotchas
-
commet create provisions sandbox organizations only. Templates create plans and features in a sandbox organization -- the CLI only offers your sandbox orgs. No separate login is needed; pick the org (or pass --org <slug>).
-
One login, one base URL. The CLI always talks to https://commet.co. Sandbox vs live is a property of the organization you link, not of the endpoint or your login: link a sandbox org to work with sandbox data, and commet link --org <slug> to switch.
-
Two kinds of auth. Resource commands and pull/push call the API with an API key, resolved as: COMMET_API_KEY env var -> project key in .commet/config.json (auto-generated by commet link) -> error. Your commet login credentials drive the platform commands: orgs, link, listen, create.
-
Sync in both directions. After dashboard changes, re-run commet pull to update commet.config.ts. After local edits to commet.config.ts, run commet push. Both show a diff and support --dry-run.
When to Load References