Skip to content

CLI Reference

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

npm install -g @rebasepro/cli

Or use via npx:

npx @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 shared/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.

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 shared/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