CLI Reference
Overview
Section titled “Overview”The Rebase CLI (rebase) manages your project from scaffolding to deployment.
Installation
Section titled “Installation”pnpm add -g @rebasepro/cliOr use via pnpm dlx:
pnpm dlx @rebasepro/cli <command>Commands
Section titled “Commands”rebase init
Section titled “rebase init”Initialize a new Rebase project:
rebase init [directory]Sets up the project structure with frontend, backend, and shared packages.
rebase dev
Section titled “rebase dev”Start the development server:
rebase devStarts both frontend and backend with hot reloading.
rebase schema generate
Section titled “rebase schema generate”Generate Drizzle ORM schema from your TypeScript collections:
rebase schema generateThis reads your collections from config/collections/ and generates backend/src/schema.generated.ts with Drizzle table definitions, enums, and relations.
rebase db push
Section titled “rebase db push”Push schema changes directly to the database (development only):
rebase db pushrebase db generate
Section titled “rebase db generate”Generate SQL migration files from schema changes:
rebase db generateCreates timestamped migration files in drizzle/ that can be reviewed and committed.
rebase db migrate
Section titled “rebase db migrate”Run pending database migrations:
rebase db migrateApplies all unapplied migrations to the database.
rebase db studio
Section titled “rebase db studio”Open Drizzle Studio to browse your database visually:
rebase db studiorebase generate-sdk
Section titled “rebase generate-sdk”Generate a typed client SDK from your collection definitions:
rebase generate-sdkCreates TypeScript types and a type-safe client for all your collections.
rebase doctor
Section titled “rebase doctor”Run diagnostics to detect drift between your collections, the generated schema, and the current database state:
rebase doctorrebase auth
Section titled “rebase auth”Authentication management commands:
rebase auth create-user --email admin@example.com --password secretrebase auth reset-password --email admin@example.comMigration Workflow
Section titled “Migration Workflow”The typical workflow for schema changes:
# 1. Edit your collection in config/collections/# 2. Generate the Drizzle schemarebase schema generate
# 3. Generate SQL migrationrebase db generate
# 4. Review the generated SQL in drizzle/
# 5. Apply the migrationrebase db migrateNext Steps
Section titled “Next Steps”- Schema as Code — How schema generation works
- Quickstart — Get started