Use CQL shell (cqlsh)

CQL shell (cqlsh) is a Python-based command-line interface for interacting with Cassandra-based databases. Use it to execute CQL commands to manage schemas, query and modify data, and perform administrative tasks. You can work interactively at a prompt or run commands from a file or directly from the command line. cqlsh connects to a running database instance using the the Apache Cassandra Python driver and the native protocol.

CQL shell commands

In addition to executing CQL statements, cqlsh provides a set of built-in shell commands. These commands control the cqlsh session, format output, inspect cluster metadata, and perform utility tasks such as importing or exporting data. Shell commands are interpreted by cqlsh and are not sent to the database as CQL.

Because these commands are implemented by the cqlsh client rather than the database itself, they are not available when connecting through Apache Cassandra drivers or other tools such as DataStax Studio, that only support CQL commands.

Prerequisites

cqlsh requires Python 2.7 or a supported Python 3 version (3.6–3.11). Newer versions of Python 3 (3.12 and later) are not supported.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM