cqlsh
$ cqlsh Foundation High Riskcqlsh is the official Python CQL command-line shell for Apache Cassandra and compatible databases such as ScyllaDB. It supports -e / --execute one-shot queries, --no-color, and SELECT JSON in CQL, though driver version constraints and interactive ergonomics make it heavier for agents.
pip install cqlsh cqlsh speaks native CQL directly over port 9042 and handles bulk COPY TO/COPY FROM CSV transfers without MCP translation overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -e / --execute and --no-color, but lacks a CLI --json flag (requires CQL SELECT JSON) and relies on text table output otherwise.
- Supports
-eand--no-color; structured JSON requires CQLSELECT JSON
Supports .cqlshrc credential isolation and TLS config, but has no --dry-run or --read-only CLI flag.
- No
--read-onlyor--dry-runflag; destructive CQL runs immediately
Installable via pip install cqlsh or bundled with Cassandra, though Python runtime and cassandra-driver compatibility frequently break across Python versions.
- PyPI package
cqlshis sensitive to Python version and driver deps
Standard tool for quick CQL inspection and COPY TO/FROM CSV tasks, though startup is noticeably slow.
- Supports CQL queries,
DESCRIBE, andCOPYCSV export/import
Maintained by the Apache Software Foundation (apache/cassandra) under Apache-2.0.
- Official Apache Cassandra project component
Documented in Apache Cassandra official docs and --help, though standalone PyPI cqlsh packaging lags behind server releases.
- Official reference at cassandra.apache.org
Security, Auth & Guardrails
Reads host, port, username, password, and TLS settings from ~/.cassandra/cqlshrc or --cqlshrc; supports CQLSH_HOST and CQLSH_PORT.
100% free and Apache-2.0 open-source.
# cqlsh Agent Rules - Always pass `-e "<cql>"` and `--no-color` so `cqlsh` exits after execution without ANSI noise. - Use CQL `SELECT JSON ...` when structured output is needed. - Never execute `TRUNCATE`, `DROP KEYSPACE`, or `DROP TABLE` without explicit approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
cqlsh 127.0.0.1 9042 --no-color -e "SELECT JSON * FROM system_schema.keyspaces;"
Executes a read-only SELECT JSON CQL statement non-interactively with ANSI colors disabled.
Strengths for Agents
- + Supports
-eone-shot queries,--no-color, and CQLSELECT JSONfor structured rows. - + Works consistently across Apache Cassandra, ScyllaDB, and Astra/managed CQL endpoints.
Caveats & Pitfalls
- ! Standalone PyPI
cqlshoften hits Python version and C-extension compatibility issues. - ! Lacks a native CLI
--jsonflag and has noticeable Python startup latency.