setup

作成者: clickhouse

このスキルは、新しくチェックアウトした後、またはpackage.jsonファイルに影響する変更をプルした後に、npm run test:*、npm run lint、npm run typecheck、npm run buildの各スクリプトを実行する前に使用してください。

npx skills add https://github.com/clickhouse/clickhouse-js --skill setup

clickhouse-js Repository Setup

Use this skill before running any of the npm run test:*, npm run lint, npm run typecheck, or npm run build scripts in a fresh checkout (or after pulling changes that touch package.json files).

Prerequisites

  • Node.js 22 recommended (matches .nvmrc). The root package.json declares "engines": { "node": ">=20.19.0" }, and CI tests Node 20, 22, 24, and 26.
  • Docker with the Compose plugin (docker compose ...). Required only for integration tests and any example that talks to a real server.

1. Install dependencies

This is an npm workspaces repo (packages/*), with two additional independent example packages (examples/node, examples/web) that have their own package.json and are not part of the workspaces.

Install all three:

npm install
npm --prefix examples/node install
npm --prefix examples/web install

The root postinstall script patches node_modules/parquet-wasm/package.json; it runs automatically as part of npm install.

2. Build the workspace packages

The workspace packages (@clickhouse/client-common, @clickhouse/client, @clickhouse/client-web) must be built before some tests, examples, and typechecks can resolve their inter-package imports:

npm run build

This runs build in every workspace package.

3. Start ClickHouse (only for integration tests / examples)

Unit tests do not need a server. Integration tests (npm run test:*:integration*) and the example runners do.

From the repo root:

docker compose up -d

This starts both the single-node setup (clickhouse on 8123/9000, clickhouse_tls on 8443/9440) and the two-node cluster (clickhouse1, clickhouse2, plus the nginx round-robin entrypoint on 8127). All services use non-overlapping ports so a single up -d covers every integration test mode.

To override the server version, set CLICKHOUSE_VERSION when starting Compose; for example: CLICKHOUSE_VERSION=head docker compose up -d, CLICKHOUSE_VERSION=latest docker compose up -d, or CLICKHOUSE_VERSION=24.8 docker compose up -d to use an explicit version tag.

4. Verify

After the steps above you can run, for example:

  • npm run lint — lint every workspace package
  • npm run typecheck — typecheck every workspace package
  • npm run test:node:unit / npm run test:web:unit — unit tests, no server required
  • npm run test:node:integration / npm run test:web:integration — integration tests, server required
  • From examples/node or examples/web: npm run lint, npm run typecheck, npm run run-examples

See npm run from the repo root for the full list of test scripts.

clickhouseのその他のスキル

clickhouse-best-practices
clickhouse
ClickHouseのベストプラクティス28ルールを、スキーマ設計、クエリ最適化、データ取り込み戦略に分類。プライマリキーとデータ型の選択(不変の設計判断)、JOINとクエリの最適化、挿入のバッチ処理とミューテーション回避の3つの重要領域をカバー。影響度で優先順位付けされた28ルールを含み、ClickHouseのカラムナストレージとスパースインデックスの仕組みにより、スキーマ設計とクエリ最適化のルールはCRITICALとマーク。構造化されたレビュー手順を提供...
official
clickhouse-js-node-coding
clickhouse
Write idiomatic application code with the ClickHouse Node.js client (`@clickhouse/client`). Use this skill whenever a user is *building* against the Node.js…
official
clickhousectl-cloud-deploy
clickhouse
ユーザーがClickHouseをクラウドにデプロイしたい、本番環境に移行したい、ClickHouse Cloudを使用したい、マネージドClickHouseサービスをホストしたい、またはローカルから移行したい場合に使用します。
official
clickstack-otel-collector
clickhouse
Use when a user wants to wire an OpenTelemetry collector into a Managed ClickStack service on ClickHouse Cloud, either by deploying a new local collector…
official
infra-clickhouse
clickhouse
Sets up and manages ClickHouse using the clickhousectl CLI — installs and runs a local ClickHouse server for development, and creates managed ClickHouse Cloud…
official
infra-postgres
clickhouse
Sets up and manages Postgres using the clickhousectl CLI — runs a local Docker-backed Postgres for development, and creates and operates managed ClickHouse…
official
clickhouse-best-practices
clickhouse
ClickHouseのスキーマ、クエリ、または設定をレビューする際に必ず使用すること。推奨事項を提供する前に必ず確認すべき31のルールが含まれています。常に読んでください…
official
setup
clickhouse
このプラグインにバンドルされているClickHouse MCPサーバー接続のセットアップをユーザーに案内します。ユーザーが初めてプラグインをインストールしたときや、問題が発生したときに使用します…
official