Comitto is a VS Code extension that automatically generates commit messages using various AI models (Ollama, OpenAI, Anthropic) and performs commits without user intervention.
- Automatic Commits: Performs Git commits based on configurable rules
- AI-generated Commit Messages: Uses Ollama, OpenAI, or Anthropic for high-quality commit messages
- Configurable Triggers: Adjust when automatic commits should be performed
- Comprehensive Git Settings: Configure repository path, branch, auto-push, and more
- Customizable Prompts: Customize the template for generating commit messages
- User-friendly Interface: All settings can be easily adjusted via the sidebar
- Status Display: Shows the current status of the extension in the VS Code status bar
- Visual Studio Code version 1.70.0 or higher
- Git must be installed on your system and initialized in your workspace
- Depending on configuration: Ollama installed locally or API keys for OpenAI/Anthropic
Comitto provides a user-friendly interface in the VS Code sidebar:
Shows the current status of the extension and provides quick access to frequently used functions:
- Status (enabled/disabled)
- Current AI provider
- Trigger rules
- Perform manual commit
Allows easy configuration of all parameters without editing JSON:
- AI provider and model settings
- Trigger rules
- Git settings
- Prompt templates
Click on an entry to edit the corresponding setting.
Visit ollama.com to install Ollama for your operating system.
After installation, start Ollama and load a model:
ollama pull llama3
To use OpenAI, you need an API key.
- Visit platform.openai.com
- Create an account or sign in
- Navigate to the API section and create an API key
- Copy the key into the extension settings (via the sidebar)
To use Anthropic, you need an API key.
- Visit console.anthropic.com
- Create an account or sign in
- Create an API key
- Copy the key into the extension settings (via the sidebar)
All settings can be easily adjusted via the sidebar. Alternatively, you can also use the VS Code settings:
Setting | Description | Default Value |
---|---|---|
comitto.aiProvider |
AI provider for generating commit messages (ollama, openai, anthropic) | ollama |
comitto.ollama.endpoint |
Ollama API endpoint | http://localhost:11434/api/generate |
comitto.ollama.model |
Ollama model for generating commit messages | llama3 |
comitto.openai.apiKey |
OpenAI API key | `` |
comitto.openai.model |
OpenAI model for generating commit messages | gpt-3.5-turbo |
comitto.anthropic.apiKey |
Anthropic API key | `` |
comitto.anthropic.model |
Anthropic model for generating commit messages | claude-3-haiku-20240307 |
comitto.autoCommitEnabled |
Enables or disables automatic commits | false |
comitto.triggerRules |
Rules that trigger automatic commits | See below |
comitto.gitSettings |
Git settings for commits | See below |
comitto.promptTemplate |
Customizable template for generating commit messages | See below |
The trigger rules can be configured as follows:
"comitto.triggerRules": {
"fileCountThreshold": 3, // Number of changed files that trigger a commit
"specificFiles": [ // Specific files that trigger a commit when changed
"package.json",
"README.md"
],
"minChangeCount": 10, // Minimum number of changes that trigger a commit
"timeThresholdMinutes": 30, // Minimum time in minutes between automatic commits
"filePatterns": ["**/*"] // Glob patterns for files to watch
}
The Git settings can be configured as follows:
"comitto.gitSettings": {
"repositoryPath": "", // Optional path to the Git repository (defaults to workspace folder)
"autoPush": false, // Automatically push after commit
"branch": "", // Optional branch name for commits (leave empty for current branch)
"commitMessageLanguage": "en", // Language for the commit message (en, de, fr, ...)
"commitMessageStyle": "conventional", // Style of the commit message (conventional, gitmoji, ...)
"useGitignore": true // Use .gitignore file for ignoring files
}
You can customize the template for AI generation. This can be done conveniently via the sidebar, where an editor will open:
"comitto.promptTemplate": "Generate a meaningful commit message for the following changes: \n\n{changes}\n\nUse the Conventional Commits format (feat, fix, docs, etc.) and keep the message under 80 characters."
The placeholder {changes}
will be automatically replaced with the list of changed files.
- Install the extension in VS Code
- Click on the Comitto icon in the activity bar to open the sidebar
- Configure the desired AI provider and other settings via the sidebar
- Enable automatic commits via:
- The button in the status view
- The command "Comitto: Enable Automatic Commits" in the command palette (Ctrl+Shift+P)
- Clicking on the Comitto icon in the status bar
- Continue working normally - the extension takes care of the rest!
- You can also perform a manual AI commit at any time using the command "Comitto: Perform Manual AI Commit" or via the status view
The extension provides the following commands:
comitto.enableAutoCommit
: Enables automatic commitscomitto.disableAutoCommit
: Disables automatic commitscomitto.toggleAutoCommit
: Toggles between enabled and disabled statecomitto.performManualCommit
: Performs a manual AI commitcomitto.refreshSettings
: Updates the settings displaycomitto.openSettings
: Opens the VS Code settings for Comitto
This extension sends information about your code changes to the configured AI provider:
- Ollama: Since Ollama runs locally on your system, this data does not leave your computer.
- OpenAI/Anthropic: When using these providers, your change information is sent to external servers. Please read the privacy policies of these providers.
You can control the amount of information sent by customizing the prompt template.
If you have problems with the extension:
- Make sure the selected AI provider is correctly configured
- Ollama: Ollama must be running and the configured model must be installed
- OpenAI/Anthropic: API key must be valid
- Check that Git is properly set up and
git status
works in the workspace - Check the VS Code output of the extension for error messages
- Refresh the settings display using the "Refresh" button
- The extension only works in workspaces with an initialized Git repository
- When using large diffs, the quality of the generated commit messages may vary
This extension is released under the MIT License.