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.7.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.7-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gmsg-0.1.7.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/25.0.0

File hashes

Hashes for gmsg-0.1.7.tar.gz
Algorithm Hash digest
SHA256 b82c85d1722479b459413a37d7a6161456222a0bbe4181113abfa5dda371addf
MD5 1426e8040cf1c951157dbfaad49ac416
BLAKE2b-256 6f21297269428223daeef59a596899a4441b066184905aca937b6781fed4c644

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gmsg-0.1.7-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/25.0.0

File hashes

Hashes for gmsg-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 298170ce11f387a66ef65e3edf74da1956dc0757b086fe15cf3acc78e5bd1341
MD5 89f4aac04e927f508221ec497304b79b
BLAKE2b-256 5499a2d68ada75d2f41eaca6a9960173590b419987ce4783527f0be83d820fcd

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