Docs / Start / CLI

CLI

Install

The CLI is published on npm as fastbase-cli: run it with npx -y fastbase-cli <command> or install it once with npm install -g fastbase-cli (then fastbase <command>). Inside this repository it is the @fastbase/cli package. pnpm --filter @fastbase/cli build produces a self-contained packages/cli/dist/bin.js that runs with plain Node.js. Until the package is published to npm, run it from a checkout:

pnpm fastbase <command>          # inside the FASTBASE repository
node /path/to/fastbase/packages/cli/bin/fastbase.mjs <command>   # anywhere

Commands

Command What it does
fastbase login Sign in. Stores an access token in ~/.fastbase/config.json (never your password).
fastbase logout Remove the stored token.
fastbase whoami Show the signed-in account.
fastbase init Link the folder to a project without deploying.
fastbase deploy [dir] Analyze, build and publish. Creates the project on first use.
fastbase status Live / building / failed, URL, last deployment, database.
fastbase projects List your projects.
fastbase logs Runtime log of the live version. --build, --deployment <id>, --follow.
fastbase env list Variable names and who manages them. Values are never printed.
fastbase env set KEY=VALUE … Store variables (encrypted). --env-file .env reads a file.
fastbase env rm KEY Remove a variable you set.
fastbase rollback [number] Restore the last working version, or a specific deployment number.

Common options: --project <slug>, --environment production|preview|development, --json.

deploy options

Option Meaning
--preview Deploy to the preview environment
--name <name> Name for a newly created project
--env KEY=VALUE Provide a variable (repeatable)
--env-file <path> Provide variables from a local file
--message <text> Note stored with the deployment
--verbose Also print build and runtime output

The first deploy writes .fastbase/project.json so later deploys go to the same project. Commit it or ignore it — it contains no secrets.

For scripts and AI agents

--json prints exactly one JSON document to stdout and nothing else:

fastbase deploy --json
{
  "ok": true,
  "status": "LIVE",
  "url": "https://myproject.example.dev",
  "project": { "id": "…", "name": "myproject", "slug": "myproject", "created": false },
  "deployment": { "id": "…", "number": 12, "environment": "production", "error": null, "diagnosis": null },
  "detected": { "framework": "Next.js", "summary": ["Next.js detected", "PostgreSQL required"] }
}

On failure, ok is false and either error (the command could not run) or deployment.diagnosis (the deployment failed) explains why.

Exit code Meaning
0 Success
1 The deployment or request failed
2 Wrong usage, not logged in, or required values missing
3 FASTBASE could not be reached
4 Timed out waiting

Authentication without a login

export FASTBASE_TOKEN=fbp_…
export FASTBASE_API_URL=https://api.<your-fastbase-domain>
fastbase deploy --json

Create the token under Settings → Access tokens, and limit its scopes to what the job needs (for a deploy bot: projects:read, projects:write, deployments:read, deployments:write, env:read, env:write, logs:read).