@postel/cli

The postel binary — one command today, migrate, which brings a database to the current canonical schema.

View as Markdown

@postel/cli ships the postel binary. It has exactly one command:

postel migrate

postel migrate --dialect <postgres|sqlite|mysql> --url <connection-string>
FlagRequiredMeaning
--dialectyespostgres, sqlite, or mysql — selects the adapter whose canonical migrations run
--urlyesThe connection string (for sqlite, the database file path)

Runs the target dialect's canonical forward-only migrations — the same ones the adapter's autoMigrate runs — and brings the database to the current schema version. It owns its connection (opens it, closes it, exits), is idempotent, and exits non-zero on failure, so a broken migration fails your deploy step rather than your app boot.

The corresponding database driver must be installed alongside (pg, better-sqlite3, or mysql2) — the CLI imports it lazily per dialect.

Any other command exits with an error; more verbs land as the operational surface grows.

When to use it

Production deploys where the app boots with autoMigrate: false — the full pattern, including the schema-version handshake that backs it, is on Migrations & postel migrate.

On this page