Installation
The S2 CLI is distributed as a standalone binary:Quick start
Configure your access token:Command structure
The CLI follows a hierarchical command structure:Common patterns
S2 URIs - Most stream operations use the formats2://{basin}/{stream}:
Command categories
Basin management
list-basins- List all basinscreate-basin- Create a new basindelete-basin- Delete a basinget-basin-config- View basin configurationreconfigure-basin- Update basin settings
Stream management
list-streams- List streams in a basincreate-stream- Create a new streamdelete-stream- Delete a streamget-stream-config- View stream configurationreconfigure-stream- Update stream settingscheck-tail- Check the tail position of a stream
Record operations
append- Append records to a streamread- Read records from a streamtail- Show the last N records (like Unix tail)trim- Set a trim point to delete old recordsfence- Set a fencing token for write coordination
Access control
list-access-tokens- List access tokensissue-access-token- Create a new access tokenrevoke-access-token- Revoke an access token
Monitoring
get-account-metrics- Retrieve account-level metricsget-basin-metrics- Retrieve basin-level metricsget-stream-metrics- Retrieve stream-level metrics
Utilities
ls- List basins or streams (convenience command)apply- Apply declarative spec filesbench- Run performance benchmarkslite- Run local S2 Lite server
Interactive mode
Launch the interactive TUI (Terminal User Interface):Global options
Environment variables
All configuration values can be set via environment variables with theS2_ prefix:
Exit codes
0- Success1- General error2- 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