skills/clickhousectl-local-dev/SKILL.md
Use when a user wants to build an application with ClickHouse, set up a local ClickHouse development environment, install ClickHouse, create a local server, create tables, or start developing with ClickHouse. Covers the full flow from zero to a working local ClickHouse setup.
npx skillsauth add ClickHouse/agent-skills clickhousectl-local-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill walks through setting up a complete local ClickHouse development environment using clickhousectl. Follow these steps in order.
Use this skill when the user wants to:
Check if clickhousectl is already available:
which clickhousectl
If not found, install it:
curl -fsSL https://clickhouse.com/cli | sh
This installs clickhousectl to ~/.local/bin/clickhousectl and creates a chctl alias.
If the command is still not found after install: The user may need to add ~/.local/bin to their PATH or open a new terminal session. Suggest:
export PATH="$HOME/.local/bin:$PATH"
Once installed, clickhousectl skills can be used to install the latest ClickHouse Agent Skills.
Install the latest ClickHouse version and set it as the system default:
clickhousectl local use latest
This installs ClickHouse, sets it as the default version used by clickhousectl local commands, and symlinks ~/.local/bin/clickhouse to the binary, putting clickhouse on your PATH (meaning you can invoke clickhouse directly, e.g. clickhouse client if needed).
You can use other version specifiers like stable, 26.4, 26.4.2.10 when needed.
From the user's project root directory:
clickhousectl local init
This creates a standard folder structure:
clickhouse/
tables/ # CREATE TABLE statements
materialized_views/ # Materialized view definitions
queries/ # Saved queries
seed/ # Seed data / INSERT statements
Note: This step is optional. If the user already has their own folder structure for SQL files, skip this and adapt the later steps to use their paths.
clickhousectl local server start --name <name>
This starts a ClickHouse server in the background.
To check running servers and see their exposed ports:
clickhousectl local server list
Based on the user's application requirements, write CREATE TABLE SQL files.
Write each table definition to its own file in clickhouse/tables/:
# Example: clickhouse/tables/events.sql
CREATE TABLE IF NOT EXISTS events (
timestamp DateTime,
user_id UInt32,
event_type LowCardinality(String),
properties String
)
ENGINE = MergeTree()
ORDER BY (event_type, timestamp)
When designing schemas, if the clickhouse-best-practices skill is available, consult it for guidance on ORDER BY column selection, data types, and partitioning.
Apply the schema to the running server:
clickhousectl local client --name <name> --queries-file clickhouse/tables/events.sql
If the user needs sample data for development, write INSERT statements to clickhouse/seed/:
# Example: clickhouse/seed/events.sql
INSERT INTO events (timestamp, user_id, event_type, properties) VALUES
('2024-01-01 00:00:00', 1, 'page_view', '{"page": "/home"}'),
('2024-01-01 00:01:00', 2, 'click', '{"button": "signup"}');
Apply seed data:
clickhousectl local client --name <name> --queries-file clickhouse/seed/events.sql
Confirm tables were created:
clickhousectl local client --name <name> --query "SHOW TABLES"
Run a test query:
clickhousectl local client --name <name> --query "SELECT count() FROM events"
If the user wants to use a managed ClickHouse service, use the clickhousectl-cloud-deploy skill to help the user deploy to ClickHouse Cloud.
tools
Use when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake) without setting up a server. Provides chDB — embedded ClickHouse SQL in Python with 1000+ functions, Session for stateful multi-step pipelines, parametrized queries, and cross-source joins via `s3()`, `mysql()`, `postgresql()`, `iceberg()`, `deltaLake()`, `remoteSecure()` table functions. TRIGGER when: user wants SQL on parquet/csv/files or across remote analytical sources; uses ClickHouse SQL features (window functions, windowFunnel, geoToH3, JSON path ops, Session, parametrized queries); imports `chdb` or calls `chdb.query()`. SKIP this skill for pandas-style DataFrame method-chaining (use chdb-datastore instead) or ClickHouse server administration.
tools
Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake as DataFrames and joining across sources. TRIGGER when: user mentions DataFrame, parquet, csv, "fast pandas", "speed up pandas", or cross-source DataFrame joins; user imports `chdb.datastore` or `from datastore import DataStore`. SKIP this skill for raw SQL syntax (use chdb-sql instead), ClickHouse server administration, or non-Python DataStore API work.
tools
Write idiomatic application code with the ClickHouse Node.js client (`@clickhouse/client`). Use this skill whenever a user is *building* against the Node.js client — configuring the client, pinging, inserting rows in JSON or raw formats, selecting and parsing results, binding query parameters, managing sessions and temporary tables, working with data types or customizing JSON parsing. Do NOT use for browser/Web client code.
tools
MUST USE when reviewing ClickHouse schemas, queries, or configurations. Contains 31 rules that MUST be checked before providing recommendations. Always read relevant rule files and cite specific rules in responses.