Commit Sage is a VSCode extension that automatically generates commit messages using various AI providers:
- Gemini (default, requires API key, free)
- OpenAI (requires API key or compatible provider)
- Codestral (requires API key, free)
- Ollama (local, free)
- π€ AI-powered commit message generation
- π Multiple language support (English, Russian, Chinese, Japanese, Spanish)
- π Various commit formats (Conventional, Angular, Karma, Semantic, Emoji, EmojiKarma)
- π Smart handling of staged/unstaged changes
- π Auto-commit and auto-push capabilities
- π― Custom instructions support
- β‘ Fast and efficient processing
Get your API key:
- For Gemini: Get it from Google AI Studio
- For Codestral: Mistral AI Console
- For custom endpoint: Use your OpenAI API key or other compatible service
-
Provider Selection (
commitSage.provider.type
):- Choose between:
gemini
,openai
,codestral
,ollama
- Default:
gemini
- Choose between:
-
Gemini Settings:
- Model (
commitSage.gemini.model
):- Options:
gemini-1.0-pro
,gemini-1.5-pro
,gemini-1.5-flash
,gemini-2.0-flash-exp
- Default:
gemini-1.5-flash
- Options:
- Model (
-
OpenAI Settings:
- Model (
commitSage.openai.model
): Defaultgpt-3.5-turbo
- Base URL (
commitSage.openai.baseUrl
): For custom endpoints/Azure
- Model (
-
Codestral Settings:
- Model (
commitSage.codestral.model
):- Options:
codestral-2405
,codestral-latest
- Default:
codestral-latest
- Options:
- Model (
-
Ollama Settings:
- Base URL (
commitSage.ollama.baseUrl
): Defaulthttp://localhost:11434
- Model (
commitSage.ollama.model
): Defaultllama3.2
- Base URL (
-
Language (
commitSage.commit.commitLanguage
):- Options:
english
,russian
,chinese
,japanese
,spanish
- Default:
english
- Options:
-
Format (
commitSage.commit.commitFormat
):- Options:
conventional
,angular
,karma
,semantic
,emoji
,emojiKarma
,google
,atom
- Default:
conventional
- Options:
-
Staged Changes (
commitSage.commit.onlyStagedChanges
):- When enabled: Only analyzes staged changes
- When disabled:
- Uses staged changes if present
- Uses all changes if no staged changes
- Default:
false
-
Auto Commit (
commitSage.commit.autoCommit
):- Automatically commits after message generation
- Default:
false
-
Auto Push (
commitSage.commit.autoPush
):- Automatically pushes after auto-commit
- Requires Auto Commit to be enabled
- Default:
false
-
References (
commitSage.commit.promptForRefs
):- Prompts for issue/PR references
- Default:
false
-
Enable (
commitSage.commit.useCustomInstructions
):- Default:
false
- Default:
-
Instructions (
commitSage.commit.customInstructions
):- Custom prompt instructions
- Used when enabled
- Enable (
commitSage.telemetry.enabled
):- Collects anonymous usage data
- Default:
true
You can override extension settings for individual projects by creating a .commitsage
file in your project root. This allows different projects to have different AI providers, commit formats, or other settings.
- Open Command Palette (
Ctrl+Shift+P
/Cmd+Shift+P
) - Run "Commit Sage: Create Project Configuration (.commitsage)"
- Edit the generated file with your project-specific settings
{
"provider": {
"type": "gemini"
},
"commit": {
"commitLanguage": "russian",
"commitFormat": "conventional",
"autoCommit": false,
"autoPush": false
},
"gemini": {
"model": "gemini-1.5-flash"
},
"telemetry": {
"enabled": false
}
}
Settings are loaded in the following order (higher priority overrides lower):
- Project settings (
.commitsage
file) - Highest priority - VS Code workspace settings - Medium priority
- VS Code global settings - Lowest priority
- The
.commitsage
file is automatically watched for changes - Invalid JSON syntax will show an error notification
- API keys are still managed through VS Code's secure storage (not stored in project files)
- You can override any setting available in the extension configuration
- Stage your changes in Git
- Press
Cmd+G
(Mac) /Ctrl+G
(Windows/Linux) - Or click the Commit Sage icon in the Source Control view
- Wait for the AI to analyze changes and generate a message
- Review and edit the message if needed
- Commit as usual
- VSCode 1.93.0 or higher
- Git installed and configured
- Internet connection (except for Ollama)
- API key for OpenAI/Codestral (if using those providers)
MIT
If you encounter any issues or have suggestions, please open an issue.
Commit Sage - ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΠ΅ VSCode Π΄Π»Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠΉ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ ΠΊΠΎΠΌΠΌΠΈΡΠΎΠ² Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ Gemini AI ΠΎΡ Google, Codestral API ΠΈΠ»ΠΈ OpenAI API (OpenAI, Ollama, LocalAI ΠΈ Π΄ΡΡΠ³ΠΈΠ΅).
- Π£ΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ ΠΈΠ· VS Code Marketplace
- ΠΠΎΠ»ΡΡΠΈΡΠ΅ API ΠΊΠ»ΡΡ:
- ΠΠ»Ρ Gemini: Google AI Studio
- ΠΠ»Ρ Codestral: Mistral AI Console
- ΠΠ»Ρ Π΄ΡΡΠ³ΠΈΡ : ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΠΊΠ»ΡΡ ΠΎΡ OpenAI ΠΈΠ»ΠΈ Π΄ΡΡΠ³ΠΎΠ³ΠΎ ΡΠΎΠ²ΠΌΠ΅ΡΡΠΈΠΌΠΎΠ³ΠΎ ΡΠ΅ΡΠ²ΠΈΡΠ°
- ΠΠ°ΡΡΡΠΎΠΉΡΠ΅ ΠΊΠ»ΡΡ Π² VS Code:
- ΠΡΠΊΡΠΎΠΉΡΠ΅ ΠΏΠ°Π»ΠΈΡΡΡ ΠΊΠΎΠΌΠ°Π½Π΄ (Ctrl+Shift+P / Cmd+Shift+P)
- ΠΠ²Π΅Π΄ΠΈΡΠ΅ "Commit Sage: Set Gemini API Key", "Commit Sage: Set Codestral API Key" ΠΈΠ»ΠΈ "Commit Sage: Set Custom API Key"
- ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°Ρ API ΠΊΠ»ΡΡ
- ΠΠΎΠ±Π°Π²ΡΡΠ΅ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π² Git (git add)
- ΠΡΠΊΡΠΎΠΉΡΠ΅ ΠΏΠ°Π»ΠΈΡΡΡ ΠΊΠΎΠΌΠ°Π½Π΄ (Ctrl+Shift+P / Cmd+Shift+P)
- ΠΠ²Π΅Π΄ΠΈΡΠ΅ "Commit Sage: Generate Commit Message"
- ΠΡΠΎΠ²Π΅ΡΡΡΠ΅ ΠΈ ΠΏΠΎΠ΄ΡΠ²Π΅ΡΠ΄ΠΈΡΠ΅ ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅
ΠΡΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ Π΄ΠΎΡΡΡΠΏΠ½Ρ ΡΠ΅ΡΠ΅Π·:
- ΠΠ°Π»ΠΈΡΡΠ° ΠΊΠΎΠΌΠ°Π½Π΄ β "Preferences: Open Settings (UI)"
- ΠΠΎΠΈΡΠΊ "Commit Sage"
ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»ΠΈΡΡ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΡ Π΄Π»Ρ ΠΎΡΠ΄Π΅Π»ΡΠ½ΡΡ
ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ², ΡΠΎΠ·Π΄Π°Π² ΡΠ°ΠΉΠ» .commitsage
Π² ΠΊΠΎΡΠ½Π΅ ΠΏΡΠΎΠ΅ΠΊΡΠ°. ΠΡΠΎ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΡΠ°Π·Π½ΡΠΌ ΠΏΡΠΎΠ΅ΠΊΡΠ°ΠΌ ΠΈΠΌΠ΅ΡΡ ΡΠ°Π·Π½ΡΠ΅ ΠΏΡΠΎΠ²Π°ΠΉΠ΄Π΅ΡΡ ΠΠ, ΡΠΎΡΠΌΠ°ΡΡ ΠΊΠΎΠΌΠΌΠΈΡΠΎΠ² ΠΈΠ»ΠΈ Π΄ΡΡΠ³ΠΈΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ.
- ΠΡΠΊΡΠΎΠΉΡΠ΅ ΠΏΠ°Π»ΠΈΡΡΡ ΠΊΠΎΠΌΠ°Π½Π΄ (
Ctrl+Shift+P
/Cmd+Shift+P
) - ΠΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ "Commit Sage: Create Project Configuration (.commitsage)"
- ΠΡΡΠ΅Π΄Π°ΠΊΡΠΈΡΡΠΉΡΠ΅ ΡΠΎΠ·Π΄Π°Π½Π½ΡΠΉ ΡΠ°ΠΉΠ» Ρ Π½Π°ΡΡΡΠΎΠΉΠΊΠ°ΠΌΠΈ Π΄Π»Ρ Π²Π°ΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
{
"provider": {
"type": "gemini"
},
"commit": {
"commitLanguage": "russian",
"commitFormat": "conventional",
"autoCommit": false,
"autoPush": false
},
"gemini": {
"model": "gemini-1.5-flash"
},
"telemetry": {
"enabled": false
}
}
ΠΠ°ΡΡΡΠΎΠΉΠΊΠΈ Π·Π°Π³ΡΡΠΆΠ°ΡΡΡΡ Π² ΡΠ»Π΅Π΄ΡΡΡΠ΅ΠΌ ΠΏΠΎΡΡΠ΄ΠΊΠ΅ (Π±ΠΎΠ»Π΅Π΅ Π²ΡΡΠΎΠΊΠΈΠΉ ΠΏΡΠΈΠΎΡΠΈΡΠ΅Ρ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ΅Ρ Π½ΠΈΠ·ΠΊΠΈΠΉ):
- ΠΠ°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ° (ΡΠ°ΠΉΠ»
.commitsage
) - ΠΠ°ΠΈΠ²ΡΡΡΠΈΠΉ ΠΏΡΠΈΠΎΡΠΈΡΠ΅Ρ - ΠΠ°ΡΡΡΠΎΠΉΠΊΠΈ ΡΠ°Π±ΠΎΡΠ΅ΠΉ ΠΎΠ±Π»Π°ΡΡΠΈ VS Code - Π‘ΡΠ΅Π΄Π½ΠΈΠΉ ΠΏΡΠΈΠΎΡΠΈΡΠ΅Ρ
- ΠΠ»ΠΎΠ±Π°Π»ΡΠ½ΡΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ VS Code - ΠΠΈΠ·ΡΠΈΠΉ ΠΏΡΠΈΠΎΡΠΈΡΠ΅Ρ
- Π€Π°ΠΉΠ»
.commitsage
Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΎΡΡΠ»Π΅ΠΆΠΈΠ²Π°Π΅ΡΡΡ Π½Π° ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ - ΠΠ΅Π²Π΅ΡΠ½ΡΠΉ JSON ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΠΏΠΎΠΊΠ°ΠΆΠ΅Ρ ΡΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠ΅ ΠΎΠ± ΠΎΡΠΈΠ±ΠΊΠ΅
- API ΠΊΠ»ΡΡΠΈ ΠΏΠΎ-ΠΏΡΠ΅ΠΆΠ½Π΅ΠΌΡ ΡΠΏΡΠ°Π²Π»ΡΡΡΡΡ ΡΠ΅ΡΠ΅Π· Π·Π°ΡΠΈΡΠ΅Π½Π½ΠΎΠ΅ Ρ ΡΠ°Π½ΠΈΠ»ΠΈΡΠ΅ VS Code (Π½Π΅ Ρ ΡΠ°Π½ΡΡΡΡ Π² ΡΠ°ΠΉΠ»Π°Ρ ΠΏΡΠΎΠ΅ΠΊΡΠ°)
- ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»ΠΈΡΡ Π»ΡΠ±ΡΡ Π½Π°ΡΡΡΠΎΠΉΠΊΡ, Π΄ΠΎΡΡΡΠΏΠ½ΡΡ Π² ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΡ
- Telegram ΠΠ°Π½Π°Π» - ΠΠ½ΠΎΠ½ΡΡ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠΉ
- Telegram ΠΡΡΠΏΠΏΠ° - ΠΠ±ΡΡΠΆΠ΄Π΅Π½ΠΈΡ ΠΈ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΡΠΎΠΎΠ±ΡΠ΅ΡΡΠ²Π°