Skip to main content

Authentication

Connect to Lexicon Hub to search, download, and publish knowledge packages.

tip

Browsing and downloading public packages does not require authentication. You only need to log in to publish packages or access private content.

Login

chaoscypher lexicon login

This starts the Device Authorization flow (recommended) — a browser window opens for secure authentication.

Authentication Methods

The default and most secure method. Uses OAuth 2.0 Device Authorization Grant (RFC 8628).

chaoscypher lexicon login
Lexicon Login

╭──────────── Browser Authentication ────────────╮
│ │
│ To authenticate, visit: │
│ │
│ https://lexicon.example.com/device?code=ABCD │
│ │
│ Code expires in 15 minutes. │
╰─────────────────────────────────────────────────╯

Open browser automatically? [Y/n]: y
Browser opened. Complete authentication there.

⠋ Waiting for browser authentication...

✓ Logged in as denis
Lexicon: https://lexicon.example.com
Credentials saved to: ~/.config/chaoscypher/credentials.json

If you can't open a browser (e.g., SSH session), use --no-browser and copy the URL manually:

chaoscypher lexicon login --no-browser

Token Authentication (CI/CD)

For automated pipelines, provide an API token directly:

chaoscypher lexicon login --token ghp_xxxxx

Check Status

Verify your current authentication state:

chaoscypher lexicon whoami
Logged in as: denis
Lexicon: https://lexicon.example.com

Logout

chaoscypher lexicon logout

Credential Storage

Credentials are stored locally at:

PlatformPath
Linux~/.config/chaoscypher/credentials.json
macOS~/Library/Application Support/chaoscypher/credentials.json
Windows%APPDATA%\chaoscypher\credentials.json

The file contains the access token and Hub URL. It is created on login and removed on logout.

Hub URL Configuration

By default, the CLI connects to http://localhost:3001. To use a different Hub instance:

Per-command:

chaoscypher lexicon login --url https://lexicon.example.com

Environment variable:

export LEXICON_URL=https://lexicon.example.com

Settings file (settings.yaml):

lexicon:
url: https://lexicon.example.com
api_path: /api/v1
timeout: 60