Kizaki
ReferenceCLI

Compile And Migrate

Validate your schema and manage database migrations.

kizaki compile

Generates the outputs the platform needs from your .inspire files: artifact.json (policy and schema artifact), schema.sql (database DDL), @kizaki/schema (typed entity objects), and @kizaki/client (typed RPC stubs).

kizaki compile

The compiler runs automatically during kizaki dev. Use kizaki compile standalone to inspect generated output, run validation in CI, or review the security surface before a deploy.

If you installed the public CLI via Homebrew or https://get.kizaki.ai/install.sh, the first kizaki compile run also bootstraps the matching managed runtime automatically before validation starts.

Options

FlagDescription
--checkValidate only — do not write generated files. Fast. Suited for CI and pre-commit hooks.
--security-reportGenerate a human-readable report of every access policy in the schema.

--check

Parse, analyze, and type-check without writing to disk.

kizaki compile --check

--security-report

Summarize every entity, role, and policy grant. Designed for security reviews.

kizaki compile --security-report

kizaki migrate

Version-controlled migration system. Diffs your current schema against the last snapshot, generates migration plans, and applies them.

Subcommands

CommandDescription
migrate plan --name <slug>Diff schema and generate a new migration in migrations/<NNNN_slug>/.
migrate applyApply pending committed migrations to the local database.
migrate apply --connection-string <url>Apply to an external database (staging, CI).
migrate dry-runShow SQL that would run, without executing.
migrate dry-run --connection-string <url>Preview against an external database.
migrate statusShow committed, applied, and source-drift state.
migrate status --connection-string <url>Check migration state of an external database.

Planning a Migration

kizaki migrate plan --name add_project_status

Creates a numbered directory under migrations/ with the plan file and SQL. Review and commit the plan — it is part of your application's history.

RESOLVE Markers

When the compiler cannot determine intent (e.g., rename vs. drop+add), it inserts a [RESOLVE] marker in the generated plan.migration file. Edit the plan to clarify intent before applying.

The migration system refuses to apply plans with unresolved markers.

Applying Migrations

kizaki migrate apply
kizaki migrate apply --connection-string "postgresql://user:pass@host:5432/db"

Previewing with dry-run

kizaki migrate dry-run
kizaki migrate dry-run --connection-string "postgresql://user:pass@host:5432/db"

Shows the exact SQL without touching the database.

Checking Status

kizaki migrate status

Shows which migrations are committed, applied, and whether the schema has drifted from the last snapshot.

Project Lock

migrate apply shares a lock with kizaki dev. You cannot run both against the same database. Stop the dev server before applying migrations manually, or let kizaki dev apply pending migrations on startup.

Typical Workflow

# Edit your .inspire schema, then:
kizaki compile --check          # fast validation
kizaki migrate plan --name add_project_status
# Review migrations/<NNNN_add_project_status>/plan.migration
kizaki migrate apply            # apply locally
# kizaki dev will also apply on next start

compile vs. migrate

compile answers: is the schema valid, and what should be generated? migrate answers: how does the database move from its current state to match the new schema? They are independent operations with independent outputs.

Related guide: Migrations

On this page