Skip to content

VizzleTF/CommitSage

Repository files navigation

Commit Sage (formerly GeminiCommit)

Visual Studio Marketplace Version Visual Studio Marketplace Last Updated Visual Studio Marketplace Installs Visual Studio Marketplace Rating Ask DeepWiki

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)

Commit Sage in action

Features

  • πŸ€– 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

Configuration

Get your API key:

AI Provider Settings

  • Provider Selection (commitSage.provider.type):

    • Choose between: gemini, openai, codestral, ollama
    • Default: gemini
  • 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
  • OpenAI Settings:

    • Model (commitSage.openai.model): Default gpt-3.5-turbo
    • Base URL (commitSage.openai.baseUrl): For custom endpoints/Azure
  • Codestral Settings:

    • Model (commitSage.codestral.model):
      • Options: codestral-2405, codestral-latest
      • Default: codestral-latest
  • Ollama Settings:

    • Base URL (commitSage.ollama.baseUrl): Default http://localhost:11434
    • Model (commitSage.ollama.model): Default llama3.2

Commit Settings

  • Language (commitSage.commit.commitLanguage):

    • Options: english, russian, chinese, japanese, spanish
    • Default: english
  • Format (commitSage.commit.commitFormat):

    • Options: conventional, angular, karma, semantic, emoji, emojiKarma, google, atom
    • Default: conventional
  • 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

Custom Instructions

  • Enable (commitSage.commit.useCustomInstructions):

    • Default: false
  • Instructions (commitSage.commit.customInstructions):

    • Custom prompt instructions
    • Used when enabled

Telemetry

  • Enable (commitSage.telemetry.enabled):
    • Collects anonymous usage data
    • Default: true

Project Configuration (.commitsage)

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.

Creating Project Configuration

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run "Commit Sage: Create Project Configuration (.commitsage)"
  3. Edit the generated file with your project-specific settings

Example .commitsage file:

{
  "provider": {
    "type": "gemini"
  },
  "commit": {
    "commitLanguage": "russian",
    "commitFormat": "conventional",
    "autoCommit": false,
    "autoPush": false
  },
  "gemini": {
    "model": "gemini-1.5-flash"
  },
  "telemetry": {
    "enabled": false
  }
}

Settings Priority

Settings are loaded in the following order (higher priority overrides lower):

  1. Project settings (.commitsage file) - Highest priority
  2. VS Code workspace settings - Medium priority
  3. VS Code global settings - Lowest priority

Notes

  • 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

Usage

  1. Stage your changes in Git
  2. Press Cmd+G (Mac) / Ctrl+G (Windows/Linux)
  3. Or click the Commit Sage icon in the Source Control view
  4. Wait for the AI to analyze changes and generate a message
  5. Review and edit the message if needed
  6. Commit as usual

Requirements

  • VSCode 1.93.0 or higher
  • Git installed and configured
  • Internet connection (except for Ollama)
  • API key for OpenAI/Codestral (if using those providers)

License

MIT

Support

If you encounter any issues or have suggestions, please open an issue.


Commit Sage (Π½Π° русском)

Commit Sage - Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ VSCode для автоматичСской Π³Π΅Π½Π΅Ρ€Π°Ρ†ΠΈΠΈ сообщСний ΠΊΠΎΠΌΠΌΠΈΡ‚ΠΎΠ² с использованиСм Gemini AI ΠΎΡ‚ Google, Codestral API ΠΈΠ»ΠΈ OpenAI API (OpenAI, Ollama, LocalAI ΠΈ Π΄Ρ€ΡƒΠ³ΠΈΠ΅).

Установка

  1. УстановитС ΠΈΠ· VS Code Marketplace
  2. ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚Π΅ API ΠΊΠ»ΡŽΡ‡:
    • Для Gemini: Google AI Studio
    • Для Codestral: Mistral AI Console
    • Для Π΄Ρ€ΡƒΠ³ΠΈΡ…: Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ ΠΊΠ»ΡŽΡ‡ ΠΎΡ‚ OpenAI ΠΈΠ»ΠΈ Π΄Ρ€ΡƒΠ³ΠΎΠ³ΠΎ совмСстимого сСрвиса
  3. НастройтС ΠΊΠ»ΡŽΡ‡ Π² 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 ΠΊΠ»ΡŽΡ‡

ИспользованиС

  1. Π”ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ измСнСния Π² Git (git add)
  2. ΠžΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ ΠΏΠ°Π»ΠΈΡ‚Ρ€Ρƒ ΠΊΠΎΠΌΠ°Π½Π΄ (Ctrl+Shift+P / Cmd+Shift+P)
  3. Π’Π²Π΅Π΄ΠΈΡ‚Π΅ "Commit Sage: Generate Commit Message"
  4. ΠŸΡ€ΠΎΠ²Π΅Ρ€ΡŒΡ‚Π΅ ΠΈ ΠΏΠΎΠ΄Ρ‚Π²Π΅Ρ€Π΄ΠΈΡ‚Π΅ сгСнСрированноС сообщСниС

