CLI Overview
The chkit CLI manages ClickHouse schemas, migrations, drift detection, and CI checks from the command line. It follows a workflow-oriented design: define your schema in TypeScript, generate migrations, apply them, and verify everything stays in sync.
Commands
Section titled “Commands”| Command | Description |
|---|---|
chkit init | Scaffold a new project with config and example schema |
chkit generate | Diff schema definitions against the last snapshot and produce migration SQL |
chkit migrate | Apply pending migration files to ClickHouse |
chkit status | Show migration status (total, applied, pending, checksum mismatches) |
chkit drift | Compare snapshot against live ClickHouse and report differences |
chkit check | Run policy checks for CI gates (pending, checksums, drift, plugins) |
chkit pull | Introspect live ClickHouse and generate a TypeScript schema file |
chkit codegen | Generate TypeScript types from schema definitions |
chkit plugin | List or run plugin commands |
Typical workflow
Section titled “Typical workflow”chkit init # scaffold config + example schemachkit generate # diff schema → produce migration SQL + snapshotchkit migrate # apply pending migrations to ClickHousechkit status # verify migration statechkit check # CI gate: pending, checksums, drift, pluginsGlobal flags
Section titled “Global flags”These flags are available on every command that loads a config file:
| Flag | Type | Default | Description |
|---|---|---|---|
--config <path> | string | clickhouse.config.ts | Path to the chkit config file |
--json | boolean | false | Emit machine-readable JSON output |
--help | boolean | — | Show help text |
--version | boolean | — | Print CLI version |