CLI Reference
Overview
Section titled “Overview”The Rebase CLI (rebase) manages your project from scaffolding to deployment.
Installation
Section titled “Installation”npm install -g @rebasepro/cliOr use via npx:
npx @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 shared/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 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 shared/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