Skip to main content
The s2 CLI is the official command-line interface for S2. It provides access to the full S2 API — managing basins, streams, access tokens, and reading/writing records — plus utilities like benchmarking, an interactive TUI mode, and s2-lite for local development.
s2 --help
Commands:
  config               Manage CLI configuration
  ls                   List basins or streams in a basin
  list-basins          List basins
  create-basin         Create a basin
  delete-basin         Delete a basin
  get-basin-config     Get basin config
  reconfigure-basin    Reconfigure a basin
  list-access-tokens   List access tokens
  issue-access-token   Issue an access token
  revoke-access-token  Revoke an access token
  get-account-metrics  Get account metrics
  get-basin-metrics    Get basin metrics
  get-stream-metrics   Get stream metrics
  list-streams         List streams
  create-stream        Create a stream
  delete-stream        Delete a stream
  get-stream-config    Get stream config
  reconfigure-stream   Reconfigure a stream
  check-tail           Check the tail position of a stream
  trim                 Set a trim point for a stream
  fence                Set a fencing token for a stream
  append               Append records to a stream
  read                 Read records from a stream
  tail                 Tail a stream, showing the last N records
  bench                Benchmark a stream
  apply                Apply a declarative spec file
  lite                 Run S2 Lite server

S2 URIs

Most commands that operate on a stream take an S2 URI of the form:
s2://{basin}/{stream}
For example: s2://my-basin/my-stream. The ls command also accepts a URI with just a basin and optional prefix for listing streams: s2://my-basin/prefix.