Skip to content

docs(cli): move the lite login credential to the OS keychain - #960

Merged
mateo-berri merged 3 commits into
mainfrom
litellm_cli_keychain_credential
Aug 20, 2026
Merged

docs(cli): move the lite login credential to the OS keychain#960
mateo-berri merged 3 commits into
mainfrom
litellm_cli_keychain_credential

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

TLDR

lite login now puts the credential in the OS keychain instead of writing it into ~/.litellm/token.json, so the pages that told readers their credential sits in a plaintext file were wrong. See BerriAI/litellm#37566

What changed in the code

The credential goes into the OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) under the service litellm-cli and the account credential. ~/.litellm/token.json keeps only non-secret metadata: base URL, user id, email, role, auth header name, and the sign-in timestamp, in a 0600 file inside a 0700 directory. With no keychain reachable, which covers a headless Linux box, an install without the optional keyring package (it ships with the cli extra), and LITELLM_CLI_DISABLE_KEYRING set to 1/true/yes/on, the credential falls back into that same owner-only file, and lite login prints which store it used. lite logout clears both and warns when the keychain will not release the entry. A plaintext credential left by an older lite still authenticates, then moves itself into the keychain

Pages changed

docs/proxy/identity_provisioning.md: Step 4 said lite login stores the token at ~/.litellm/token.json, and the paragraph after it said LiteLLM has no OS keychain integration at all. Both now describe keychain storage, the metadata-only token file, the keyring requirement, and the fallback. The support matrix rows for on-device storage and keychain storage were flipped to match

docs/proxy/management_cli.md: the lite login credential section only said the token was "stored". It now says where each half lives, what the fallback cases are, what LITELLM_CLI_DISABLE_KEYRING does, and what lite logout clears. The quick start offered litellm[proxy] as another way to get the lite command without saying that extra leaves out keyring, so that line now names the consequence, and the credential section says the SDK getter litellm.get_litellm_gateway_api_key() needs keyring for the same reason

docs/proxy/cli_sso.md: the login step now points at where the credential lands and links to the section above, and its install step carries the same litellm[proxy] correction

docs/proxy/config_settings.md: added LITELLM_CLI_DISABLE_KEYRING to the environment variable table

Checks

npm run build passes. The broken-anchor warnings it prints are all pre-existing links from release notes into docs/proxy/logging and friends; none of them touch these pages


Note

Low Risk
Documentation-only updates to CLI credential storage. No runtime, auth, or proxy behavior changes in this PR.

Overview
Aligns CLI docs with keychain storage for lite login: the session key lives in the OS keychain (service litellm-cli), and ~/.litellm/token.json keeps non-secret metadata. Fallback remains the owner-only file when there is no keychain, keyring is missing (litellm[proxy] does not include it), or LITELLM_CLI_DISABLE_KEYRING is set.

PKCE still puts the refresh token in token.json (treat that file as sensitive). lite logout clears both stores and warns if the keychain entry cannot be removed. Older plaintext tokens migrate into the keychain on next read.

Also documents LITELLM_CLI_DISABLE_KEYRING in the env-var table and flips the identity-provisioning support matrix from “no keychain” to “yes”.

Reviewed by Cursor Bugbot for commit 8a02047. Bugbot is set up for automated code reviews on this repo. Configure here.

`lite login` now stores the credential in the OS keychain and keeps only
non-secret metadata in ~/.litellm/token.json, falling back to that
owner-only file when no keychain is available. Update the CLI, SSO, and
identity provisioning pages, and document LITELLM_CLI_DISABLE_KEYRING.

See BerriAI/litellm#37566
@mateo-berri

Copy link
Copy Markdown
Collaborator Author

bugbot run

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview Aug 20, 2026 6:24pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 718a28a. Configure here.

The quick start offered litellm[proxy] as an equivalent way to get the
lite command, so a reader who took that path never reached a keychain
and nothing told them why.

Also names the SDK getter, which needs keyring for the same reason and
returns None without it even when lite login stored a credential.
@mateo-berri

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit da1a807. Configure here.

# Conflicts:
#	docs/proxy/management_cli.md
@mateo-berri

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8a02047. Configure here.

@mateo-berri
mateo-berri merged commit 1eb5555 into main Aug 20, 2026
3 checks passed
@mateo-berri
mateo-berri deleted the litellm_cli_keychain_credential branch August 20, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant