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

  • Python 3.10+
  • Git installed and available in your system path

📍 Roadmap

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

  • CLI Arguments Support Add flags like --gin to mention 'git issue number' in the commit.

  • 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.6.tar.gz (4.1 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.6-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gmsg-0.1.6.tar.gz
Algorithm Hash digest
SHA256 542cc7bc34707192cf6888d48b95d495e5d6807cd98277e2866dd046ba9db8cc
MD5 49e2153757e6f81fb311e3e9e002df76
BLAKE2b-256 ad13665d1357605d9b51f8f93dae9636c8bb336406dcd9a6f1d1bb70a775fd81

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gmsg-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 51a93d6da3c6dadcf689b19f16a806b580703de52f6aa0b0e8f5829bd2c41594
MD5 a73fdcbe37c599f1eb61f445f811fd69
BLAKE2b-256 a0ab4292ccbef05f881e9449f47d12cb9675317cac063aac87fc3980dd25c08e

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