Start cqlsh

The CQL shell (cqlsh) is a Python-based command line interface for running CQL commands interactively with support for tab completion.

cqlsh requires Python 2.7 or Python 3.6 through 3.11.

Use cqlshrc for authentication

You can use a cqlshrc file to set default credentials when launching cqlsh. For more information about the cqlshrc file, see Configuring a cqlshrc file.

  1. Create a file named cqlshrc or modify an existing one.

  2. Specify the literal string token for username and your Astra DB application token for password.

    [authentication]
    username = token
    password = AstraCS:...
  3. Save the file in home/.cassandra directory or your cqlsh installation directory.

  4. Set permissions on the file to prevent unauthorized access if the password is stored in plain text. If you are using cqlsh in a production environment, use secure references for passwords. The file must be readable by the user that starts cassandra.

    chmod 440 'home/.cassandra/cqlshrc'
  5. Check the permissions on home/.cassandra/cqlshrc_history to ensure that plain text passwords are not compromised.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | 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: +1 (650) 389-6000, info@datastax.com