CLI Reference

The streamctl command-line tool.

10 min readReference

Installation

The streamctl CLI is included in the StreamHouse release. You can also install it separately.

bash
# Install from source
cargo install --path crates/streamhouse-cli

# Or download from releases
curl -L https://github.com/streamhouse/streamhouse/releases/latest/download/streamctl -o /usr/local/bin/streamctl
chmod +x /usr/local/bin/streamctl

# Configure the server address
export STREAMHOUSE_URL=http://localhost:8080

Topic Commands

Manage topics with the topic subcommand.

bash
streamctl topic list                          # List all topics
streamctl topic create --name NAME [options]   # Create a topic
streamctl topic describe --name NAME           # Show topic details
streamctl topic delete --name NAME             # Delete a topic
streamctl topic update --name NAME [options]   # Update topic config

# Options for create/update:
#   --partitions N          Number of partitions
#   --retention DURATION    Retention period (e.g., 7d, 24h)
#   --retention-bytes SIZE  Max topic size (e.g., 100GB)
#   --compression ALGO      Compression (lz4, zstd, none)

Produce Commands

Send messages to topics.

bash
# Produce a single message
streamctl produce --topic NAME --message 'JSON'

# Produce with a key
streamctl produce --topic NAME --key KEY --message 'JSON'

# Produce from a file (one message per line)
streamctl produce --topic NAME --file messages.jsonl

# Interactive produce mode
streamctl produce --topic NAME --interactive

Consume Commands

Read messages from topics.

bash
# Consume from the beginning
streamctl consume --topic NAME --from-beginning

# Consume from a specific offset
streamctl consume --topic NAME --partition 0 --offset 100

# Consume with a consumer group
streamctl consume --topic NAME --group GROUP --auto-commit

# Consume and output as JSON
streamctl consume --topic NAME --format json

SQL Commands

Run SQL queries on streaming data.

bash
# Run a one-off query
streamctl sql "SELECT * FROM events LIMIT 10"

# Start interactive SQL shell
streamctl sql --interactive

# Run query from a file
streamctl sql --file query.sql