Appearance
Authentication
lindris authenticates to the Lindris API with an API key. Generate one in the Lindris dashboard under Account → API, then sign in once:
bash
lindris auth loginlindris prompts for the key and stores it in your OS keyring — Keychain on macOS, secret-service on Linux, Credential Manager on Windows. The key is never written to disk in plaintext.
Where your key comes from
lindris resolves the active API key from two sources, in order:
- OS keyring (recommended) — populated by
lindris auth login. This is the default on a developer machine. LINDRIS_API_KEYenvironment variable (fallback) — used automatically when the keyring is empty for the active account, or when the keyring can't be reached (a lockedgnome-keyringsession, a CI container, Docker). Noauth loginneeded — just set the variable.
Check which source resolved the active key at any time:
bash
lindris auth statuslindris doctor reports the same as part of a broader health check — run it first whenever a call unexpectedly returns 401.
Multiple accounts: profiles
Working across more than one Lindris account? Give each its own profile — a named keyring entry — and switch between them. The active profile is persisted to your config file, so every later command uses its key.
Adding a profile resolves which account the key belongs to before storing it, so no key is stored for an account the CLI has not named. If the API can't be reached, nothing is stored and the command exits non-zero — retry when it is reachable.
bash
# store the key for a new profile (reads $LINDRIS_API_KEY)
LINDRIS_API_KEY=<your-key> lindris auth profile add work --with-token
# switch the active profile — later commands use its key
lindris auth profile use workauth profile add prompts for the key exactly as auth login does — masked on a terminal — so you can run it bare and paste. It also accepts the key piped on stdin, or from $LINDRIS_API_KEY with --with-token, so profile setup can be scripted. The rest of the family:
bash
lindris auth profile list # list configured profiles
lindris auth profile show # metadata for a profile (key redacted)
lindris auth profile remove # delete a profile's keyring entryA key never overwrites another account's
Both auth login and auth profile add verify a key before storing it, and a stored key is the only copy you have. What happens depends on what the label already holds:
- Nothing stored — the key is stored and the label is bound to the account it opens.
- Same account, same backend — the key replaces the stored one. This is how you rotate a key.
- The key already stored — reported as unchanged. No key is written, but the recorded account is refreshed, which is the non-destructive way to re-resolve a label after repointing
api_base_url. - Different account — or the same account on a different backend — the command is refused (exit
2) and the existing key is left untouched. Useauth profile add <name>to keep both accounts side by side. - A stored key with no recorded account — refused (exit
2). Only you know whose key is stored, so the CLI will not replace it. Useauth profile add <name>to keep both, paste that same key to bind it (if it opens the backend you are on), or sign out first, which deletes it. Configs written before this rule are in this state whenever the account lookup had failed. - The keyring cannot be read — locked, or its unlock prompt declined. The CLI cannot tell what the profile holds, so it refuses (exit
4) and stores nothing; unlock the keyring and retry. On a machine with no keyring at all, skipauth loginand useLINDRIS_API_KEY(see CI and headless environments). - Key rejected, or API unreachable — nothing is stored, and the exit code says which happened (
4for a rejected key,6for a server or network failure,7when rate limited).
To give an existing label to a different account, unbind it first — that way the credential you are discarding is named explicitly. auth logout does this for the active profile, auth profile remove for any named one; both drop the key and the account it was bound to together:
bash
# the active profile
lindris auth logout
lindris auth login # now bind it to the other account
# a named profile
lindris auth profile remove work
lindris auth profile add workA binding that outlived its key refuses the login that would replace it, which is why unbinding is one action rather than two.
CI and headless environments
Where no keyring is available — CI runners, Docker images, headless servers — skip auth login entirely and set LINDRIS_API_KEY:
bash
export LINDRIS_API_KEY="<your-key>"
lindris people listlindris falls back to the variable automatically. Quote the key — a Lindris API key can contain a |, which an unquoted value lets the shell read as a pipe and corrupt the key.
Signing out
bash
lindris auth logoutRemoves the active profile's stored API key from the keyring, along with the account it was bound to. The key may be the only copy you have; to sign in to another account without discarding it, add a profile instead (lindris auth profile add <name>).
If you signed out with v1.0.1 or earlier, that logout left the account binding behind, so a login with a different account on that profile is refused. Run lindris auth logout once more on this version to clear it — the key is already gone, so nothing else is deleted.
Where to next
- Full command details:
lindris authand its subcommands. - Diagnose a failing key with
lindris doctor. - Wiring the CLI into an AI agent? See Using the CLI with AI agents — the MCP server shares this key-resolution model.