CLI Reference

The fakebase CLI is intentionally narrow and opinionated. Run any command with --help for inline usage.

npx @byronwade/cli <command> [subcommand] [options]

fakebase init

Initialize Fakebase in the current project. Creates the fakebase/ directory structure (schema, seeds, storage) and a lib/fakebase.ts helper for Next.js apps.

fakebase init

fakebase dev

Start the Fakebase local development server.

OptionDescription
--studioAlso start the admin UI server
--port <port>Port for the dev server (default: 54321)
fakebase dev --studio --port 54321

fakebase studio

Open the dev-only admin UI in the browser. See admin-ui.md.

fakebase studio

fakebase migrate

Manage database migrations.

SubcommandDescription
new <name>Diff from the last migration and write SQL to fakebase/migrations/<timestamp>_<name>.sql
diffPrint the SQL diff between the current schema and the last applied migration
export [--supabase]Export pending migrations; --supabase writes to supabase/migrations/
applyApply pending migrations to the local adapter
statusShow migrations and their applied status
fakebase migrate new add_profiles
fakebase migrate diff
fakebase migrate export --supabase
fakebase migrate status

fakebase types gen

Generate database.types.ts from fakebase/schema.ts. The output matches Supabase's generator shape (Database with Tables/Views/Functions/Enums/CompositeTypes, per-table Row/Insert/Update, and Tables<> helpers).

fakebase types gen

fakebase seed

SubcommandDescription
runLoad and run fakebase/seeds/seed.ts against the local adapter
exportExport current seed data to supabase/seed.sql
genGenerate referentially-correct fake data from your schema
fakebase seed run
fakebase seed export

# Generate deterministic fake data straight from the schema -> supabase/seed.sql
fakebase seed gen --rows 20
fakebase seed gen --table posts:100 --table comments:300 --seed 42
fakebase seed gen --report          # show how each column resolves
fakebase seed gen --faker           # use @faker-js/faker for richer data

seed gen fills every column intelligently (emails, names, FK references, enums) with no hand-written seed file. See Fake Data Generation for the full guide: semantic mappings, overrides, determinism, and the pluggable Faker provider.

fakebase auth

Inspect the local auth service.

SubcommandDescription
inboxPrint the local OTP / magic-link inbox as a table
usersList all local auth users
fakebase auth inbox
fakebase auth users

fakebase snapshot

Save and restore named snapshots of the local adapter state — the local equivalent of backups/PITR.

SubcommandDescription
save [label]Save current state as a named snapshot (defaults to a timestamp label)
restore <label>Restore a previously saved snapshot
listList all saved snapshots
fakebase snapshot save before-refactor
fakebase snapshot list
fakebase snapshot restore before-refactor

fakebase verify supabase

Run compatibility scenarios against both Fakebase and a real Supabase stack, then print a match matrix. Requires SUPABASE_URL and SUPABASE_ANON_KEY in the environment. This is the recommended gate before any production handoff.

SUPABASE_URL=http://localhost:54321 SUPABASE_ANON_KEY=... fakebase verify supabase

fakebase doctor

Run a health check on the setup: schema, generated types, migrations, adapter, and app code. It also reports any unsupported APIs in use, so capability gaps surface early.

fakebase doctor

fakebase ai

Generate AI agent rule files and prompts. See ai-rules.md.

SubcommandDescription
initGenerate .cursor/rules/fakebase.mdc, AGENTS.md, fakebase.rules.md, and docs/ summaries
prompt [--target <t>] [--output <file>]Generate a task-specific agent prompt

--target accepts cursor, claude, copilot, or generic (default). --output writes to a file instead of stdout.

fakebase ai init
fakebase ai prompt --target cursor --output prompt.md