lazypr

Configuration

Configuration examples for different use cases

Configuration File

LazyPR stores configuration in ~/.lazypr. You can edit this file directly or use the lazypr config commands.

Minimal Configuration

The simplest setup to get started. Perfect for personal projects and first-time users.

~/.lazypr
# LazyPR Minimal Configuration
# The only required setting is your API key

GROQ_API_KEY=your-groq-api-key-here

# Provider defaults to groq if not specified
# PROVIDER=groq

Get a free API key at console.groq.com

Setting Up Minimal Config

# Set your API key
lazypr config set GROQ_API_KEY=gsk_xxxxxxxxxxxxx

# Verify configuration
lazypr config list

Team Configuration

Standardized configuration for team environments. Ensures consistent PR descriptions across all team members.

~/.lazypr
# LazyPR Team Configuration
# Recommended settings for team consistency

# API Keys
GROQ_API_KEY=your-groq-api-key-here
CEREBRAS_API_KEY=your-cerebras-api-key-here

# Provider Settings
PROVIDER=groq
MODEL=llama-3.3-70b-versatile

# Team Standards
DEFAULT_BRANCH=main
LOCALE=en
FILTER_COMMITS=true

# Context for consistent style
CONTEXT=Please review this PR carefully and provide feedback

# Reliability Settings
MAX_RETRIES=3
TIMEOUT=30000

Team Setup Instructions

Each team member configures their own machine:

# Set required values
lazypr config set GROQ_API_KEY=gsk_xxxxxxxxxxxxx
lazypr config set PROVIDER=groq
lazypr config set MODEL=llama-3.3-70b-versatile
lazypr config set DEFAULT_BRANCH=main
lazypr config set LOCALE=en
lazypr config set FILTER_COMMITS=true
lazypr config set MAX_RETRIES=3
lazypr config set TIMEOUT=30000

Distribute a config file to the team:

# Create config file
cat > ~/.lazypr << 'EOF'
GROQ_API_KEY=YOUR_KEY_HERE
PROVIDER=groq
MODEL=llama-3.3-70b-versatile
DEFAULT_BRANCH=main
LOCALE=en
FILTER_COMMITS=true
MAX_RETRIES=3
TIMEOUT=30000
EOF

# Team members replace the API key
lazypr config set GROQ_API_KEY=their-actual-key

Never commit API keys to version control. Each team member should have their own key.

Multi-Provider Configuration

Configuration supporting multiple AI providers with easy switching. Ideal for production environments and cost optimization.

~/.lazypr
# LazyPR Multi-Provider Configuration
# Supports multiple providers for flexibility and fallback

# Provider API Keys
GROQ_API_KEY=your-groq-api-key-here
CEREBRAS_API_KEY=your-cerebras-api-key-here

# Active Provider (groq or cerebras)
PROVIDER=groq

# Model Selection
MODEL=llama-3.3-70b-versatile

# Common Settings
DEFAULT_BRANCH=main
FILTER_COMMITS=true

# Increased reliability for production
MAX_RETRIES=5
TIMEOUT=45000

Switching Providers

# Switch to Cerebras
lazypr config set PROVIDER=cerebras

# Or use flag for one-time override
lazypr main --provider cerebras

# Check current provider
lazypr config get PROVIDER

Manual Fallback Strategy

# Try Groq first, fallback to Cerebras
lazypr main --provider groq || lazypr main --provider cerebras

Configuration Reference

All Available Settings

SettingDescriptionDefault
GROQ_API_KEYGroq API key-
CEREBRAS_API_KEYCerebras API key-
PROVIDERAI provider (groq or cerebras)groq
MODELModel to useProvider default
DEFAULT_BRANCHTarget branch for comparisonmain
LOCALEOutput languageen
FILTER_COMMITSFilter merge/dependency commitstrue
CONTEXTCustom context for AI-
MAX_RETRIESRetry attempts on failure3
TIMEOUTRequest timeout in ms30000

Config Commands

# Set a value
lazypr config set SETTING=value

# Get a value
lazypr config get SETTING

# List all settings
lazypr config list

# Remove a setting
lazypr config set SETTING=

Environment Variables

You can also configure LazyPR using environment variables. These override config file settings.

# In your shell profile (~/.bashrc, ~/.zshrc)
export GROQ_API_KEY=gsk_xxxxxxxxxxxxx
export LAZYPR_PROVIDER=groq
export LAZYPR_MODEL=llama-3.3-70b-versatile

Environment variables take precedence over config file settings.

Security Best Practices

  1. Never commit API keys - Use environment variables or local config files
  2. Use separate keys - Each team member should have their own API key
  3. Rotate keys regularly - Update keys periodically for security
  4. Limit key permissions - Use keys with minimal required permissions

Validation

Verify your configuration is correct:

# Check all settings
lazypr config list

# Test with a dry run
lazypr main -u  # Shows token usage to verify API connection

On this page