Skip to content

Mohammed-3tef/CommiTect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommiTect – Smart Commit Name Suggestion

Automatically analyzes your code changes and suggests a clear, professional commit name (Bug Fix, Feature, Refactor, Docs, Tests) using an external backend API.

Version Visual Studio

Screenshots

Notification.png Real-time notification

Features

Manual Commit Message Generation

  • Use keyboard shortcut (Shift+C) or Tools menu to analyze all repository changes
  • Menu item includes Git commit icon for easy identification
  • Analyzes git diffs from staged, unstaged, and untracked files
  • Predicts commit type: Bug Fix, Feature, Refactor, Risky Commit, or Documentation
  • Copy commit message directly to clipboard via InfoBar notification

Smart & Fast

  • Automatically skips binary files and ignored directories (node_modules, bin, obj, etc.)
  • Works only in git repositories with changes
  • Integrated status bar feedback

Requirements

  • Visual Studio 2022 (version 17.0 or higher)
  • .NET Framework 4.7.2 or higher
  • Git repository (extension only works in git repos)
  • Backend API endpoint running (configurable)

Installation

From Visual Studio Marketplace

  1. Open Visual Studio 2022
  2. Go to Extensions → Manage Extensions
  3. Search for "CommiTect"
  4. Click Download and restart Visual Studio

From VSIX Package

  1. Download the .vsix file
  2. Double-click to install
  3. Restart Visual Studio

How to Use

Two Ways to Generate Commit Messages:

  1. Keyboard Shortcut (Recommended)

    • Press Shift+C from anywhere in Visual Studio
  2. Menu Command

    • Navigate to Tools → CommiTect - Generate Commit Message

What Happens Next:

  1. Extension checks for git repository and changes
  2. Analyzes all changes (staged, unstaged, and untracked files)
  3. Sends diff to backend API
  4. Displays InfoBar notification with suggested commit message
  5. Click "Copy to Clipboard" to copy the message
  6. Status bar shows progress during analysis

Configuration

Configure the extension via Tools → Options → CommiTect → General:

  • Enabled - Enable/disable the extension (default: true)
  • API URL - Backend API endpoint (default: http://commitintentdetector.runasp.net/api/Commit/analyze)
  • Timeout (ms) - API request timeout (default: 30000)
  • Show Status Bar - Show status bar indicator during analysis (default: true)
  • Allow Insecure SSL - Allow self-signed certificates for development (default: false)

Keyboard Shortcut

The extension comes with a default keyboard shortcut: Shift+C to quickly generate commit messages.

Customizing the Keyboard Shortcut:

If you want to change the default shortcut:

  1. Go to Tools → Options → Environment → Keyboard
  2. Search for "CommiTect.GenerateCommitMessage" in the "Show commands containing" box
  3. Click in "Press shortcut keys" and press your desired key combination
  4. Click "Assign" button
  5. Click "OK" to save

Alternative Suggested Shortcuts:

  • Ctrl+Shift+C - Generate Commit Message
  • Alt+C - Alternative shortcut
  • Ctrl+Alt+G - Git commit shortcut

Backend API Setup

The extension requires a running backend API. Your API should accept this format:

Request:

POST /api/Commit/analyze
Content-Type: application/json

{
  "diff": "=== UNSTAGED CHANGES ===\n\n+ // Added a new feature\n+ function subtract(a, b) {\n+   return a - b;\n+ }\n\n=== STAGED CHANGES ===\n\n- // Old code\n+ // New code"
}

Response:

{
  "intent": "Intent: Feature\nMessage: Add subtraction support to the calculator"
}

Supported intents: Bug Fix, Feature, Refactor, Risky Commit, Documentation, Test

Project Structure

CommiTect/
├── CommiTectPackage.cs               # Main extension package
├── CommiTectPackage.vsct             # Command definitions and menu
├── Commands/
│   ├── CommitMessageGenerator.cs     # Main commit generation logic
│   ├── FallbackCommitGenerator.cs    # Fallback commit message generator 
│   ├── GitService.cs                 # Git operations (diff, repo check)
│   ├── ApiClient.cs                  # HTTP client for backend API
│   ├── IntentProcessor.cs            # Processes and displays results
│   ├── StatusBarService.cs           # Visual Studio status bar integration
│   └── OptionPageGrid.cs             # Configuration options page
├── source.extension.vsixmanifest     # VSIX manifest
└── CommiTect.csproj                  # Project file

Building the Extension

Prerequisites

  • Visual Studio 2022 with "Visual Studio extension development" workload
  • .NET Framework 4.7.2 SDK

Build Steps

  1. Open CommiTect.sln
  2. Restore NuGet packages
  3. Build solution (F6 or Ctrl+Shift+B)
  4. The VSIX will be in bin\Debug\ or bin\Release\

Debug the Extension

  1. Press F5 to start debugging
  2. A new Visual Studio instance (Experimental Instance) will launch
  3. Open a git repository and test the extension
  4. Check Debug → Windows → Output for diagnostic logs

Troubleshooting

"No solution is open" message?

  • Open a solution or project in Visual Studio
  • The extension requires a solution to determine the git repository location

"Not a Git repository" message?

  • Initialize git in your solution directory: git init
  • Or open a solution that's already in a git repository

"No changes detected" message?

  • Make sure you have modified, added, or created files
  • The extension analyzes all changes, not just saved files

No InfoBar notification appearing?

  • Check the Output window (View → Output → Show output from: CommiTect)
  • Verify extension is enabled in Tools → Options → CommiTect
  • Try restarting Visual Studio

SSL certificate errors?

  • For development: Enable "Allow Insecure SSL" in Tools → Options → CommiTect
  • For production: Use a valid SSL certificate

API connection failed?

  • Verify the backend service is running
  • Check API URL in Tools → Options → CommiTect
  • Test the endpoint manually with Postman or curl
  • Check your firewall settings

Changes too large error?

  • The maximum diff size is 5MB
  • Consider committing changes in smaller batches
  • Large binary files are automatically excluded

Extension not loading?

  • Check Visual Studio output window for errors (View → Output)
  • Verify Visual Studio version is 2022 (17.0+)
  • Try resetting the experimental instance: devenv /ResetSettings Exp

Known Limitations

  • Only works in git repositories
  • Requires a running backend API
  • Binary files are excluded from analysis
  • Large diffs (>5MB) are skipped
  • Maximum analysis timeout: 30 seconds (configurable)
  • Files in ignored directories (node_modules, bin, obj, .vs, etc.) are excluded

Privacy

This extension sends git diff content to your configured backend API for analysis. No data is sent to third parties unless you configure a third-party API endpoint.

Support

License

MIT License - see LICENSE file for details


Enjoy better commit messages in Visual Studio! 🚀

About

Automatically analyzes your code and suggests a clear, professional commit name (Bug Fix, Feature, Refactor, Docs, Tests) using an external backend API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages