Skip to main content
Checks an API key with the API, finds the organization it gives access to, saves the key in the OS keychain and selects that organization.

Flags

string
The API key to use. If you leave it out, the CLI asks for it with a hidden prompt. The key is recorded in your shell history when passed this way, so prefer the prompt, or SABAOTH_API_KEY for automation.
string
The organization to sign in to, when the key gives access to more than one. Required in that case.
boolean
default:"false"
Print the result as JSON on stdout.

Examples

Output

With --json:
If you used --api-key, the JSON result also includes a warnings array with the shell history warning.

Behavior

  • The key is checked before anything is saved. A mistyped or revoked key never leaves a credential behind.
  • Keys are stored only in the OS keychain, under service com.sabaothcloud.sabaoth and account org:<organization-id>. There is no plain-text fallback.
  • Logging in selects the organization. Logging in to a second organization adds it alongside the first and makes it the selected one.
  • Logging in again to the same organization replaces its stored key.
  • No reading from pipes. Without a terminal and without --api-key, login exits with code 2 instead of reading a key from standard input.

Errors

See Error codes for network and server errors.