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 [email protected]
   Plan: Pro
   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 [email protected]
   Plan: Pro
   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

Remove stored credentials and log out of the CLI.

$ lynxprompt logout

āœ… Logged out successfully
   Credentials removed from config

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/Application Support/lynxprompt/config.json
Linux~/.config/lynxprompt/config.json
Windows%APPDATA%\lynxprompt\config.json

Security

The config file is stored with user-only permissions. The token has a long expiry (1 year) 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.

Next: Commands

Learn all the available CLI commands and options.

Commands Reference