home / databases / clickhouse

ClickHouse CLI

Official · ClickHouse
46k

Official ClickHouse CLI for running SQL against servers, loading data, and querying files locally.

$curl https://clickhouse.com/ | sh
Language
C++
Stars
46,238
Category
Databases
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

ClickHouse ships a native SQL client and a local query utility in the same toolchain. It gives you a direct command surface for querying ClickHouse servers or using ClickHouse SQL on local and remote files without standing up a cluster.

What It Enables
  • Run ad hoc or scripted SQL against ClickHouse servers with --query, stdin, and URI or flag-based connection options.
  • Insert data from files or pipelines, parameterize queries from the command line, and export results in formats such as CSV or JSON.
  • Use clickhouse-local to query local files or S3 objects, infer schemas, and convert data between formats without starting a server.
Agent Fit
  • Batch mode, stdin/stdout piping, parameterized queries, and explicit flags make it easy to wrap in shell or CI loops.
  • Machine-readable output is available, but you need to request it with --format, --output-format, or SQL FORMAT clauses because interactive defaults are human-oriented.
  • Best fit for agents already operating in a ClickHouse environment or data pipeline; most failures come from credentials, target state, or SQL errors rather than the CLI surface.
Caveats
  • Server workflows require reachable ClickHouse instances and credentials; if you omit a password, the client will prompt interactively.
  • clickhouse-local is positioned for ad hoc file processing and testing, not as a production serving layer.