Authentication & Setup Guide
Complete guide to platform authentication and provider configuration
Overview
The Lovelace CLI provides secure authentication with the platform and flexible configuration for AI providers. This guide covers authentication flows, provider setup, and account management.
Interactive Setup
First-Time Setup
bash
# Run the interactive setup wizard
lovelace setup
The setup wizard guides you through:
- Platform Authentication - Sign in to Lovelace platform
- AI Provider Configuration - Choose and configure AI providers
- Default Workspace - Select your primary workspace
- Editor Integration - Optional editor setup
Setup Process
Step 1: Platform Authentication
- Opens browser for secure OAuth flow
- Grants CLI access to your account
- Stores authentication tokens securely
Step 2: Provider Configuration
- Choose primary AI provider (Anthropic, OpenAI, Google)
- Configure API keys for selected providers
- Set default models and parameters
Step 3: Workspace Selection
- Lists available workspaces
- Sets default workspace for commands
- Configures project synchronization
Manual Authentication
Sign In
bash
# Check current authentication status
lovelace auth status
# Sign in to platform
lovelace auth signin
Authentication Flow:
- Command opens browser to Lovelace authentication page
- Sign in with your Lovelace account credentials
- Grant CLI access permissions
- CLI receives and stores authentication tokens
- Returns to terminal with confirmation
Multiple Accounts
bash
# List authenticated accounts
lovelace auth list
# Switch between accounts
lovelace auth switch
# Switch to specific account
lovelace auth switch user@example.com
Sign Out
bash
# Sign out of current account
lovelace auth signout
# Alternative command
lovelace auth logout
AI Provider Configuration
Supported Providers
The CLI supports multiple AI providers:
| Provider | Models | Setup Required |
|---|---|---|
| Anthropic | Claude 3.5 Sonnet, Claude 3 Haiku | API Key |
| OpenAI | GPT-4, GPT-3.5 Turbo | API Key |
| Gemini Pro, Gemini Flash | API Key | |
| Local Models | Ollama, LocalAI | Server URL |
Provider Setup
Anthropic (Claude)
bash
# Configure Anthropic provider
lovelace config set ai.provider anthropic
lovelace config set ai.anthropic.api_key your-api-key
lovelace config set ai.model claude-3-5-sonnet
Getting API Key:
- Visit Anthropic Console
- Create API key in your account settings
- Copy key and configure in CLI
OpenAI (GPT)
bash
# Configure OpenAI provider
lovelace config set ai.provider openai
lovelace config set ai.openai.api_key your-api-key
lovelace config set ai.model gpt-4
Getting API Key:
- Visit OpenAI Platform
- Navigate to API Keys section
- Create new key and configure in CLI
Google (Gemini)
bash
# Configure Google provider
lovelace config set ai.provider google
lovelace config set ai.google.api_key your-api-key
lovelace config set ai.model gemini-pro
Local Models (Ollama)
bash
# Configure local Ollama
lovelace config set ai.provider ollama
lovelace config set ai.ollama.base_url http://localhost:11434
lovelace config set ai.model llama2
Provider Management
bash
# View current provider configuration
lovelace config show ai
# Test provider connection
lovelace chat --provider anthropic
lovelace chat --provider openai
# Switch providers temporarily
lovelace chat --provider google --model gemini-pro
Configuration Management
View Configuration
bash
# Show all configuration
lovelace config show
# Show specific section
lovelace config show auth
lovelace config show ai
lovelace config show workspace
Set Configuration
bash
# Set single values
lovelace config set workspace.default my-project
lovelace config set ai.provider anthropic
lovelace config set output.format json
# Set nested values
lovelace config set ai.anthropic.api_key your-key
lovelace config set ai.parameters.temperature 0.7
Reset Configuration
bash
# Reset all configuration
lovelace config reset
# Reset specific section
lovelace config reset ai
lovelace config reset auth
Advanced Authentication
Linear Integration
bash
# Connect Linear for issue management
lovelace auth connect-linear
This enables:
- Issue creation and updates from CLI
- Automatic issue linking in conversations
- Team workflow integration
API Token Authentication
For CI/CD and automated environments:
bash
# Set API token directly
export LOVELACE_AUTH_TOKEN=your-token
lovelace auth status
# Or configure in environment
echo "LOVELACE_AUTH_TOKEN=your-token" >> .env
Security Best Practices
Token Storage
- Tokens stored securely in system keychain
- Automatic token refresh handling
- Secure transmission over HTTPS
API Key Management
bash
# Use environment variables for sensitive keys
export ANTHROPIC_API_KEY=your-key
export OPENAI_API_KEY=your-key
# Or store in secure configuration
lovelace config set --secure ai.anthropic.api_key
Access Control
bash
# Check current permissions
lovelace auth permissions
# Revoke CLI access
lovelace auth revoke
# Audit authentication logs
lovelace auth audit
Troubleshooting
Authentication Issues
Token Expired
bash
# Refresh authentication
lovelace auth signin
# Check token status
lovelace auth status --verbose
Browser Issues
bash
# Use manual token flow
lovelace auth signin --manual
# Copy token directly
lovelace auth signin --token your-token
Permission Denied
bash
# Check account permissions
lovelace auth permissions
# Re-authenticate with full permissions
lovelace auth signin --force
Provider Issues
API Key Invalid
bash
# Test API key
lovelace config test ai.anthropic.api_key
# Reset and reconfigure
lovelace config reset ai
lovelace setup --providers-only
Network Connectivity
bash
# Test provider connectivity
lovelace doctor --check providers
# Use alternative endpoints
lovelace config set ai.anthropic.base_url https://api.anthropic.com
Configuration Issues
Corrupted Configuration
bash
# Backup current config
cp ~/.lovelace/config.json ~/.lovelace/config.backup
# Reset and reconfigure
lovelace reset
lovelace setup
Missing Configuration
bash
# Check for missing values
lovelace config validate
# Set required values
lovelace config set workspace.default my-workspace
Environment Variables
Authentication
LOVELACE_AUTH_TOKEN- Direct API tokenLOVELACE_AUTH_ENDPOINT- Custom auth endpointLOVELACE_CLIENT_ID- OAuth client ID
AI Providers
ANTHROPIC_API_KEY- Anthropic API keyOPENAI_API_KEY- OpenAI API keyGOOGLE_API_KEY- Google API keyOLLAMA_BASE_URL- Ollama server URL
Behavior
LOVELACE_WORKSPACE- Default workspaceLOVELACE_OUTPUT_FORMAT- Default output formatLOVELACE_NO_COLOR- Disable colored output
Next Steps:
- Workspace Management - Set up your first workspace
- AI Chat & Analysis - Start using AI assistance
- Troubleshooting - Common issues and solutions