vancura / diff-summarizer

A Git commit message generator powered by OpenAI GPT-4o and Anthropic Claude 3.5
MIT License
1 stars 0 forks source link
ai anthropic automation claude cli code-assistant code-quality commit-generator commit-messages conventional-commits developer-tools devtools git git-automation git-tools git-workflow javascript nodejs productivity

diff-summarizer

diff-summarizer is a command-line tool that leverages advanced AI models like OpenAI's GPT-4 and Anthropic's Claude to automatically generate clear and concise Git commit messages based on your staged changes. By analyzing the differences in your code, it creates commit messages that adhere to best practices and formatting guidelines, saving you time and ensuring consistency across your project's commit history.

Key Benefits

How It Works

diff-summarizer fetches the diff of your staged changes using git diff --cached and sends this information to the AI model. The AI then generates a commit message following Git best practices, which is printed to the console and copied to your clipboard for easy pasting.

Features

Installation

# Clone the repository
git clone https://github.com/vancura/diff-summarizer.

Usage

# Stage your changes
git add .

# Generate commit message with Claude 3.5
npm start

# Generate commit message with GPT-4
node diff-summarizer-gpt4o.mjs

Configuration

# Using environment variables
export OPENAI_API_KEY_DIFF_SUMMARIZER="your-openai-api-key"
export CLAUDE_API_KEY_DIFF_SUMMARIZER="your-claude-api-key"

License

Licensed under the MIT License. See the LICENSE file for details.