Skip to content

CLI Reference

Run shki <command> --help for the authoritative list of flags. Each command has its own page under Commands; this page covers what they share.

Available on every command:

FlagPurpose
-c, --config <PATH>Config file. Default shki.toml.
-l, --dialect <DIALECT>postgres, mysql, or sqlite.
-u, --database-url <URL>Live database URL. Env fallback DATABASE_URL.
-d, --migrations-dir <P>Directory migrations are written to and read from (also --dir).
-S, --schema <NAME>Schema holding the migrations table (PostgreSQL).
-v, --verboseVerbose output.
-n, --no-colorDisable color output.
-V, --versionPrint version.

Commands that compile a Declarative Schema — diff, generate, codegen, queries — also accept:

FlagPurpose
--shadow-database-url <URL>External Shadow Database. Env fallback SHKI_SHADOW_DATABASE_URL.
--pg-version <14…18>Embedded PostgreSQL major version. Default 18. Env fallback SHKI_PG_VERSION.

Commands that read or write migrations — create, generate, migrate, status, down, bootstrap, adopt — also accept:

FlagPurpose
-T, --table <NAME>Migrations table name. Default __shki_migrations.
--prefix <index|timestamp|unix>Migration file name prefix style. Default index.
--generate-downGenerate Down Migrations alongside up migrations.
CommandAliasPurpose
configconfPrint the effective configuration
init [path]iScaffold a project: config, schema, migrations metadata
shadow installInstall embedded PostgreSQL from a hand-downloaded archive
diffCompile the Declarative Schema and preview the Migration Plan
generate <name>genWrite migration SQL, a Snapshot, and a Journal entry
create <name>newCreate a Custom Migration for hand-written SQL
migrate [mode]upApply pending migrations (all, steps <N>, to <NAME>)
statussList migrations, applied state, and checksum problems
down [count]Roll back applied migrations using Down Migrations
drop [migration]Remove a local migration and its artifacts
dumpExport live database shape as SQL, JSON, or a Directory Schema
bootstrap [name]strapAuthor a baseline migration from an existing database
adopt [name]baselineAdopt an existing database at a committed baseline
codegen <lang>codeGenerate Rust, TypeScript, or Protobuf types from schema shape
queriesqGenerate type-safe Rust query functions from annotated SQL