Commet CLI
Generate TypeScript types from your Commet dashboard for autocomplete, scaffold new projects from billing templates, and manage organizations. Requires Node.js 18+.
Install
npm install -g commetQuick Start
commet login # Authenticate in browser
commet link # Link project to organization
commet pull # Generate .commet/types.d.tsAfter commet pull, SDK calls get autocomplete for planCode, feature, and seatType parameters:
await commet.usage.track({
customerId: "user_123",
feature: "api_calls", // autocomplete from pulled types
});
await commet.subscriptions.create({
customerId: "user_123",
planCode: "pro", // autocomplete from pulled types
});Commands
| Command | Description |
|---|---|
commet login | Authenticate with Commet (opens browser) |
commet logout | Remove credentials |
commet whoami | Show auth status and current organization |
commet link | Link project to an organization |
commet unlink | Unlink project |
commet switch | Switch to a different organization |
commet info | Show project and auth status |
commet pull | Generate .commet/types.d.ts |
commet list features | List features for the linked organization |
commet list seats | List seat types |
commet list plans | List plans |
commet create [name] | Scaffold new project from a billing template |
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 createis sandbox-only. Templates create plans and features in your sandbox organization. If you're logged into production, you need tocommet logoutand log back in to sandbox.- Commit
.commet/types.d.ts. The generated types file should be committed to your repo so the entire team gets autocomplete without each person runningcommet pull. - Two environments, two logins. Sandbox (
sandbox.commet.co) and Production (commet.co) are isolated. Switch by logging out and back in. - Run
commet pullafter dashboard changes. When you add plans, features, or seat types in the dashboard, re-runcommet pullto update the local types file.
When to Load References
- Full command flags and details -> references/commands.md
- Template descriptions and billing models -> references/templates.md
- Step-by-step project setup -> references/setup-workflow.md