Настройка

ВсС настройки доступны Ρ‡Π΅Ρ€Π΅Π·:

  • ΠŸΠ°Π»ΠΈΡ‚Ρ€Π° ΠΊΠΎΠΌΠ°Π½Π΄ β†’ "Preferences: Open Settings (UI)"
  • Поиск "Commit Sage"

ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° (.commitsage)

Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ настройки Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΡ для ΠΎΡ‚Π΄Π΅Π»ΡŒΠ½Ρ‹Ρ… ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ΠΎΠ², создав Ρ„Π°ΠΉΠ» .commitsage Π² ΠΊΠΎΡ€Π½Π΅ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°. Π­Ρ‚ΠΎ позволяСт Ρ€Π°Π·Π½Ρ‹ΠΌ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°ΠΌ ΠΈΠΌΠ΅Ρ‚ΡŒ Ρ€Π°Π·Π½Ρ‹Π΅ ΠΏΡ€ΠΎΠ²Π°ΠΉΠ΄Π΅Ρ€Ρ‹ ИИ, Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Ρ‹ ΠΊΠΎΠΌΠΌΠΈΡ‚ΠΎΠ² ΠΈΠ»ΠΈ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ настройки.

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°

  1. ΠžΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ ΠΏΠ°Π»ΠΈΡ‚Ρ€Ρƒ ΠΊΠΎΠΌΠ°Π½Π΄ (Ctrl+Shift+P / Cmd+Shift+P)
  2. Π’Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ "Commit Sage: Create Project Configuration (.commitsage)"
  3. ΠžΡ‚Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΡƒΠΉΡ‚Π΅ созданный Ρ„Π°ΠΉΠ» с настройками для вашСго ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°

ΠŸΡ€ΠΈΠΌΠ΅Ρ€ Ρ„Π°ΠΉΠ»Π° .commitsage:

{
  "provider": {
    "type": "gemini"
  },
  "commit": {
    "commitLanguage": "russian",
    "commitFormat": "conventional",
    "autoCommit": false,
    "autoPush": false
  },
  "gemini": {
    "model": "gemini-1.5-flash"
  },
  "telemetry": {
    "enabled": false
  }
}

ΠŸΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚ настроСк

Настройки Π·Π°Π³Ρ€ΡƒΠΆΠ°ΡŽΡ‚ΡΡ Π² ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΌ порядкС (Π±ΠΎΠ»Π΅Π΅ высокий ΠΏΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚ пСрСопрСдСляСт Π½ΠΈΠ·ΠΊΠΈΠΉ):

  1. Настройки ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° (Ρ„Π°ΠΉΠ» .commitsage) - ΠΠ°ΠΈΠ²Ρ‹ΡΡˆΠΈΠΉ ΠΏΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚
  2. Настройки Ρ€Π°Π±ΠΎΡ‡Π΅ΠΉ области VS Code - Π‘Ρ€Π΅Π΄Π½ΠΈΠΉ ΠΏΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚
  3. Π“Π»ΠΎΠ±Π°Π»ΡŒΠ½Ρ‹Π΅ настройки VS Code - Низший ΠΏΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ

  • Π€Π°ΠΉΠ» .commitsage автоматичСски отслСТиваСтся Π½Π° измСнСния
  • НСвСрный JSON синтаксис ΠΏΠΎΠΊΠ°ΠΆΠ΅Ρ‚ ΡƒΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠ΅ ΠΎΠ± ошибкС
  • API ΠΊΠ»ΡŽΡ‡ΠΈ ΠΏΠΎ-ΠΏΡ€Π΅ΠΆΠ½Π΅ΠΌΡƒ ΡƒΠΏΡ€Π°Π²Π»ΡΡŽΡ‚ΡΡ Ρ‡Π΅Ρ€Π΅Π· Π·Π°Ρ‰ΠΈΡ‰Π΅Π½Π½ΠΎΠ΅ Ρ…Ρ€Π°Π½ΠΈΠ»ΠΈΡ‰Π΅ VS Code (Π½Π΅ хранятся Π² Ρ„Π°ΠΉΠ»Π°Ρ… ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°)
  • Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ Π»ΡŽΠ±ΡƒΡŽ настройку, Π΄ΠΎΡΡ‚ΡƒΠΏΠ½ΡƒΡŽ Π² ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΡ

ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ°

About

Commit Sage is a VSCode extension that automatically generates commit messages

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •