Skip to content

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.

CommandDescription
chkit initScaffold a new project with config and example schema
chkit generateDiff schema definitions against the last snapshot and produce migration SQL
chkit migrateApply pending migration files to ClickHouse
chkit statusShow migration status (total, applied, pending, checksum mismatches)
chkit driftCompare snapshot against live ClickHouse and report differences
chkit checkRun policy checks for CI gates (pending, checksums, drift, plugins)
chkit pullIntrospect live ClickHouse and generate a TypeScript schema file
chkit codegenGenerate TypeScript types from schema definitions
chkit pluginList or run plugin commands
chkit init # scaffold config + example schema
chkit generate # diff schema → produce migration SQL + snapshot
chkit migrate # apply pending migrations to ClickHouse
chkit status # verify migration state
chkit check # CI gate: pending, checksums, drift, plugins

These flags are available on every command that loads a config file:

FlagTypeDefaultDescription
--config <path>stringclickhouse.config.tsPath to the chkit config file
--jsonbooleanfalseEmit machine-readable JSON output
--helpbooleanShow help text
--versionbooleanPrint CLI version