CLI reference
Every camplax command and flag — sign-in, local dev, deploys, database and agent setup.
The Camplax CLI is camplax. Install it with npm install -g camplax (Node 24+), then camplax help prints this same list. The dashboard and the CLI use the same projects and the same deploys — nothing you can do in one is hidden from the other.
Most commands take the project slug from the folder's link (camplax link <slug> writes .camplax/link.json) or from camplax.json; pass the slug positionally — or --project/-p on deploy — to override.
Setup
| Command | What it does |
|---|---|
camplax login | Sign in — opens a browser to authorise this machine, stores CAMPLAX_TOKEN in the CLI config |
camplax login <token> | Sign in by pasting a cx_cli_… token (mint one in the console — Account → Access tokens) or a project API key |
camplax whoami | Print the current session as JSON |
camplax create [dir] | Scaffold a Plax app (sign-in, notes, server AI); camplax create . writes into the current folder when it is empty or git-only; --force into a non-empty dir |
camplax init [name] | Write a camplax.json for this repo (--force overwrites); --app scaffolds the Plax starter into this folder, same as create . |
camplax link <slug> | Link this folder to an existing project |
camplax doctor | Plain-English checks: env, secrets, Plax, sign-in, link |
camplax probe [slug] | Live write → read → delete checks of this project's features — see below |
Working locally
| Command | What it does |
|---|---|
camplax dev | Pull the vault env into .env.local and run the start command; the production database is blocked by default |
camplax dev --use-production-database | Explicitly allow the linked production database |
camplax dev --port <n> / --command <cmd> / -c <cmd> | Override the port or the start command |
camplax env pull [--file .env.local] | Write the project's vault into a local .env (-f to choose the file) |
camplax env push [--file .env] | Upload a local .env into the vault and restart the app |
camplax secrets pull|push | Legacy alias for env pull|push |
camplax add <id…> | Install components or plugins into the app (camplax add --list to browse) |
env push only accepts UPPER_SNAKE_CASE keys, skips empty values, and never touches keys Camplax manages — DATABASE_URL, DIRECT_URL, BETTER_AUTH_SECRET, anything starting CAMPLAX_. When camplax.json lists env names, push sends only those keys.
Shipping
| Command | What it does |
|---|---|
camplax deploy [--branch <name>|-b] [--project <slug>|-p] [--json] | Queue a deploy; the default branch goes to production, any other branch to a preview |
camplax deploy --local | Upload and deploy this folder without a connected repo — honours .gitignore + .camplaxignore, never ships .git, node_modules or .env* |
camplax rollback [deploy-id] [--json] | Re-promote a previous production build without rebuilding |
camplax import --name <slug> [--site <url>] [--db <postgres-url>] [--repo owner/name] [--json] | Create a project and queue a migration; needs at least one of --site, --db, --repo |
camplax logs [--tail|-t] [--filter errors|-f] [--search <q>|-s] | Recent logs, or stream with --tail |
camplax db studio | Open the schema editor in the console |
camplax db migrate | Apply pending local SQL migrations to the project database |
camplax gen types [--out database.types.ts|-o] | Write TypeScript types from the live schema |
camplax open [slug] [--page deploys] | Print and open this project in the console |
camplax mcp [--check] | Print how Claude Code, Cursor and other agents connect; --check verifies the stored token. One line also works: npx add-mcp https://camplax.dev/mcp |
Checking a live app
camplax probe # write → read → delete checks against real features
camplax probe --only database,auth # a subset of checks
camplax probe --json # machine-readable report; exit 1 if any check fails
camplax probe --strict # exit 1 when a check skipped, not only when it failed
camplax probe --strict --allow-skip domains,webhooks
Each check prints pass, skip or fail. A skip means the feature is not set up on this project — under --strict, "not checked" counts the same as "not working" unless you allow it.
In CI
export CAMPLAX_TOKEN="$CAMPLAX_TOKEN" # a cx_cli_… token from camplax login
camplax deploy --json # parse the queued deploy, no browser involved
--json output and JSON errors with a code make deploy, import and probe safe to drive from a pipeline or a coding agent. The same verbs exist over MCP — see AI agents and MCP.
Environment variables
| Variable | Meaning |
|---|---|
CAMPLAX_TOKEN | Machine or session token (cx_cli_…) — the way to sign in on CI |
CAMPLAX_API_URL | API base (default https://camplax.dev) |
CAMPLAX_CONSOLE_URL | Console base (default https://camplax.dev/app) |
camplax.json
When camplax.json is present it is the source of truth for the repo — name, region, build (install, command, start), env names, database, cron and domains:
{
"name": "my-app",
"region": "iad",
"build": {
"install": "pnpm install",
"command": "pnpm build",
"start": "pnpm start"
},
"env": ["DATABASE_URL", "STRIPE_PRICE_ID"],
"database": { "branchOnPreview": true },
"cron": [],
"domains": []
}