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

Installation

From source (cargo)

Requires Rust 1.70+.

# Install from the repository
cargo install --git https://github.com/scylladb/cqlsh-rs.git

# Or clone and install locally
git clone https://github.com/scylladb/cqlsh-rs.git
cd cqlsh-rs
cargo install --path .

The binary is installed to ~/.cargo/bin/cqlsh-rs.

Pre-built binaries

Download pre-built binaries from GitHub Releases:

Archive names include the version, e.g. cqlsh-rs-0.5.13-x86_64-unknown-linux-musl.tar.gz:

PlatformArchitectureArchive
Linuxx86_64cqlsh-rs-<version>-x86_64-unknown-linux-musl.tar.gz
Linuxaarch64cqlsh-rs-<version>-aarch64-unknown-linux-musl.tar.gz
macOSx86_64cqlsh-rs-<version>-x86_64-apple-darwin.tar.gz
macOSApple Siliconcqlsh-rs-<version>-aarch64-apple-darwin.tar.gz
Windowsx86_64cqlsh-rs-<version>-x86_64-pc-windows-msvc.zip

The Linux archives are statically linked against musl, so they run on any distribution regardless of its glibc version.

# Example: Linux x86_64
VERSION=0.5.13
curl -LO "https://github.com/scylladb/cqlsh-rs/releases/download/v${VERSION}/cqlsh-rs-${VERSION}-x86_64-unknown-linux-musl.tar.gz"
tar xzf "cqlsh-rs-${VERSION}-x86_64-unknown-linux-musl.tar.gz"
sudo install "cqlsh-rs-${VERSION}-x86_64-unknown-linux-musl/cqlsh-rs" /usr/local/bin/

Each release also ships a SHA256SUMS.txt for verification:

curl -LO "https://github.com/scylladb/cqlsh-rs/releases/download/v${VERSION}/SHA256SUMS.txt"
sha256sum --check --ignore-missing SHA256SUMS.txt

Homebrew (macOS/Linux)

The cqlsh-rs repository doubles as its own Homebrew tap — there is no separate homebrew-cqlsh-rs repository, so the tap URL must be passed explicitly:

brew tap scylladb/cqlsh-rs https://github.com/scylladb/cqlsh-rs
brew trust scylladb/cqlsh-rs
brew install cqlsh-rs

# later
brew update && brew upgrade cqlsh-rs

The brew trust step is required by newer Homebrew versions, which refuse to install formulae from third-party taps that haven’t been explicitly trusted.

The formula (Formula/cqlsh-rs.rb in the repository) downloads the pre-built release binary for your platform and also installs the cqlsh-rs(1) man page and bash/zsh/fish completions.

To remove it:

brew uninstall cqlsh-rs
brew untap scylladb/cqlsh-rs

Docker

# Run interactively
docker run --rm -it ghcr.io/scylladb/cqlsh-rs:latest

# Connect to a specific host
docker run --rm -it ghcr.io/scylladb/cqlsh-rs:latest 10.0.0.1

# Execute a statement
docker run --rm ghcr.io/scylladb/cqlsh-rs:latest -e "SELECT * FROM system.local" 10.0.0.1

Building from source

git clone https://github.com/scylladb/cqlsh-rs.git
cd cqlsh-rs
cargo build --release

The binary is at target/release/cqlsh-rs.

Shell completions

Generate shell completion scripts for your shell:

# Bash
cqlsh-rs --completions bash > /etc/bash_completion.d/cqlsh-rs

# Zsh
cqlsh-rs --completions zsh > ~/.zfunc/_cqlsh-rs

# Fish
cqlsh-rs --completions fish > ~/.config/fish/completions/cqlsh-rs.fish

# PowerShell
cqlsh-rs --completions powershell > cqlsh-rs.ps1

# Elvish
cqlsh-rs --completions elvish > cqlsh-rs.elv

Verifying the installation

cqlsh-rs --version