Skip to main content

Authentication

The CLI authenticates with an S2 access token. Generate one from the dashboard, then store it securely:
Paste the token when prompted. It won’t appear on screen or in your shell history, and the CLI saves it to your system credential manager.

Scripts and CI

For a non-persistent override, set S2_ACCESS_TOKEN. It takes precedence over any saved access token:
To persist a token supplied by a secret manager or script, pass it through standard input explicitly:

Headless systems

The CLI does not silently fall back to plaintext when an OS credential store is unavailable. To explicitly use a private local file on a headless system, add --insecure-storage:

Migrate an existing token

Access tokens previously saved as access_token in config.toml remain readable but are deprecated. Move one into the OS credential store with:
On a headless system without a credential store, migrate it into the private local file instead:

Remove a stored token

This removes the local credential but does not revoke the access token on S2. Use s2 revoke-access-token when the token must stop working everywhere.

Managing Config

s2 config list reports a configured access token as <redacted>, and s2 config get access_token does not reveal the credential. Use the s2 auth access-token commands to manage access tokens.

Default Location

When create-basin is called without --location, the basin uses the account’s default location.

Environment Variables

The CLI also reads endpoint overrides and command-specific settings from environment variables, which is useful when pointing at s2-lite or working with encrypted streams: