Getting started with clickhousectl: the ClickHouse CLI for local and cloud
clickhousectl (alias chctl) is a single CLI that manages local ClickHouse versions, isolated named servers, project scaffolding and ClickHouse Cloud services. Shared version binaries, per-directory named servers with auto-assigned ports, and a standard clickhouse/ layout for tables, materialized views, queries and seed data make side-by-side upgrade testing straightforward. Cloud auth is deliberately split: browser OAuth grants read-only access, while service creation, scaling and schema changes require an API key, a guard aimed at agent-driven use. The tool also installs Claude Code skills for local dev and cloud deploy, and fits into CI via a static binary, env-var auth and JSON output, with a sample GitHub Actions schema-validation workflow.
Related posts
- What's new in clickhousectl v0.6.0
ClickHouse mediumAdept
clickhousectl v0.6.0 makes local projects work like Git: any directory containing `.clickhouse/` is a project root discovered from subdirectories, `CLICKHOUSECTL_PROJECT_DIR` pins the root, and layered `config.d` directories let teams check server config into the repo. Cloud connections can skip password handling via browser sign-in in `cloud clickhouse client` or by writing the one-time password only to `.env` with `create --dotenv`. The release also adds command `search`, shell completions and a `feedback` command, GA Managed Postgres with Postgres 19, PrivateLink, standby counts and deletion protection, and ClickPipes columns generated from `schema-discover` output. Downloads are now verified against release checksums, and OAuth logins saved by 0.5.x need one fresh login.
- Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents
ClickHouse mediumAdept
A coding agent using the clickhousectl CLI stood up three ClickHouse Cloud services in us-east-1, eu-west-1 and ap-northeast-1, each ingesting OpenTelemetry logs, traces and metrics locally, with a federated global view in Europe for the ClickStack UI. The global view combines remoteSecure() table pointers to the remote regions with a Merge engine table over local and remote tables, so data stays resident in its region and is fetched only at query time. The agent scripted provisioning by parsing JSON output with jq and polling service status, then added SQL-based and native ClickStack alerts. The broader argument is that a scriptable CLI with clean JSON output suits agent-driven infrastructure better than a web console.
- What's new in clickhousectl v0.4.0
ClickHouse mediumAdept
clickhousectl v0.4.0 adds horizontal autoscaling flags for ClickHouse Cloud services (min/max replicas, mutually exclusive with vertical memory-range flags), beta ClickPipe schema discovery for Kafka and Kinesis sources, and new ingestion controls such as --skip-initial-load, --start-after for continuous object-storage pipes and --server-id for MySQL CDC pipes. Postgres config patch now does true partial updates, OAuth tokens move to a global ~/.clickhouse/tokens.json, and local server stop becomes idempotent while local remove refuses to delete a version in use unless --force is passed. The release also introduces anonymous opt-out telemetry that records flag names but never values, and can be disabled via a command, DO_NOT_TRACK=1, or compiled out with cargo build --no-default-features.
- clickhousectl v0.2.0: Postgres, ClickPipes and more
ClickHouse mediumAdept
clickhousectl v0.2.0 adds Postgres management, both local (Docker-backed, keyed on name and major version 16–18) and as ClickHouse Cloud managed Postgres. It also adds ClickPipes commands for Kafka, Kinesis, object storage, CDC from Postgres/MySQL/MongoDB and BigQuery snapshots, plus SQL over HTTP through Query Endpoints so no local ClickHouse binary is needed. Query Endpoints are locked to a per-service API key whose only grant is a sql_console_admin binding, so a leaked key reaches one service only. Other changes include Markdown-style table output that uses fewer tokens for agents, a --debug flag for credential resolution, and a standalone typed async Rust crate, clickhouse-cloud-api.
- New Terraform provider: Manage ClickHouse database users, roles, and privileges with code
ClickHouse mediumAdept
ClickHouse's new clickhousedbops Terraform provider, now generally available, manages databases, users, roles and privilege grants on both ClickHouse Cloud and self-hosted instances. A walkthrough provisions a Cloud service with the existing clickhouse provider, then wires clickhousedbops to the service's native-secure endpoint to create a database, three users, table-scoped SELECT roles and role grants in a single apply. For self-hosted clusters with multiple replicas, set cluster_name so resources are created on every replica. It must stay null on ClickHouse Cloud and should be omitted when user_directory uses replicated storage.