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
-
Stage your changes:
git add . or git add <file>
-
Run the package:
gmsg
-
Follow the prompts:
- Press
y/Y/enterto commit with the suggested message - Press
eto edit the message in your default$EDITOR(e.g.,vim) - Press
nto regenerate the commit message
- Press
✨ 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
--ginto mention 'git issue number' in the commit. -
CLI Arguments Support Add flags like
--dry-runfor 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gmsg-0.1.8.tar.gz.
File metadata
- Download URL: gmsg-0.1.8.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.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9df16037474a78a338af1abf5b55e78590739ab9032d00eff5215875980ece3
|
|
| MD5 |
4d3114af58243ce783798ad781ed87b7
|
|
| BLAKE2b-256 |
a42866ceb3ba9fac50b4a039a1862f14296e6020649ce7d427756c90c0a8b57a
|
File details
Details for the file gmsg-0.1.8-py3-none-any.whl.
File metadata
- Download URL: gmsg-0.1.8-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.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cc55d077daefbe17c27a94af022781435b0d27a8570a78c74551ab1f22c0f19
|
|
| MD5 |
7116ecceb08e3da9692b05b7055ed172
|
|
| BLAKE2b-256 |
a9ab165cf43c268da986ec00454b13e244fa4fa2fe3b28e3b867b24da17a3069
|