Skip to main content
Prerequisites:
  • A clisma.hcl config file in the current directory, or pass --config
Clisma ships a CLI for applying and inspecting migrations.

Commands

run

Apply pending migrations.
clisma run --env local

status

Show applied and pending migrations.
clisma status --env local

create

Create a new migration file.
clisma create --name create_users_table
If you omit --name, the CLI will prompt you. Migration filenames use the YYYYMMDDhhmmss_<name>.sql format.

checksum

Print the SHA-256 checksum for a migration file.
clisma checksum ./migrations/20240101123045_create_users.sql

Flags

  • --env <name> — environment from config file. Example: --env production
  • --config <path> — path to config file. Example: --config ./clisma.hcl
  • --var <key=value> — set variable value (repeatable). Example: --var ttl_days=30 --var replication_factor=3
  • --env-file <path> — load env vars from file. Example: --env-file .env

Advanced usage

Run with a custom config path and multiple variables:
clisma run --config ./infra/clisma.hcl --env staging --var ttl_days=30 --var replication_factor=2