PluginBench
Skill
Official
Review
Audit score 70

clickhousectl-local-dev

clickhouse/agent-skills

Set up a local ClickHouse development environment with tables and sample data in minutes.

What is clickhousectl-local-dev?

This skill guides you through installing ClickHouse locally using clickhousectl, initializing a project structure, starting a server, creating tables, and seeding data. Use it when you need a working ClickHouse instance for development or prototyping.

  • Install clickhousectl and ClickHouse binaries to your machine
  • Initialize a standard folder structure for tables, views, queries, and seed data
  • Start and manage local ClickHouse servers in the background
  • Create table schemas and apply them to running servers
  • Load sample data for development and testing
  • Verify setup by querying tables

How to install clickhousectl-local-dev

npx skills add https://github.com/clickhouse/agent-skills --skill clickhousectl-local-dev
Prerequisites
  • curl (for downloading clickhousectl)
  • ~/.local/bin directory or ability to add it to PATH
Claude Code
Cursor
Windsurf
Cline

How to use clickhousectl-local-dev

  1. 1.Run `which clickhousectl` to check if installed; if not, run `curl -fsSL https://clickhouse.com/cli | sh`
  2. 2.Run `clickhousectl local use latest` to install ClickHouse and set it as default
  3. 3.Run `clickhousectl local init` from your project root to create the folder structure
  4. 4.Run `clickhousectl local server start --name <name>` to start a local server
  5. 5.Write CREATE TABLE statements in `clickhouse/tables/` and apply them with `clickhousectl local client --name <name> --queries-file clickhouse/tables/<file>.sql`
  6. 6.(Optional) Write INSERT statements in `clickhouse/seed/` and apply them the same way
  7. 7.Run `clickhousectl local client --name <name> --query "SHOW TABLES"` to verify tables exist

Use cases

Good for
  • Building an analytics application that requires ClickHouse as the database backend
  • Prototyping queries and data models before deploying to production
  • Setting up a local development environment that mirrors a ClickHouse Cloud setup
  • Testing table schemas and INSERT performance on your machine
  • Creating reproducible development environments for team collaboration
Who it's for
  • Backend developers building analytics or OLAP applications
  • Data engineers prototyping ClickHouse schemas and queries
  • Teams evaluating ClickHouse for a new project
  • Anyone wanting to learn ClickHouse locally before using managed services

clickhousectl-local-dev FAQ

What if clickhousectl is not found after installation?

Add ~/.local/bin to your PATH by running `export PATH="$HOME/.local/bin:$PATH"` or open a new terminal session.

Can I use a different ClickHouse version?

Yes, use version specifiers like `stable`, `26.4`, or `26.4.2.10` instead of `latest` in the `clickhousectl local use` command.

Is the clickhouse/tables folder structure required?

No, it is optional. If you already have your own folder structure for SQL files, you can skip the init step and adapt the paths in later commands.

How do I check which servers are running and their ports?

Run `clickhousectl local server list` to see all running servers and their exposed ports.

What should I do when ready to deploy to production?

Use the `clickhousectl-cloud-deploy` skill to help deploy to ClickHouse Cloud.

Full instructions (SKILL.md)

Source of truth, from clickhouse/agent-skills.


name: clickhousectl-local-dev description: 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. license: Apache-2.0 metadata: author: ClickHouse Inc version: "0.2.0"

Local ClickHouse Development Setup

This skill walks through setting up a complete local ClickHouse development environment using clickhousectl. Follow these steps in order.

When to Apply

Use this skill when the user wants to:

  • Build an application that needs an analytical database or ClickHouse specifically
  • Set up a local ClickHouse instance for development
  • Install ClickHouse on their machine
  • Create tables and start querying ClickHouse locally
  • Prototype or experiment with ClickHouse

Step 1: Install clickhousectl

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.


Step 2: Install ClickHouse and set the default

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.


Step 3: Initialize the project

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.


Step 4: Start a local server

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

Step 5: Create the schema

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

Step 6: Seed data (optional)

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

Step 7: Verify the setup

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.