chkit
chkit: ClickHouse Schema & Migration Toolkit
chkit lets you define ClickHouse schemas in TypeScript, generate migration SQL, detect drift, and run CI checks from a single CLI.
Docs: https://chkit.obsessiondb.com
Connection and authorization
Use choices, target details and apply authorization already supplied by the user; ask only for missing information. Keep the workflow focused on TypeScript schema management unless the user asks for Sync or Python.
For a direct ClickHouse target, obtain CLICKHOUSE_URL (HTTP/S endpoint and port), CLICKHOUSE_USER, CLICKHOUSE_PASSWORD (explicitly empty is valid), and CLICKHOUSE_DB. Never infer localhost, a default username, an empty password or the database default as the user's verified target. Do not provision a managed instance unless requested.
Without credentials, install dependencies and prepare definitions offline. Generate migration SQL only after the database namespace is explicitly chosen. Do not run connected pull, query, status, drift, check or migrate against guessed endpoints. If the database name is unknown, ask for it and leave generation pending; do not invent a namespace. If a previous attempt emitted SQL against a placeholder, retarget definitions and regenerate only never-applied initial artifacts before connecting. Record what is prepared and what remains unverified.
Keep real credentials in the process environment or an ignored .env, never schema/migration/handoff files. Bun loads a root .env; npm/Node commands need explicit loading, such as node --env-file=.env ./node_modules/chkit/dist/bin/chkit.js check --strict --json from the root. Nested configs need a loader that resolves the root .env deliberately.
Before applying, verify the actual database identity and review generated SQL. Honor explicit development-database authorization without asking for repeat approval; obtain authorization for consequential writes that the task has not authorized. Missing credentials are required input, not a reason to stop offline work.