Unbase

CLI Reference

Every Unbase command and option.

unbase <command> [options]

Commands

CommandDescription
initWrite a starter unbase.config.ts.
planDry-run: show config, target readiness, snapshot, and the phase plan.
extractPull DB + auth + storage into the IR snapshot (read-only).
schemaEmit DDL or a Drizzle/Prisma schema (--orm); --apply runs DDL.
storageUpload mirrored objects to the storage target.
rewriteRewrite Supabase storage URLs in the snapshot to the target.
loadLoad DB rows into the target Postgres (FK-safe), then verify.
authLoad users + accounts into Better Auth (preserves bcrypt).
verifyReconcile target row counts against the snapshot.

Options

OptionApplies toDescription
--out <dir>allIR directory (default ./.unbase/ir).
--schema <name>extract, load, verify, authPostgres schema (default public).
--project <name>extractLabel for the snapshot manifest.
--mirrorextractDownload storage object bytes (default: list only).
--no-storageextractSkip storage entirely.
--target <url>load, verify, auth, schemaTarget Postgres URL (overrides env).
--source-host <h>rewriteSource storage host (else derived from env).
--orm <kind>schemasql (default), drizzle, or prisma.
--applyschemaRun the DDL on the target instead of writing a file.
--file <path>schemaOutput path (default <out>/schema.{sql,ts,prisma}).
--create-schemaloadCreate the target schema from the snapshot first.
--to <target>authbetter-auth (default) or authjs.
--convert-images <fmt>storageConvert images: webp, avif, jpeg, png, keep.
--convert-videos <fmt>storageTranscode videos: mp4, webm.
--registrystorageCreate + populate the storage_object registry table.
--image-quality <n>storageEncoder quality 1-100 (default 80).
--max-width <n> / --max-height <n>storageDownscale images/videos to fit.

A full run

npx unbase extract --mirror
npx unbase storage
npx unbase rewrite
npx unbase load
npx unbase auth

See Configuration for the environment variables each command reads.

On this page