Skip to content

A VSCode extension that turns Git diffs into clean, AI-generated commit messages.

Notifications You must be signed in to change notification settings

OlivierFch/ai-commit-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 AI Commit Assistant

Generate clear, consistent, and expressive Git commit messages from your staged changes — powered by OpenAI.

VSCode Engine License


🚀 Overview

AI Commit Assistant is a Visual Studio Code extension that helps you craft meaningful commit messages directly from your staged Git changes.
It analyzes your diff, detects relevant changes, and proposes commit messages following Conventional Commits — optionally with emojis 🎨.

You can also refine existing commit messages with simple instructions like “make it shorter” or “add bullet points.”


✨ Features

  • 🤖 AI-powered commit message generation (via OpenAI or custom HTTP endpoint)
  • 🧩 Conventional Commits format support
  • 😎 Optional emoji prefixes (✨ feat, 🐛 fix, etc.)
  • 🔒 Secret redaction before sending diffs
  • 🧠 Refine mode: improve or reformat an existing commit message
  • ⚙️ Customizable provider & model (OpenAI, Azure, or custom endpoint)

🧰 Commands

Command Description
AI Commit: Generate from staged changes Generate a commit message from the current staged diff
AI Commit: Refine current message Improve the current commit message
AI Commit Assistant: Set OpenAI API Key Store your OpenAI API key securely
AI Commit Assistant: Clear OpenAI API Key Delete the stored API key from VS Code SecretStorage

⚙️ Setup

1. Install

Clone this repo and open it in VS Code, then press F5 to launch in an Extension Development Host.

pnpm install
pnpm run compile

2. Set your API key

Run the command:

AI Commit Assistant: Set OpenAI API Key

🔒 The key is stored securely in VS Code’s Secret Storage and never committed.

3. Stage your changes

git add .

4. Generate your commit message

AI Commit: Generate from staged changes

Select Insert or Preview to view the message before applying it.

💡 Examples

Scenario Example Output
Add new feature ✨ feat(auth): add OAuth2 login flow
Fix a bug 🐛 fix(validation): correct email regex handling
Refactor logic ♻️ refactor(core): simplify async pipeline
Docs update 📝 docs: update contributing guide
Performance improvement ⚡ perf(api): reduce response latency by caching results
Chore / CI update 🧹 chore(ci): add lint check to GitHub Actions

About

A VSCode extension that turns Git diffs into clean, AI-generated commit messages.

Topics

Resources

Stars

Watchers

Forks