Intelli Commit - Cursor Extension
An AI-powered git commit automation extension for Cursor that intelligently suggests branch names and commit messages based on your code changes.
Features
- 🤖 AI-Powered Analysis: Uses configurable AI providers (OpenAI, Claude) or heuristic rules to analyze your git diff and suggest appropriate branch names and commit messages
- 🌿 Smart Branch Management: Automatically suggests creating a new branch when you're on main/master
- 📝 Selective Staging: Lets you choose which files to stage before committing
- 🚀 Auto-Push Support: Optional automatic pushing to origin with upstream tracking
- ⚡ One-Command Workflow: Complete git workflow with a single command
- 🔧 Multiple AI Providers: Support for OpenAI GPT models and Anthropic Claude models
- 💰 Cost-Effective: Use cheaper models like GPT-4o-mini or Claude Haiku for commit messages
Installation
- Clone this repository
- Run
npm install
to install dependencies
- Run
npm run compile
to build the extension
- Package and install the extension in Cursor
Quick Start
- First Launch: The extension will automatically guide you through setup
- Choose AI Provider: Select OpenAI, Claude, or Heuristic rules
- Enter API Key: If using AI, enter your API key (we'll help you get one)
- Start Committing: Use
Cmd+Shift+G
(Mac) or Ctrl+Shift+G
(Windows/Linux)
The extension defaults to OpenAI for the best experience, but you can always change this later!
Usage
First Time Setup
- Automatic Onboarding: The extension will guide you through setup on first use
- Manual Setup: Run "Setup AI Provider" from Command Palette if needed
- Quick Commands:
Cmd+Shift+P
→ "Setup AI Provider" - Complete setup wizard
Cmd+Shift+P
→ "Configure OpenAI" - Quick OpenAI setup
Cmd+Shift+P
→ "Configure Claude" - Quick Claude setup
Daily Usage
- Open a git repository in Cursor
- Make your changes
- Use
Cmd+Shift+G
(Mac) or Ctrl+Shift+G
(Windows/Linux) or run "Intelli Commit" from Command Palette
- Follow the prompts to:
- Confirm branch creation (if on main branch)
- Select files to stage
- Review the AI-generated commit message
- Choose whether to push (if auto-push is enabled)
Configuration
Configuration Settings
You can configure the extension behavior in Cursor Settings:
- Open Cursor Settings (
Cmd+,
on Mac, Ctrl+,
on Windows/Linux)
- Search for "Intelli Commit"
- Configure the following options:
Auto-Push Setting
intelliCommit.autoPush
: Automatically push commits to origin after committing
- Default:
false
Auto-Initialize Git
intelliCommit.autoInitGit
: Automatically initialize git repository without prompting
- Default:
false
AI Provider Configuration
intelliCommit.aiProvider
: Choose AI provider (heuristic
, openai
, claude
)
- Default:
heuristic
OpenAI Configuration (if using OpenAI)
intelliCommit.openaiApiKey
: Your OpenAI API key
intelliCommit.openaiModel
: Model to use (gpt-4o-mini
, gpt-4o
, gpt-3.5-turbo
)
- Default Model:
gpt-4o-mini
(cost-effective)
Claude Configuration (if using Claude)
intelliCommit.claudeApiKey
: Your Anthropic Claude API key
intelliCommit.claudeModel
: Model to use (claude-3-5-sonnet-20241022
, claude-3-5-haiku-20241022
, claude-3-opus-20240229
)
- Default Model:
claude-3-5-haiku-20241022
(cost-effective)
Example Configuration
Add to your settings.json
:
{
"intelliCommit.autoPush": true,
"intelliCommit.autoInitGit": false,
"intelliCommit.aiProvider": "openai",
"intelliCommit.openaiApiKey": "sk-your-openai-api-key-here",
"intelliCommit.openaiModel": "gpt-4o-mini"
}
Or for Claude:
{
"intelliCommit.aiProvider": "claude",
"intelliCommit.claudeApiKey": "sk-ant-your-claude-api-key-here",
"intelliCommit.claudeModel": "claude-3-5-haiku-20241022"
}
Getting API Keys
OpenAI
- Visit OpenAI API
- Create an account or sign in
- Generate a new API key
- Add it to your settings
Anthropic Claude
- Visit Anthropic Console
- Create an account or sign in
- Generate a new API key
- Add it to your settings
Cost Considerations
- GPT-4o-mini: ~$0.15 per 1M input tokens, ~$0.60 per 1M output tokens
- Claude Haiku: ~$0.25 per 1M input tokens, ~$1.25 per 1M output tokens
- Typical commit message: ~1-2 cents per generation
The extension uses minimal tokens for commit message generation, making it very cost-effective even with frequent use.
How It Works
- Git Repository Check: Verifies you're in a git repository (prompts to initialize if not)
- Change Analysis: Analyzes uncommitted changes using git diff
- AI Processing: Uses Cursor's AI to understand the changes and suggest:
- A descriptive branch name (kebab-case)
- A concise commit message (under 50 characters)
- Branch Management: Asks if you want to create a new branch when on main/master
- File Staging: Lets you select which files to stage for commit
- Commit & Push: Commits with the AI-generated message and optionally pushes to origin
Requirements
- Cursor IDE
- Git repository
- Node.js (for development)
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch for changes
npm run watch
License
MIT License - see LICENSE file for details