Setting Defaults
Use theset-defaults command to configure your preferred model and behavior:
Configuration Options
Default Model
Set which AI model to use by default:claude- Anthropic Claudeopenai- OpenAI GPT modelsgemini- Google Geminigrok- xAI Grokllama- Meta Llamadeepseek- DeepSeekgithub- GitHub Copilotollama- Local modelsfree- Free tier (LLM7.io)
Model Variant
Specify a particular version of the model:If you don’t specify a variant, GitWhisper will use the default variant for that model. Each model provider has its own recommended default.
Ollama Base URL
For Ollama users, configure a custom base URL:Commit Confirmation
Control whether to confirm commit messages before applying:Emoji Support
Enable or disable emojis in commit messages:Maximum Diff Size
Set the maximum diff size (in characters) before GitWhisper prompts for interactive staging:When your changes exceed this threshold, GitWhisper will suggest using interactive staging (
git add -p) to commit changes in smaller, more focused chunks.Maximum File Size
Set the maximum file size (in MB) before warning about large files:Interactive Configuration
Runningset-defaults without arguments provides an interactive experience:
Configuration File Structure
Defaults are stored in~/.git_whisper.yaml:
Viewing Current Defaults
Check your current default settings:Clearing Defaults
Remove your default model configuration:Advanced Configuration
Always add changes before committing
Always add changes before committing
Configure GitWhisper to automatically stage unstaged changes:When enabled:
- If there are no staged changes, GitWhisper will automatically run
git add . - Useful for faster workflows when you typically commit all changes
- GitWhisper will abort if there are no staged changes
- Gives you more control over what gets committed
Combining multiple settings
Combining multiple settings
Set multiple preferences in a single command:This creates a complete configuration in one step.
Overriding defaults per command
Overriding defaults per command
Even with defaults set, you can override them for individual commands:Command-line arguments always take precedence over saved defaults.
Per-project configuration
Per-project configuration
While GitWhisper uses a global configuration file (
~/.git_whisper.yaml), you can use different settings per project:-
Use environment variables in project-specific scripts:
-
Create shell aliases:
-
Use direnv for automatic environment setup:
Free disclaimer acceptance
Free disclaimer acceptance
When using the free tier for the first time, GitWhisper stores your acceptance:This prevents the disclaimer from appearing on every use of the free tier.
Best Practices
For Teams
Recommend consistent settings across the team:
- Same model and variant for consistent commit styles
- Enable emojis or disable them for all team members
- Document your team’s configuration in your project README
For Solo Developers
Optimize for your workflow:
- Disable
confirm-commitsonce you trust the generations - Enable
always-addto skip the staging step - Use faster models (gpt-3.5-turbo) for simple commits
For Open Source
Balance speed and quality:
- Keep
confirm-commitsenabled to review messages - Use emojis for better commit readability
- Set reasonable
max-diff-sizeto avoid huge commits
For CI/CD
Use environment variables:
- Don’t rely on saved configuration in automated environments
- Set explicit models and variants in pipeline configs
- Disable confirmation prompts
Troubleshooting
Default model not being used
Default model not being used
- Check your configuration:
- Ensure the
defaultssection exists in your config - Verify you have an API key saved for the default model
- Command-line arguments override defaults - check if you’re passing
--model
Variant not recognized
Variant not recognized
Some variants are model-specific. Verify the variant exists:If you specify an invalid variant, GitWhisper will use the model’s default variant and show a warning.
Configuration not persisting
Configuration not persisting
- Check file permissions:
- Verify the file is writable
- On Windows, ensure the file isn’t marked as read-only
- Check for disk space issues
Next Steps
API Keys
Learn how to manage API keys for different providers
Language Settings
Configure language preferences for commit messages