Skip to main content
The S2 CLI stores configuration in a TOML file and supports environment variable overrides.

Configuration file location

Linux/macOS:
Windows:

Managing configuration

Set a value

Example:

Get a value

Example:

List all values

Output:

Unset a value

Example:

Configuration keys

access_token

Required. Your S2 access token for authentication.
Without an access token, most CLI commands will fail. You can obtain an access token from the S2 console or by using the issue-access-token command with a parent token.

account_endpoint

Custom account API endpoint URL. Must be set together with basin_endpoint.
Both account_endpoint and basin_endpoint must be set to use custom endpoints. If only one is set, the CLI will fall back to default endpoints.

basin_endpoint

Custom basin API endpoint URL. Must be set together with account_endpoint.

compression

Request/response compression algorithm. Options: gzip, zstd.
Default: No compression (none) Benefits:
  • Reduces network bandwidth
  • Faster for large payloads
  • zstd typically offers better compression ratios

ssl_no_verify

Disable SSL certificate verification. Options: true, false.
Default: false
Only use ssl_no_verify=true in development/testing environments. Disabling certificate verification in production is a security risk.

Environment variables

All configuration keys can be overridden using environment variables with the S2_ prefix:
Environment variables take precedence over configuration file values.

Example: Using environment variables for CI/CD

Example configuration file

Authentication

The CLI uses the access token specified in access_token for all API requests. Tokens are included in the Authorization header:

Token management

Access tokens can have:
  • Expiration dates
  • Scoped permissions (basins, streams, operations)
  • Automatic stream prefixing
See Access tokens for details.

Obtaining your first token

  1. Sign up at s2.dev
  2. Create an access token in the console
  3. Configure the CLI:

Creating scoped tokens from the CLI

Once you have a parent token configured, you can issue child tokens with restricted permissions:
This creates a token that can only append and read from streams with the deployments/ prefix in the prod basin.

Configuration priority

Configuration values are resolved in this order (highest to lowest priority):
  1. Environment variables (S2_*)
  2. Configuration file (~/.config/s2/config.toml)
  3. Default values

Troubleshooting

Permission denied when writing config

Ensure the config directory exists and is writable:

Invalid access token error

Verify your token is set correctly:
Ensure there are no extra spaces or quotes in the token value.

Certificate verification failed

If you’re using custom endpoints with self-signed certificates (development only):
Never disable SSL verification in production.