Skip to main content

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:

  1. Platform Authentication - Sign in to Lovelace platform
  2. AI Provider Configuration - Choose and configure AI providers
  3. Default Workspace - Select your primary workspace
  4. 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:

  1. Command opens browser to Lovelace authentication page
  2. Sign in with your Lovelace account credentials
  3. Grant CLI access permissions
  4. CLI receives and stores authentication tokens
  5. 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:

ProviderModelsSetup Required
AnthropicClaude 3.5 Sonnet, Claude 3 HaikuAPI Key
OpenAIGPT-4, GPT-3.5 TurboAPI Key
GoogleGemini Pro, Gemini FlashAPI Key
Local ModelsOllama, LocalAIServer 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:

  1. Visit Anthropic Console
  2. Create API key in your account settings
  3. 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:

  1. Visit OpenAI Platform
  2. Navigate to API Keys section
  3. 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 token
  • LOVELACE_AUTH_ENDPOINT - Custom auth endpoint
  • LOVELACE_CLIENT_ID - OAuth client ID

AI Providers

  • ANTHROPIC_API_KEY - Anthropic API key
  • OPENAI_API_KEY - OpenAI API key
  • GOOGLE_API_KEY - Google API key
  • OLLAMA_BASE_URL - Ollama server URL

Behavior

  • LOVELACE_WORKSPACE - Default workspace
  • LOVELACE_OUTPUT_FORMAT - Default output format
  • LOVELACE_NO_COLOR - Disable colored output

Next Steps: