ClickHouse Client CLI
The native ClickHouse client executes SQL and exports results for agent-prepared analytical queries reviewed by a user.
- 50,763 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- The client reads or changes data according to SQL and account permissions; exports retain table contents locally.
Install
Manual install
curl https://clickhouse.com/ | shFirst README route. The command downloads ClickHouse; launch the downloaded client with ./clickhouse client. Inspect the script before executing it.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The client reads or changes data according to SQL and account permissions; exports retain table contents locally.
This is third-party code. Review the repository files before installing.
What it does
Before querying, users select a server and database identity. ClickHouse Client reads these settings from arguments or configuration. SQL can be entered interactively or supplied by a script, with results returned as tables or machine-readable data. Progress includes rows and bytes read and query time. Output formats such as CSV and JSON support downstream processing. Connection options come from arguments or configuration, and database credentials determine permitted actions.
Who it is for. ClickHouse analysts preparing queries with an agent and verifying results through a terminal client.
Good fit when
- Agent-prepared analytical SQL needs execution on an approved database.
- Query results need CSV or JSON export.
- A long query needs visible read progress.
- A script must repeat queries against an explicit connection.
Not a fit when
- You need to manage another database or an arbitrary HTTP API.
- The agent is not authorized to read the selected tables.
- Mutating SQL would run without checking the query and connection.
Example request
Prepare a read-only query for the approved table and explain its filter and output format before checking the connection and running it.Limitations
Queries require a reachable ClickHouse server. The native protocol means an HTTP endpoint is not automatically a suitable connection target. Older clients may lack newer server features, and matching versions are recommended. Database-user permissions control access; installing the CLI does not make queries safe or read-only. Connection configuration may contain a password, so keep it outside shared repositories and verify the selected connection.
How to disable. Close the client session and stop scheduled callers. Exiting does not undo changes already made to the database.
FAQ
How do I run the downloaded binary without system installation?
Use `./clickhouse client`.
Can I export CSV?
Yes. Select `--format CSV` at launch or add `FORMAT CSV` to the SQL query. The client prints the result in that format.
Does this client use HTTP?
No. It uses the native ClickHouse protocol.
What appears during a long query?
Progress, rows read, processed bytes and elapsed query time.
Where can I keep several connections?
Define named entries under `connections_credentials` in a configuration file selected with `--config`, then choose one with `--connection`.
Discussion
No questions or reviews yet.
Related
CLI toolsOfficial ClickHouse MCP server: the agent lists databases and tables and runs SQL, read-only by default
Official ClickHouse skills: schema and query rules, architecture decisions, chDB for Python and ClickHouse Cloud workflows
A Go MCP server for querying ClickHouse: schemas, SQL, tools generated from views, OAuth and Kubernetes deployment
chmonitor is a ClickHouse monitoring dashboard with a built-in MCP server: an agent inspects the cluster with read-only queries
The SQL client combines terminal database browsing with batch queries for agents using named connections and JSON results.
A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use
README in short
The main repository contains the database and its native client. The README install command targets Linux, macOS and FreeBSD.