Skip to content

Start with an example

create-chkit scaffolds a working chkit project by downloading a curated example from the chkit repository and wiring it up against your chosen package manager. The default example is hello: two small tables and one migration.

  • Node.js 20+ or Bun 1.3.5+
  • A database. The scaffold prompt claims a free ObsessionDB dev instance, or set CLICKHOUSE_URL (and optionally CLICKHOUSE_USER / CLICKHOUSE_PASSWORD) for an existing ClickHouse.

Run the package without arguments to be prompted for a project name and to pick from the bundled examples. hello is the default in the repository manifest; pass --example hello to select it directly.

$ bun create chkit@latest

Pass a project directory and select hello explicitly:

$ bun create chkit@latest my-chkit-app --example hello

The scaffold then asks how to connect:

Claim a free ObsessionDB dev instance email code, ready in seconds
I already have an ObsessionDB account log in and pick a service
I already have a ClickHouse instance connect with env vars
Configure later

Choose Claim a free ObsessionDB dev instance and enter the emailed code. chkit creates a personal organization, provisions a free instance, and selects it. See Getting Started with ObsessionDB for the other paths, including the non-interactive signup commands.

For the full ClickBench schema and public dataset load, pass --example clickbench instead:

$ bun create chkit@latest my-chkit-app --example clickbench
FlagDescription
[project-directory]Target directory. Prompted if omitted.
-e, --example <name>Example name or full GitHub URL. Prompted with the list of bundled examples if omitted.
-m, --package-manager <pm>npm, pnpm, yarn, or bun. Auto-detected from the invoking package manager.
--skip-installSkip installing dependencies after scaffolding.
NameDescription
helloTwo small tables and one migration. Default. Claim a free ObsessionDB instance or use local ClickHouse.
clickbenchFull ClickBench schema and dataset load against ObsessionDB or ClickHouse.

The list and default live in examples/manifest.json. The same hello project can be cloned from examples/hello without the scaffolder.

Once the scaffold completes and a database is connected:

Terminal window
cd my-chkit-app
bun run migrate
bunx chkit query "SELECT name FROM system.tables WHERE database = 'default' AND name IN ('users', 'events') ORDER BY name"

Both tables come back, events then users. They are empty.

For a local ClickHouse instead of the claimed instance, set the endpoint before migrating:

Terminal window
cd my-chkit-app
export CLICKHOUSE_URL=http://localhost:8123
# export CLICKHOUSE_PASSWORD=...
bun run migrate
bunx chkit query "SELECT name FROM system.tables WHERE database = 'default' AND name IN ('users', 'events') ORDER BY name"