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.

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.

Open Drizzle Studio to browse your database visually:

rebase db studio

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 create-user --email admin@example.com --password secret
rebase auth reset-password --email admin@example.com

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