> ## Documentation Index
> Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Manage resources, read and write records, benchmark streams, and run local development tools with the S2 CLI.

The `s2` CLI provides access to the full S2 API — managing basins, streams, access tokens, and reading/writing records — plus utilities like [benchmarking](/cli/bench), an interactive [TUI](/cli/tui) mode, and [s2-lite](/s2-lite).

```bash theme={null}
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
  list-locations       List locations
  get-default-location Get the default location
  set-default-location Set the default location
  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`.
