Skip to main content

An AI agent for generating meaningful git commit messages using Google's Gemini AI

Project description

🤖 DiffWhisperer

Your AI-powered Git companion for crafting perfect commit messages

DiffWhisperer is a powerful CLI tool that uses Google's Gemini AI to automatically generate meaningful, conventional commit messages by analyzing your code changes. Say goodbye to vague commit messages and hello to consistent, professional git history!

✨ Why DiffWhisperer?

  • 🎯 Consistent Quality: Follows conventional commits format for clear, structured history
  • 🧠 Smart Analysis: Intelligently analyzes code changes to understand context
  • 🚀 Lightning Fast: Powered by Google's latest Gemini models for quick responses
  • 💰 Cost Effective: Uses Google's free Gemini AI API
  • 🛠️ Flexible: Works with any git repository and supports customization
  • 🔄 Seamless Integration: Easy to add to your existing git workflow

🚀 Quick Start

Installation

pip install diffwhisperer

Setup

  1. Get your free API key from Google AI Studio

  2. Set your API key:

export GOOGLE_API_KEY="your-api-key-here"

Basic Usage

# Stage your changes
git add .

# Generate a commit message
diffwhisperer generate

# Or generate and commit in one go
diffwhisperer commit

🎯 Features

Smart Commit Message Generation

  • Automatically detects the type of changes (feat, fix, docs, etc.)
  • Identifies the scope based on changed files
  • Generates clear, concise descriptions
  • Follows the Conventional Commits specification

Flexible Configuration

# Choose your preferred Gemini model
diffwhisperer generate --model gemini-2.0-flash

# Customize token length for longer messages
diffwhisperer commit --max-tokens 150

# Work with specific repositories
diffwhisperer generate --repo-path /path/to/repo

Multiple Models Support

  • gemini-2.0-flash: Quick, efficient responses (default)
  • gemini-1.5-pro: More detailed analysis
  • More models coming soon!

📝 Example Outputs

# Feature addition
feat(auth): add google oauth integration

# Bug fix
fix(api): resolve race condition in async requests

# Documentation
docs(readme): update installation instructions and examples

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (use DiffWhisperer itself! 😉)
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/yourusername/diffwhisperer.git
cd diffwhisperer

# Install in development mode
pip install -e .

Release Process

DiffWhisperer follows semantic versioning. To create a new release:

  1. Update version in pyproject.toml
  2. Create a tag: git tag -a v1.0.0 -m "Release v1.0.0"
  3. Push with tags: git push origin main --tags

The GitHub Actions workflow will automatically build and publish tagged releases to PyPI.

📄 License

MIT - Feel free to use this tool in your projects!


Made with ❤️ by the DiffWhisperer team

PyPI version Build Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffwhisperer-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffwhisperer-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file diffwhisperer-0.1.0.tar.gz.

File metadata

  • Download URL: diffwhisperer-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for diffwhisperer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f60b773b8da3feea7cf8e2f420fe580ccee0c6d7ea68fd06bc3f5b62e7a3a282
MD5 e00f3426e528124ce2fd00ddfcdc3aca
BLAKE2b-256 53c0726380729b221b1f794528dd7b76d2955700be26b936b5cd6336d994d5a1

See more details on using hashes here.

File details

Details for the file diffwhisperer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: diffwhisperer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for diffwhisperer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 800d146f300efaee1f7cb60caeaafebd2f106215ad0f8f740b81f602152b0dbb
MD5 d8c01d68974573fc9af24865cd2df568
BLAKE2b-256 3da8ecc00af2645f57dda6866540b7209f4ce7c574ca23c3274327983f1edbc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page