Skip to main content
The S2 CLI is a command-line tool for interacting with the S2 stream store. It provides comprehensive management of basins, streams, access tokens, and records, along with benchmarking and monitoring capabilities.

Installation

The S2 CLI is distributed as a standalone binary:

Quick start

Configure your access token:
List available basins:
Create a basin and stream:

Command structure

The CLI follows a hierarchical command structure:

Common patterns

S2 URIs - Most stream operations use the format s2://{basin}/{stream}:
Listing with filters - Support prefix filtering and pagination:
Output formats - Record operations support multiple formats:

Command categories

Basin management

  • list-basins - List all basins
  • create-basin - Create a new basin
  • delete-basin - Delete a basin
  • get-basin-config - View basin configuration
  • reconfigure-basin - Update basin settings

Stream management

  • list-streams - List streams in a basin
  • create-stream - Create a new stream
  • delete-stream - Delete a stream
  • get-stream-config - View stream configuration
  • reconfigure-stream - Update stream settings
  • check-tail - Check the tail position of a stream

Record operations

  • append - Append records to a stream
  • read - Read records from a stream
  • tail - Show the last N records (like Unix tail)
  • trim - Set a trim point to delete old records
  • fence - Set a fencing token for write coordination

Access control

  • list-access-tokens - List access tokens
  • issue-access-token - Create a new access token
  • revoke-access-token - Revoke an access token

Monitoring

  • get-account-metrics - Retrieve account-level metrics
  • get-basin-metrics - Retrieve basin-level metrics
  • get-stream-metrics - Retrieve stream-level metrics

Utilities

  • ls - List basins or streams (convenience command)
  • apply - Apply declarative spec files
  • bench - Run performance benchmarks
  • lite - Run local S2 Lite server

Interactive mode

Launch the interactive TUI (Terminal User Interface):
The TUI provides a visual interface for browsing basins and streams.

Global options

Environment variables

All configuration values can be set via environment variables with the S2_ prefix:
Environment variables override configuration file values.

Exit codes

  • 0 - Success
  • 1 - General error
  • 2 - Invalid arguments or usage

Next steps

Configuration

Configure authentication and endpoints

Basin management

Create and manage basins

Stream management

Create and manage streams

Record operations

Append and read records