Skip to content

CLI Reference

The Rebase CLI (rebase) manages your project from scaffolding to deployment.

pnpm add -g @rebasepro/cli

Or use via pnpm dlx:

pnpm dlx @rebasepro/cli <command>

Initialize a new Rebase project:

rebase init [directory]

Sets up the project structure with frontend, backend, and shared packages.

Start the development server:

rebase dev

Starts both frontend and backend with hot reloading.

Both ports are derived from the project’s path so several Rebase projects can run side by side. Use the URLs rebase dev prints. Pin one with rebase dev --port 3001.

Build the project into a deployable bundle in dist-bundle/:

rebase build

The bundle is the artifact you deploy — the runtime image loads it, so there is no application image to build yourself. Useful flags:

Flag Effect
--out <dir> Write the bundle somewhere other than dist-bundle/
--vendor Always install and ship the bundle’s dependencies
--no-vendor Never vendor; the pod installs on first start
--skip-type-check Skip typechecking (faster, less safe)
--no-static Skip building the frontend

Dependencies are vendored by default so a pod restart does not pay a 35–55 second install. A tree that grows past 200 MB on disk is dropped instead, because the upload limit is 100 MB compressed — see the changelog for the reasoning.

Run the built bundle as a production server:

rebase start

Reads PORT and the rest of .env, unlike rebase dev. Point it at a bundle elsewhere with rebase start --bundle ./dist-bundle.

Show the apps this repository declares:

rebase apps list

A repository can declare more than one deployable app — a backend and a marketing site, say. This is how you see what rebase build and deployment will act on.

Take ownership of the server process and its image:

rebase eject

Writes the backend entrypoint and a Dockerfile into the project and flips its backend over, so the repository builds its own image instead of running the published runtime. From then on platform runtime upgrades no longer reach it, and CORS, auth wiring, storage and shutdown become yours to configure.

Preview it with rebase eject --dry-run, which lists what would change and changes nothing. --force replaces an existing backend/src/index.ts or env.ts, keeping the current file as <name>.bak.

Generate Drizzle ORM schema from your TypeScript collections:

rebase schema generate

This reads your collections from config/collections/ and generates backend/src/schema.generated.ts with Drizzle table definitions, enums, and relations.

Push schema changes directly to the database (development only):

rebase db push

Generate SQL migration files from schema changes:

rebase db generate

Creates timestamped migration files in drizzle/ that can be reviewed and committed.

Run pending database migrations:

rebase db migrate

Applies all unapplied migrations to the database.

Generate a typed client SDK from your collection definitions:

rebase generate-sdk

Creates TypeScript types and a type-safe client for all your collections.

Run diagnostics to detect drift between your collections, the generated schema, and the current database state:

rebase doctor

Authentication management commands:

rebase auth reset-password --email admin@example.com --password NewPassword123!

Manage scoped service API keys — the credential an agent, script or another service uses, as opposed to an end user’s session:

rebase api-keys list
rebase api-keys create --name "Analytics" --permissions '[{"collection":"events","operations":["read"]}]'
rebase api-keys create --name "Full Access" --full-access --expires 90d
rebase api-keys revoke abc123-def456

--permissions takes a JSON array of { collection, operations } objects, or use --full-access for read/write/delete on every collection and function. --expires accepts 7d, 30d, 90d, 1y or an ISO date, and --rate-limit sets requests per 15-minute window. A key is shown once, at creation.

Keys are double-gated: the key’s own permissions and the row-level security of the identity it acts as both apply, so a key can never read more than that identity can.

Install the Rebase reference skills for your AI coding assistant. Supports Cursor, Claude Code, Windsurf, Gemini CLI and Antigravity:

rebase skills install
rebase skills install --agent claude,cursor
rebase skills install --agent all

See Agent Skills for the full list and where files are written.

Anonymous usage sharing. Opt-in, and off unless you turned it on:

rebase telemetry status
rebase telemetry show
rebase telemetry enable
rebase telemetry disable

status prints the current setting, show prints exactly what would be sent, and the other two change it. rebase init asks once; if you never ran init, nothing was ever collected.

The typical workflow for schema changes:

# 1. Edit your collection in config/collections/
# 2. Generate the Drizzle schema
rebase schema generate
# 3. Generate SQL migration
rebase db generate
# 4. Review the generated SQL in drizzle/
# 5. Apply the migration
rebase db migrate