save-key
Save API keys for different AI models to avoid entering them repeatedly.Usage
Options
AI model to save the key for.Allowed values:
claude- Anthropic Claudeopenai- OpenAI GPT modelsgemini- Google Geminigrok- xAI Grokllama- Meta Llamadeepseek- DeepSeek, Inc.github- GitHub Modelsollama- Ollama
free model doesn’t require an API keyShorthand: -mThe API key to save. If not provided, you’ll be prompted to enter it securely (hidden input).Shorthand:
-kExamples
Terminal Output
set-defaults
Configure default settings for commits, including model selection, confirmation preferences, and behavior options.Usage
Options
Set the default AI model for all commits.Allowed values:
claude, openai, gemini, grok, llama, deepseek, github, ollama, freeShorthand: -mSet the default model variant.Examples:
gpt-4o, claude-sonnet-4-20250514, gemini-2.0-flashShorthand: -vBase URL for Ollama server (Ollama only).Shorthand:
-uAlways confirm commit messages before applying. Enables interactive review workflow.
Never confirm commit messages (auto-commit mode).Note: Cannot be used with
--confirm-commitsInclude emojis in commit messages.Set to
--no-allow-emojis to disable.Maximum diff size (in characters) before switching to file-by-file processing.
Maximum file size (in MB) before warning about large files.
Examples
Terminal Output
show-defaults
Display your current default settings.Usage
Terminal Output
clear-defaults
Remove all saved default settings.Usage
Terminal Output
show-config
Display your complete GitWhisper configuration file.Usage
Terminal Output
always-add
Configure whether GitWhisper should automatically stage changes when no staged files are found.Usage
Examples
Terminal Output
Behavior
When enabled (true):
- If no files are staged, GitWhisper automatically runs
git add . - Proceeds directly to commit generation
- No prompts or confirmations
false):
- If no files are staged, GitWhisper prompts you to stage them
- You can choose to stage or cancel
- More control over what gets committed
Configuration File Location
GitWhisper stores configuration in:- Linux/macOS:
~/.gitwhisper/config.yaml - Windows:
%USERPROFILE%\.gitwhisper\config.yaml
Best Practices
-
Save API Keys Once
Avoid passing
--keyflag on every command. -
Set Sensible Defaults
Configure your preferred model and enable confirmation for safety.
-
Use Environment Variables for CI/CD
Don’t commit API keys to repositories.
-
Enable
always-addfor Solo ProjectsStreamlines workflow when you trust your changes. -
Review Configuration Periodically
Ensure settings match your current workflow.