Skip to main content

Generates git commit messages for you using AI.

Project description

gmsg

A command-line tool that automatically generates concise and meaningful Git commit messages using Google's Gemini model based on your staged changes.


🚀 Features

  • ✅ Detects if the current directory is a Git repository

  • ✅ Retrieves your staged changes via git diff --cached

  • ✅ Uses Gemini (for now) to generate a one-liner commit message

  • ✅ Allows you to:

    • Accept the suggestion
    • Edit the message in your preferred text editor
    • Regenerate a new suggestion
  • ✅ Automatically commits the changes with your selected message


📦 Installation

pip install gmsg

🛠️ Configuration

Get your Google Gemini API key if you don't have already.

1. Set API key

Enter your api key when package is used for the first time.

$ Enter your Gemini API KEY:

⚙️ Usage

  1. Stage your changes:

    git add .
    or 
    git add <file>
    
  2. Run the package:

    gmsg
    
  3. Follow the prompts:

    • Press y/Y/enter to commit with the suggested message
    • Press e to edit the message in your default $EDITOR (e.g., vim)
    • Press n to regenerate the commit message

✨ Example

$ git add some_file.py
$ gmsg

> Generate a one liner git commit message for these changes...
> Added error handling in API response parser

Do you want to continue with this message? [Y = yes / e = edit / n = no]: y
Running: `git commit -m Added error handling in API response parser`
Message committed to git. You can run `git commit --amend` to modify it.

🧩 Requirements


📍 Roadmap

Here are some upcoming features and improvements planned for this project:

  • CLI Arguments Support Add flags like --dry-run for non-interactive use.

  • Multi-line Commit Messages Option to generate more descriptive, multi-line messages with summaries and bullet points.

  • Better Diff Parsing Use syntax-aware parsing to improve prompt context and generate more accurate commit messages.

  • Git Hook Integration Provide an installable Git commit hook that auto-runs this tool on git commit.

  • Support for Other LLMs Add support for OpenAI's GPT, Claude, or local models using plugins/adapters.


📝 License

MIT License. Feel free to use, modify, and contribute!


🤝 Contributing

Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.

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

gmsg-0.1.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

gmsg-0.1.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file gmsg-0.1.5.tar.gz.

File metadata

  • Download URL: gmsg-0.1.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.11.6 Darwin/24.4.0

File hashes

Hashes for gmsg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5404e02161d0ae7e7fb2d121a4752a1739cee85434eadf721f36d48869b83437
MD5 239e65310f0751a4d7ea8e38e481b0d4
BLAKE2b-256 0b5208c40a095d29167152b0ac35511de09749c6e8c05b8fdf1d8f74b5d5d937

See more details on using hashes here.

File details

Details for the file gmsg-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: gmsg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.11.6 Darwin/24.4.0

File hashes

Hashes for gmsg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 24a587d04200ccd01d67e3e06149fdde904ea33f14e347036cc40ecbb6dfd69c
MD5 2869a1a4acaad82e9b69ba5e7f672554
BLAKE2b-256 b7ae7bdd09dfa1ba80efe988ead4f3ce28c86decfb45812c25b6aae60bac79e2

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