Registry / database / chkit
library0.1.0-beta.27jsnpmunverified

A CLI for managing ClickHouse schemas and migrations in TypeScript projects. Current stable version is 0.1.0-beta.27 (pre-release, beta stage). It provides a declarative YAML-based schema definition, automatic migration generation, and simple CLI commands (init, status, up, down, new). Differentiators vs raw SQL migrations: type-safe schema definitions, migration history tracking, and rollback support. Released irregularly as beta.

npm install chkit
INSTALL
IMPORT
SIG · CHKIT
C
chkit
databasejavascriptv0.1.0-beta.27
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

chkit (CLI)
npx chkit init
npm chkit init
CLI tool invoked via npx or global install
defineSchema
import { defineSchema } from 'chkit';
const { defineSchema } = require('chkit');
ESM-only; CommonJS require fails in Node < 16
Migration
import type { Migration } from 'chkit';
import { Migration } from 'chkit';
Migration is a type, not a value. Use type import.

Initialize a new chkit project with config and directory structure.

npx chkit init --directory ./chkit --host localhost --port 8123 --user default --password ''
Debug
Known issues
breakingIn v0.1.0-beta.20, the configuration file format changed from JSON to YAML. Existing JSON configs will cause an error.
fix
Convert your chkit.json to chkit.yml with equivalent settings.
affects: >=0.1.0-beta.20
gotchaThe CLI commands must be run from the project root where chkit config is located.
fix
Run commands from the root directory or use --config to specify path.
affects: all
deprecatedThe 'migrationsDir' option in config is deprecated as of v0.1.0-beta.25; use 'migrations.path' instead.
fix
Update config: replace 'migrationsDir' with 'migrations.path'.
affects: <=0.1.0-beta.24
breakingRequires Node.js >= 16 due to ESM-only distribution.
fix
Upgrade Node.js to version 16 or higher.
affects: >=0.1.0-beta.22
Errors
Common errors & fixes
Error: Cannot find module 'chkit'
chkit is not installed globally or locally
fix
Install chkit as a dev dependency: npm install --save-dev chkit
Error: Config file not found. Run 'chkit init' first.
chkit command executed outside project root or without init
fix
Run 'npx chkit init' in the project root to create config.
TypeError: defineSchema is not a function
Using CommonJS require instead of ESM import
fix
Use import statement: import { defineSchema } from 'chkit'
Upgrade
Version history
0.1.0-beta.27latest on npm
Audit
Dependencies
@clickhouse/clientrequiredHTTP client for ClickHouse
Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
packagechkit
chkit — npm install chkit · libregistry