truss auth command group manages how the Truss CLI authenticates with a Baseten remote. Use it to log in with an API key or through browser-based OAuth, view the active credential for a remote, and log out.
Authentication methods
Choose how Truss authenticates with Baseten.- Workload identity federation: configure a trust rule and supply a workload identity token through the environment. Truss exchanges it for a short-lived access token and refreshes the access token before it expires.
- API key: paste an API key.
- Browser (OAuth): complete an OAuth 2.0 device flow by approving the request in your browser. The CLI attempts to open your browser automatically and prints the verification URL and code as a fallback. Best for laptops where you don’t want a stored secret on disk.
Where credentials are stored
Truss stores API keys in plaintext in~/.trussrc to support SSH proxy commands. OAuth tokens are stored in your operating system’s keyring under the service name baseten-truss whenever a usable backend is available (macOS Keychain, GNOME Keyring, and Windows Credential Manager).
If no keyring backend is available (for example, a headless Linux container), Truss falls back to writing the OAuth token inline to ~/.trussrc and prints a one-line warning. To force the inline path silently, set BASETEN_TRUSS_AUTH_KEYRING_DISABLED=1.
On macOS, the first read or write triggers a one-time Keychain prompt. Choose Always Allow to make subsequent calls silent.
[remote] api_key = ... entries in ~/.trussrc continue to work without changes; there’s no auto-migration.
Remotes
A remote is a named entry in~/.trussrc that points at a Baseten workspace and stores its credential. The default remote is baseten. You can configure additional remotes (for staging environments, multiple workspaces, and so on) and select one with --remote on most CLI commands.
truss auth status and truss auth logout both accept --remote NAME. When only one remote is configured, the flag is optional.
login
Log in to a Baseten remote.--browser or --api-key explicitly.
truss login is an alias and accepts the same flags.
Options
Authenticate with a Baseten API key. Mutually exclusive with
--browser.Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.Examples
Log in interactively and choose a method when prompted:logout
Log out of a Baseten remote and remove it from~/.trussrc. For OAuth remotes, this also revokes the refresh token on the backend.
Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.Examples
Log out of the only configured remote:status
Show the active authentication for a remote: the URL it points at, which method it uses, and where the credential is stored.Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.Examples
Inspect a remote:source shows where Truss reads it:
keyring: the credential is stored in the OS keyring.trussrc-inline: the credential is stored as plaintext inside~/.trussrc.
auth_type is workload_identity. Truss shows the trust rule ID and token source without displaying the token.
Environment variables
For workload identity federation, set the trust rule ID and exactly one token source. LeaveBASETEN_API_KEY and BASETEN_TRUSS_AUTH_API_KEY unset. Workload identity takes precedence over stored credentials. To run without a configured remote, also set BASETEN_TRUSS_AUTH_REMOTE_URL=https://app.baseten.co.
ID of the trust rule the workload uses to exchange its identity token for a Baseten access token.
Path to the file containing your platform’s identity token. Truss rereads the file on each exchange so your platform can rotate the token during long-running jobs.
Your platform’s identity token, supplied directly. Use a token file when the process can outlive the token.
API key used as a fallback when the active remote has no credentials in
~/.trussrc. Recommended for CI/CD, where setting the env var avoids running truss login before each job.