Authentication

Authenticate the CLI to access your blueprints, pull from the marketplace, and sync configurations with your LynxPrompt account.

Login

The login command opens your browser for secure OAuth authentication. You'll sign in with your existing LynxPrompt account (GitHub, Google, or Magic Link).

$ lynxprompt login

šŸ” Opening browser to authenticate...
   https://lynxprompt.com/auth/signin?cli_session=abc123

Waiting for authentication... āœ“

āœ… Logged in as user@example.com
   Token stored securely in config

You're ready to use LynxPrompt CLI!

How it works

  1. CLI generates a unique session ID
  2. Your browser opens to the LynxPrompt sign-in page
  3. You authenticate using your preferred method
  4. A CLI-specific API token is automatically created
  5. Token is securely stored in your config directory

Check Login Status

Use the whoami command to verify your authentication status and see account details.

$ lynxprompt whoami

šŸ‘¤ Logged in as user@example.com
   Member since: January 2025

If you're not logged in, the command will show:

$ lynxprompt whoami

āŒ Not logged in

Run 'lynxprompt login' to authenticate.

Logout

Revoke the token on the server and remove it from this machine. The CLI keeps one login per instance, so logout only touches the instance lynxp config points at and lists any others that are still logged in.

$ lynxprompt logout

āœ“ Logged out from user@example.com at https://lynxprompt.com
  Removed stored credentials

CI/CD Authentication

For CI/CD pipelines and automation, use the LYNXPROMPT_TOKEN environment variable instead of interactive login.

Security Note

Generate a dedicated API token from Settings → API Tokens for CI/CD use. Never expose your personal token in scripts or logs.

GitHub Actions

# .github/workflows/sync-config.yml
name: Sync AI Config

on:
  push:
    branches: [main]

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'
      
      - name: Install LynxPrompt CLI
        run: npm install -g lynxprompt
      
      - name: Pull blueprint
        env:
          LYNXPROMPT_TOKEN: ${{ secrets.LYNXPROMPT_TOKEN }}
        run: lynxprompt pull bp_your_blueprint_id --yes

Shell script

# Export the token (or set in .env)
export LYNXPROMPT_TOKEN=lp_your_token_here

# Commands will use the token automatically
lynxprompt list
lynxprompt pull bp_abc123 --yes

Token Storage

When you log in interactively, the CLI stores your API token in a config file:

PlatformConfig Location
macOS~/Library/Preferences/lynxprompt-nodejs/config.json
Linux~/.config/lynxprompt-nodejs/config.json
Windows%APPDATA%\lynxprompt-nodejs\Config\config.json

Security

The config file is plain JSON readable by your user only (mode 0600), so treat it like a password. Each token is only sent to the instance that issued it. lynxp config path prints where it is. A token from lynxp login expires after 90 days and can be revoked anytime from your Settings page.

Troubleshooting

Browser doesn't open

If the browser doesn't open automatically, copy the URL shown in the terminal and paste it in your browser manually.

Authentication times out

The CLI waits 5 minutes for authentication. If it times out, run lynxprompt login again.

Token expired

If you see "Token expired" errors, run lynxprompt login to generate a new token.

"This version of lynxp is too old to log in"

lynxp before 2.1.37 logs in without the check that ties the token to the terminal that asked for it. Those logins work until 2027-01-01 and are refused from then on. Update with npm install -g lynxprompt@latest (or your package manager) and log in again.

Next: Commands

Learn all the available CLI commands and options.

Commands Reference