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 readssupaschema.config.json.
| Area | Default |
|---|---|
--from | config.sources.from; "auto" resolves valid git:HEAD, then a database URL, then empty: |
--to | config.sources.to, then dir:<config.schemaPaths[0]> |
| Migration output | config.migrationsDir |
check input | every .sql file in config.migrationsDir; fails when none exist unless --allow-empty is passed |
verify --migration | newest .sql file in config.migrationsDir |
Global flags
Use an explicit JSON config file instead of
supaschema.config.json.Read the database URL from a named
environments entry in config.Suppress non-essential diagnostic output.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Runtime error, bad arguments, unreadable input, or crash |
2 | Diagnostics contained at least one error |
3 | diff --fail-on-diff found operations |

