clickhousectl is the CLI for ClickHouse: local and cloud.
With clickhousectl you can:
- Install and manage local ClickHouse versions
- Launch and manage local ClickHouse servers
- Execute queries against ClickHouse servers
- Set up ClickHouse Cloud and create cloud-managed ClickHouse clusters
- Manage ClickHouse Cloud resources
- Install the official ClickHouse agent skills into supported coding agents
- Push your local ClickHouse development to cloud
clickhousectl helps humans and AI-agents to develop with ClickHouse.
Installation
Quick install
~/.local/bin/clickhousectl. A chctl alias is also created automatically for convenience.
Requirements
- macOS (aarch64, x86_64) or Linux (aarch64, x86_64)
- Cloud commands require a ClickHouse Cloud API key
Local
Installing and managing ClickHouse versions
clickhousectl downloads ClickHouse binaries from GitHub releases.
ClickHouse binary storage
ClickHouse binaries are stored in a global repository, so they can be used by multiple projects without duplicating storage. Binaries are stored in~/.clickhousectl/:
Initializing a project
init bootstraps your current working directory with a standard folder structure for your ClickHouse project files. It is optional; you are welcome to use your own folder structure if preferred.
It creates the following structure:
Running queries
Creating and managing ClickHouse servers
Start and manage ClickHouse server instances. Each server gets its own isolated data directory at.clickhousectl/servers/<name>/data/.
--name, the first server is called “default”. If “default” is already running, a random name is generated (e.g. “bold-crane”). Use --name for stable identities you can start/stop repeatedly.
Ports: Defaults are HTTP 8123 and TCP 9000. If these are already in use, free ports are automatically assigned and shown in the output. Use --http-port and --tcp-port to set explicit ports.
Project-local data directory
All server data lives inside.clickhousectl/ in your project directory:
clickhousectl local server remove <name> to permanently delete a server’s data.
Authentication
Authenticate to ClickHouse Cloud using OAuth (browser-based) or API keys.OAuth login (recommended)
.clickhousectl/tokens.json (project-local).
API key/secret
.clickhousectl/credentials.json (project-local).
You can also use environment variables:
Auth status and logout
.clickhousectl/credentials.json > environment variables.
Cloud
Manage ClickHouse Cloud services via the API.Organizations
Services
Service create options
| Option | Description |
|---|---|
--name | Service name (required) |
--provider | Cloud provider: aws, gcp, azure (default: aws) |
--region | Region (default: us-east-1) |
--min-replica-memory-gb | Min memory per replica in GB (8-356, multiple of 4) |
--max-replica-memory-gb | Max memory per replica in GB (8-356, multiple of 4) |
--num-replicas | Number of replicas (1-20) |
--idle-scaling | Allow scale to zero (default: true) |
--idle-timeout-minutes | Min idle timeout in minutes (>= 5) |
--ip-allow | IP CIDR to allow (repeatable, default: 0.0.0.0/0) |
--backup-id | Backup ID to restore from |
--release-channel | Release channel: slow, default, fast |
Query endpoint management
Private endpoint management
Backup configuration
Backups
Members
Invitations
Keys
Activity
JSON output
Use the--json flag to print JSON-formatted responses.
Skills
Install the official ClickHouse Agent Skills from ClickHouse/agent-skills.Non-interactive flags
| Flag | Description |
|---|---|
--agent <name> | Install Skills for a specific agent (can be repeated) |
--global | Use global scope; if omitted, project scope is used |
--all | Install Skills for all supported agents |
--detected-only | Install Skills for supported agents that were detected on the system |