CLI
@pluralize/cli is the developer-facing command-line tool. It does everything the
dashboard does — create apps, manage CORS, configure plans — without the clicking.
It also ships a Claude Code skill so AI coding assistants can integrate Pluralize
into your project automatically.
npm i -g @pluralize/cli
pluralize --versionThe fast path
Three commands take a fresh Next.js project from "no auth" to "live signup form":
pluralize login # interactive: email + password
pluralize init --yes # creates app, writes .env.local, adds CORS, prints snippets
npm run dev # then visit http://localhost:3000/signupinit is idempotent: re-running it on an already-configured project does nothing
destructive. It picks up the existing app, leaves the env file alone unless you pass
--key, and just verifies CORS + runs doctor.
Use it from your AI editor
If you're using Claude Code, install the skill once:
pluralize skill installThen in Claude Code, ask "Add Pluralize to this app" — the skill drives the CLI
through the full integration: detects your framework, runs init, drops in
lib/pluralize.ts + lib/use-current-user.ts + app/signup/page.tsx, identifies
hardcoded user IDs in your existing code, and proposes the refactor. It never
invents SDK symbols (the markdown carries the verified surface) and it stops to
have you type your password — never tries to capture it.
The skill installs to ~/.claude/skills/pluralize-integrate/SKILL.md. Override the
target with --target <path> if you want it elsewhere; print without writing with
pluralize skill show.
Command reference
Auth
| Command | What it does |
|---|---|
| pluralize login | Interactive email + password. Stores a 4h session at ~/.pluralize/credentials.json (mode 0600). |
| pluralize logout | Wipes the credentials file. Idempotent. |
| pluralize whoami | Prints email + default app id, or "Not logged in" with exit code 1. |
Apps
| Command | What it does |
|---|---|
| pluralize app list | Lists every app you own. --json for raw output. |
| pluralize app create <name> | Creates an app and prints the publishable key once. Saves the new app's id as your default. |
| pluralize app use <id-or-slug> | Switches the default app for subsequent commands. |
| pluralize app regenerate-key | Mints a fresh pk_live_…. Invalidates the previous key immediately — destructive. |
Environment
| Command | What it does |
|---|---|
| pluralize env pull [path] | Default path is .env.local. Writes/upserts NEXT_PUBLIC_PLURALIZE_APP_ID. Pass --key <pk_live_…> to also write NEXT_PUBLIC_PLURALIZE_API_KEY. Preserves comments and key order in existing files. |
CORS
| Command | What it does |
|---|---|
| pluralize cors list | Prints current allowed origins. |
| pluralize cors add <origin> | Appends to the allowlist (no duplicates). Origin must match https?://host[:port] — no path, no trailing slash. |
| pluralize cors remove <origin> | Removes the entry, leaves everything else. |
Plans
| Command | What it does |
|---|---|
| pluralize plans list | Lists plans on the default app. |
| pluralize plans add <slug> --name <n> --price <cents> [--currency usd\|eur\|gbp] [--interval month\|year] | Creates a plan. Free plans (--price 0) skip Stripe; paid plans require Stripe Connect at /dashboard/billing. |
| pluralize plans entitle <plan-slug> <feature-key> <value> | Adds an entitlement. Keys starting with max_ or limit_ are stored as numeric limits; everything else is a boolean. |
Diagnostics
| Command | What it does |
|---|---|
| pluralize doctor [--origin <url>] | Runs a battery: credentials valid, default app set, origin in CORS, env file populated, at least one plan exists. Exit 0 if all green, 1 otherwise. |
Skill distribution
| Command | What it does |
|---|---|
| pluralize skill install [--target <path>] [--force] | Writes the bundled SKILL.md to ~/.claude/skills/pluralize-integrate/. --force overwrites a customized one. |
| pluralize skill show | Prints the skill markdown to stdout. Useful for piping into other AI tools. |
Orchestration
| Command | What it does |
|---|---|
| pluralize init [--yes] [--app <id>] [--key <pk_live_…>] [--origin <url>] | Login → pick or create app → write .env.local → ensure CORS → print snippets → run doctor. With --yes, defaults every prompt. |
Global flags
--app <id>— override the default app for this command only.--json— structured output, one object per command. Errors go to stderr.--verbose— log HTTP requests to stderr.--help/-h— print usage.
Environment
PLURALIZE_BASE_URL— override the API base URL (defaulthttps://pluralize.app). Useful when you self-host or run against a staging instance.
Exit codes
0— success.1— user error (bad args, not authenticated, validation failed, doctor red).2— server error (5xx) or unexpected exception.
Honest limitations
- Sessions are 4 hours. There's no refresh token in v1; on 401 the CLI tells you to
run
pluralize loginagain. - The publishable key is plaintext-once at creation. Lose it and your only option is
app regenerate-key, which invalidates the previous key. Save it on first sight. - Stripe Connect is not driven by the CLI — it must be initiated from the dashboard at pluralize.app/dashboard/billing.
- Existing-data migrations from your old single-user table are not automated. Write a
one-off script that loops over old rows and calls
app.db.collection(name).insert(…)while logged in as the owner.