Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

Complete reference for all cqlsh-rs command-line flags and arguments.

Synopsis

cqlsh-rs [OPTIONS] [host] [port]

Positional arguments

ArgumentDescriptionDefault
hostContact point hostname or IP address127.0.0.1
portNative transport port9042

Options

Connection

FlagShortDescriptionDefault
--sslEnable SSL/TLS connectionoff
--connect-timeout SECONDSConnection timeout in seconds5
--request-timeout SECONDSPer-request timeout in seconds10
--protocol-version VERSIONNative protocol version (1-6)auto-negotiate
--secure-connect-bundle BUNDLE-bSecure connect bundle for Astra DB

Authentication

FlagShortDescription
--username USERNAME-uAuthentication username
--password PASSWORD-pAuthentication password

Execution

FlagShortDescription
--execute STATEMENT-eExecute a CQL statement and exit
--file FILE-fExecute CQL statements from a file
--keyspace KEYSPACE-kSet the initial keyspace

Note: --execute and --file are mutually exclusive.

Display

FlagShortDescriptionDefault
--color-CForce colored outputauto-detect
--no-colorDisable colored output
--encoding ENCODINGCharacter encodingutf-8
--tty-tForce TTY modeauto-detect

Note: --color and --no-color are mutually exclusive.

Configuration

FlagDescriptionDefault
--cqlshrc FILEPath to cqlshrc configuration file~/.cassandra/cqlshrc
--cqlversion VERSIONCQL version to useauto-detect
--consistency-level LEVELInitial consistency levelONE
--serial-consistency-level LEVELInitial serial consistency levelSERIAL

Behavior

FlagDescription
--no-file-ioDisable file I/O commands (COPY, SOURCE, CAPTURE)
--no_compactDisable compact storage interpretation
--disable-historyDisable saving of command history
--debugShow additional debug information
--browser BROWSERBrowser for CQL HELP (unused in modern cqlsh)

Utility

FlagDescription
--completions SHELLGenerate shell completion script (bash, zsh, fish, elvish, powershell)
--versionShow version and exit
--helpShow help and exit

Environment variables

VariableDescriptionEquivalent flag
CQLSH_HOSTDefault contact point hostnamehost positional
CQLSH_PORTDefault native transport portport positional
SSL_CERTFILESSL certificate file path--ssl + cqlshrc [ssl] certfile
SSL_VALIDATEEnable/disable certificate validationcqlshrc [ssl] validate
CQLSH_DEFAULT_CONNECT_TIMEOUT_SECONDSDefault connect timeout--connect-timeout
CQLSH_DEFAULT_REQUEST_TIMEOUT_SECONDSDefault request timeout--request-timeout
CQL_HISTORYOverride history file path

Precedence

Configuration values are resolved in this order (highest priority first):

  1. CLI flags
  2. Environment variables
  3. cqlshrc file
  4. Built-in defaults