Configuration
Learn how to configure GitGuru to match your workflow and preferences.
API Key Setup
GitGuru requires a Google Gemini API key to enable AI features. You can get one for free from Google AI Studio.
Getting Your API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated key
- 15 requests per minute
- 1 million tokens per minute
- 1,500 requests per day
Adding Your API Key
Use the gg addkey command to configure your API key:
gg addkey YOUR_GEMINI_API_KEYThis command will:
- Validate your API key
- Fetch available models for your account
- Let you choose your preferred model
- Store the configuration securely
Using Environment Variable
Alternatively, you can set the API key via environment variable:
# Linux/macOS
export GEMINI_API_KEY="your-api-key"
# Windows (PowerShell)
$env:GEMINI_API_KEY="your-api-key"
# Windows (Command Prompt)
set GEMINI_API_KEY=your-api-keyConfiguration Options
Use gg config to manage GitGuru settings:
# Interactive configuration
gg config
# List all settings
gg config --list
# Get a specific value
gg config --get ai.model
# Set a specific value
gg config --set ai.commit.enabled=trueAvailable Settings
| Key | Type | Description |
|---|---|---|
ai.model | string | AI model to use (e.g., gemini-1.5-pro) |
ai.commit.enabled | boolean | Enable AI commit messages by default |
ai.diff.enabled | boolean | Enable AI diff summaries by default |
ai.status.enabled | boolean | Enable AI status analysis by default |
ai.log.enabled | boolean | Enable AI log analysis by default |
Model Selection
GitGuru supports multiple Gemini models, each with different capabilities:
| Model | Best For | Speed |
|---|---|---|
gemini-3-flash-preview | Latest generation preview, extremely fast and capable | ⚡ Ultra Fast |
gemini-2.5-pro | Best for complex reasoning, coding, and deep analysis | 🐢 Slower |
gemini-2.5-flash | Best balance of speed and quality (recommended default) | ⚡ Very Fast |
gemini-2.5-flash-lite | Lightweight and cheapest option for simple tasks | 🚀 Fastest |
# Set your preferred model
gg config --set ai.model=gemini-1.5-pro
# Or use the interactive config
gg configgemini-1.5-flash provides the best balance between speed and quality. Use gemini-1.5-pro for complex code analysis tasks.Configuration File
GitGuru stores configuration in ~/.gitguru/config.json:
{
"apiKey": "YOUR_API_KEY",
"model": "gemini-1.5-pro",
"aiCommitEnabled": true,
"aiDiffEnabled": true,
"aiStatusEnabled": false,
"aiLogEnabled": false
}~/.gitguru/ is not included in any version control or backup systems that might expose it.Per-Command Overrides
You can override AI settings for individual commands using flags:
# Force AI even if disabled by default
gg commit --ai
gg diff --ai
gg status --ai
gg log --ai
# Disable AI even if enabled by default
gg commit --no-ai
gg diff --no-ai
gg status --no-ai
gg log --no-aiRecommended Setup
Here's a recommended configuration for most users:
# Enable AI for commits (most useful)
gg config --set ai.commit.enabled=true
# Use fast model for everyday tasks
gg config --set ai.model=gemini-1.5-flash
# Keep other AI features manual (use --ai when needed)
gg config --set ai.diff.enabled=false
gg config --set ai.status.enabled=false
gg config --set ai.log.enabled=falseThis setup gives you AI commit messages automatically while keeping other features available on-demand.
Troubleshooting
API Key Issues
If you're having problems with your API key:
# Verify your key is set
gg config --get apiKey
# Re-add your key
gg addkey YOUR_NEW_KEY
# Check if environment variable is set
echo $GEMINI_API_KEY # Linux/macOS
echo %GEMINI_API_KEY% # WindowsResetting Configuration
To reset GitGuru to default settings, delete the config file:
# Linux/macOS
rm ~/.gitguru/config.json
# Windows
del %USERPROFILE%\.gitguru\config.jsonNext Steps
- AI Features - Learn about all AI capabilities
- Best Practices - Tips for effective usage
- gg config Reference - Complete command documentation