Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

ClickHouse Client

$ clickhouse-client Official High Risk
ClickHouse · Database & Data · Apache-2.0 · macos / linux

clickhouse-client connects to ClickHouse servers (or local ClickHouse) over native TCP protocol for analytical SQL queries and bulk ingestion. Supports --query non-interactive execution, --format JSON / JSONEachRow, and server-enforced --readonly=1 setting.

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
brew install clickhouse
CLI vs MCP Decision CLI Preferred vs MCP

clickhouse-client --readonly=1 --format JSONEachRow --query "..." streams massive OLAP aggregations directly with native compression and zero MCP serialization bottleneck.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --query, --format JSON / JSONEachRow / TabSeparated, --readonly=1, and clean non-TTY execution.

  • Supports --query, --format JSON, --format JSONEachRow, and --readonly=1
Trust & Safety 21 / 25

--readonly=1 instructs the server to reject all writes and DDL (INSERT, ALTER, DROP), providing strong query safety.

  • Server-enforced --readonly=1 setting rejects writes and DDL
Setup & Portability 11 / 15

Monolithic binary (shared with clickhouse-local/server) for macOS and Linux; lacks native Windows support.

  • Large monolithic binary limited to macOS and Linux
Utility & Efficiency 14 / 15

Blazing fast columnar OLAP querying and rich native output formats (JSON, JSONEachRow, Parquet).

  • Native binary protocol + JSONEachRow / Parquet format support
Maintenance & Lineage 9 / 10

Official ClickHouse/ClickHouse client maintained by ClickHouse under Apache-2.0.

  • Official ClickHouse/ClickHouse repository
Docs & Verifiability 7 / 10

Detailed CLI and output-format docs at clickhouse.com/docs/en/interfaces/cli.

  • Official docs at clickhouse.com/docs/en/interfaces/cli

Security, Auth & Guardrails

Auth Modes
Config File Env API Key
Credential Storage

Connection settings in ~/.clickhouse-client/config.xml or via --host, --user, and CLICKHOUSE_PASSWORD env var.

Side Effects
Read-Only Remote Write Destructive
Cost & Quotas

100% free and Apache-2.0 open-source; ClickHouse Cloud instances incur hosted compute/storage billing.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# clickhouse-client Agent Rules
- Always pass `--query "<sql>"`, `--format JSON` (or `JSONEachRow`), and `--readonly=1` for read queries.
- Always constrain `WHERE` time partitions and `LIMIT` to avoid full-table scans.
- NEVER run `DROP TABLE`, `TRUNCATE`, or `ALTER TABLE ... DELETE` autonomously.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect table schemas as JSON
clickhouse-client --readonly=1 --format JSON --query "DESCRIBE TABLE default.events"

Reads column types and codecs in read-only mode and outputs JSON.

Run a bounded OLAP aggregation as NDJSON
clickhouse-client --readonly=1 --format JSONEachRow --query "SELECT event_type, count() AS n FROM default.events GROUP BY 1 ORDER BY 2 DESC LIMIT 10"

Enforces readonly=1 and emits compact newline-delimited JSON rows.

Strengths for Agents

  • + --readonly=1 gives true server-side protection against writes and DDL.
  • + --format JSON and --format JSONEachRow output clean machine-readable results.
  • + Also bundles clickhouse-local for zero-server analytics over local files.

Caveats & Pitfalls

  • ! Binary download is large because clickhouse bundles server, client, and local modes.
  • ! No native Windows binary (requires WSL or Docker).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI