Skip to main content
Use this page to choose the command by job. Open the command page when you need exact flags or exit codes.

Generate and prove

diff

Generate a replay-safe migration from two schema sources.

check

Validate migration SQL for replay safety and hazards.

verify

Apply a migration twice in disposable databases.

types

Generate TypeScript and Zod outputs from schema files.

scan

Score RLS, grant, and hygiene findings without a database.

type-contract

Gate breaking generated TypeScript/Zod contract changes.

Operate

migrations

Reconcile files on disk with applied database history.

sync

Run safety gates, reconcile targets, and apply pending migrations.

config validate

Check config paths, sources, and credential references.

contracts

Export, diff, push, and pull cross-repository schema contracts.

Inspect

plan

Print the object-level diff plan as JSON.

inspect

Print the extracted schema model as JSON.

fingerprint

Print the canonical equality hash for a source.

audit

Report modeled and unsupported schema coverage.

Utilities

corpus

Run the dirty-real regression oracle.

doctor

Diagnose local setup and database capability.

onboard

Detect incumbent migration tooling and print ordered remediation.

init

Scaffold or repair the project setup bundle.

explain

Decode a SUPA_* diagnostic code offline.

Shell and engine

completion

Print shell completion scripts for bash, zsh, or fish.

selfcheck

Compare live-catalog extraction with engine representation.

Defaults

When you omit flags, supaschema reads supaschema.config.json.
AreaDefault
--fromconfig.sources.from; "auto" resolves valid git:HEAD, then a database URL, then empty:
--toconfig.sources.to, then dir:<config.schemaPaths[0]>
Migration outputconfig.migrationsDir
check inputevery .sql file in config.migrationsDir; fails when none exist unless --allow-empty is passed
verify --migrationnewest .sql file in config.migrationsDir

Global flags

--config
path
Use an explicit JSON config file instead of supaschema.config.json.
--env
string
Read the database URL from a named environments entry in config.
--quiet
boolean
Suppress non-essential diagnostic output.

Exit codes

CodeMeaning
0Success
1Runtime error, bad arguments, unreadable input, or crash
2Diagnostics contained at least one error
3diff --fail-on-diff found operations
Last modified on June 18, 2026