Supported AI Providers
GitWhisper supports the following AI providers:- Claude (Anthropic)
- OpenAI (GPT models)
- Gemini (Google)
- Grok (xAI)
- Llama (Meta)
- DeepSeek
- GitHub (GitHub Copilot)
- Ollama (Local models)
- Free (LLM7.io - No API key required)
Environment Variables
The quickest way to provide API keys is through environment variables. GitWhisper checks for the following environment variables:Environment variables take precedence over saved configuration. This is useful for temporary key overrides or CI/CD environments.
Saving API Keys
For permanent configuration, save your API keys using thesave-key command:
Interactive Example
When you rungw save-key without arguments, GitWhisper will guide you through the process:
Command-Line Options
You can provide API keys directly when running commands:Configuration File
API keys are stored in~/.git_whisper.yaml. This file is automatically created when you save a key:
Security Best Practices
Never commit API keys to version control
Never commit API keys to version control
- Never add
~/.git_whisper.yamlto your git repositories - Use environment variables in CI/CD pipelines
- Consider using secret management tools for production environments
- Add
.git_whisper.yamlto your global.gitignoreif needed
File permissions
File permissions
GitWhisper automatically sets restrictive permissions on the configuration file:
- Unix/Linux/macOS:
chmod 600(owner read/write only) - Windows: Uses NTFS permissions (if available)
Rotating API keys
Rotating API keys
If you need to rotate your API keys:
- Generate a new key from your provider’s dashboard
- Update using
save-keycommand: - Revoke the old key from your provider’s dashboard
Using environment variables in CI/CD
Using environment variables in CI/CD
For CI/CD pipelines, use environment variables instead of saving keys:GitHub Actions:GitLab CI:
API key precedence
API key precedence
GitWhisper checks for API keys in this order:
- Environment variables (highest priority)
- Saved configuration (
~/.git_whisper.yaml) - Command defaults (for free tier models)
Special Cases
Ollama (Local Models)
Ollama typically runs locally and doesn’t require an API key:Free Tier (LLM7.io)
The free tier doesn’t require an API key:When using the free tier for the first time, you’ll need to accept a disclaimer about data privacy.
Viewing Saved Keys
To view your current configuration (keys are displayed):Troubleshooting
API key not being recognized
API key not being recognized
- Check if the key is correctly set:
- Verify environment variable names are correct (e.g.,
ANTHROPIC_API_KEYnotCLAUDE_API_KEY) - Ensure no trailing spaces in the key
- For environment variables, make sure they’re exported in the current shell
Permission denied errors
Permission denied errors
If you see permission errors:
Configuration file not found
Configuration file not found
The configuration file is created automatically when you save your first key. If it’s missing:
Next Steps
Set Defaults
Configure default model and variant preferences
Language Settings
Set your preferred language for commit messages