Create an API key
- In the dashboard, open API Keys in the sidebar.
- Click Create API Key, name it (for example
laptop CLI) and choose its scopes. - Copy the key. It starts with
mpg_and is shown only once.
Log in interactively
- Checks the key with the API before saving anything. A mistyped or revoked key never leaves a credential behind.
- Finds the organization the key gives access to.
- Saves the key in the OS keychain and selects that organization for later commands.
If the key covers more than one organization
If the key gives access to several organizations, the CLI won’t guess which one you mean. Pass--org:
--org, login fails with AMBIGUOUS_ORGANIZATION and lists the organization IDs you can choose from.
Signing in to several organizations
Runsabaoth login once for each organization. Each one gets its own keychain entry, and the most recent login becomes the selected organization. Switch between them with sabaoth org use.
Passing the key as a flag
SABAOTH_API_KEY in automation.
When there is no terminal (for example, input is piped) and you haven’t passed
--api-key, sabaoth login exits with code 2 and the error NO_TTY_FOR_PROMPT. It never reads a key from a pipe.Use an environment variable
For CI pipelines, scripts and containers, setSABAOTH_API_KEY and skip login entirely:
SABAOTH_API_KEY is set:
- It takes priority over everything saved locally. Your saved login and organization selection are ignored completely, so a CI job can’t be affected by whatever happens to be selected on a developer’s machine.
- The organization comes from the server. The CLI asks the API which organization the key belongs to. If the key covers more than one, pass
--orgon each command. --orgcan’t widen access. If you pass an--orgthe key doesn’t cover, the command fails withORGANIZATION_MISMATCH. It never quietly switches to a different organization.- No keychain is needed. This makes it the right choice for headless Linux machines and containers.
Check who you are signed in as
local context for your saved login, or SABAOTH_API_KEY), the selected organization, and every organization you have signed in to. It makes no network call and never prints a key. See sabaoth config.
Log out
sabaoth logout.
How the CLI treats your key
- Keys are stored only in the OS keychain (service
com.sabaothcloud.sabaoth). There is no plain-text fallback. - If the keychain is locked or unavailable,
loginfails withCREDENTIAL_STORE_UNAVAILABLEand saves nothing. - No command prints a key, in human or JSON output.
- Every request sends the key to
https://api.sabaothcloud.comas a bearer token, and to nowhere else.