Skip to content

CLI authentication

The CLI needs a loomta_sk_… key for every command except auth:login. There are three ways to provide one, listed from most convenient (humans) to most automation-friendly (CI / agents).

Best for interactive use. Opens a browser, you approve, and the CLI saves a key.

Terminal window
loomta auth:login

It prints a confirmation code (LMT-XXXX-XXXX), opens https://loomta.com/cli-auth, waits while you sign in and pick a workspace, then writes the minted key to ~/.loomta/credentials.json. Under the hood this is the device authorization flow.

Headless / SSH / containers — if no browser can open, pass --no-browser (or it falls back automatically) and the CLI prints a URL and code to enter on any other device:

Terminal window
loomta auth:login --no-browser

Best for CI and agents. Pass an existing key; the CLI validates it against the API before saving.

Terminal window
loomta auth:login --api-key loomta_sk_xxx

No saved file at all — set the key per shell. This wins over a saved file.

Terminal window
export LOOMTA_API_KEY=loomta_sk_xxx
# optional: point at a non-default host
export LOOMTA_API_URL=https://api.loomta.com

The CLI resolves credentials in this order:

  1. LOOMTA_API_KEY (and optional LOOMTA_API_URL) from the environment.
  2. ~/.loomta/credentials.json (written by auth:login).

LOOMTA_API_URL from the environment always overrides the host saved in the file.

Path ~/.loomta/credentials.json
Permissions 0600 (owner read/write); the ~/.loomta directory is 0700
Shape { "apiKey": "loomta_sk_…", "apiUrl": "https://api.loomta.com" }
Terminal window
loomta auth:status # validates the current key, shows the source (env|file)
loomta auth:logout # deletes ~/.loomta/credentials.json

auth:logout only removes the saved file; it does not revoke the key. To revoke, use the dashboard (Settings → API Keys).