Skip to content

lexicon auth

Authenticate with an AI provider using browser-based OAuth (PKCE flow).

Terminal window
lexicon auth login [provider] [--port <port>]

Arguments:

  • providerclaude or openai. If omitted, prompts interactively.
  • --port — custom OAuth callback port (defaults to 54321 for Claude, 1455 for OpenAI).

Flow:

  1. Opens your browser to the provider’s authorization page
  2. Starts a local callback server (waits up to 180 seconds)
  3. Exchanges the authorization code for access and refresh tokens
  4. Stores credentials in .lexicon/auth/<provider>.json with 0600 permissions
→ Anthropic / Claude — OAuth authorization
Opening authorization page in your browser...
(waiting up to 180s for the callback)
Exchanging authorization code...
✓ Logged in to Anthropic / Claude.

Show authentication status for all providers.

Terminal window
lexicon auth status
Authentication Status
────────────────────────────────────────────
Anthropic / Claude authenticated (expires in 2h)
OpenAI not authenticated

Refresh an expired OAuth token.

Terminal window
lexicon auth refresh [provider]

Requires a stored refresh token. If the token cannot be refreshed, you will need to run lexicon auth login again.

Remove stored credentials for a provider.

Terminal window
lexicon auth logout [provider]

Credentials are stored as JSON files in .lexicon/auth/:

.lexicon/auth/claude.json
.lexicon/auth/openai.json

On Unix systems, files are set to mode 0600 (owner read/write only). The .lexicon/ directory should be in your .gitignore.

ProviderClientScopes
claudeAnthropic OAuthuser:inference user:profile
openaiOpenAI OAuthopenid profile email offline_access
  • lexicon chat — AI-guided architecture design session (requires auth)