Skip to main content

A CLI tool for AI-powered Git commit messages using Google Gemini API.

Project description

🚀 AutoCommit-CLI: AI-Powered Git Commit Messages

AutoCommit-CLI is a powerful command-line tool that automates the process of writing meaningful Git commit messages using Google Gemini AI. No more struggling to come up with good commit messages—just let AI do it for you! 🎯

✨ Features

  • 🔍 Analyze Git changes and generate meaningful commit messages.
  • 🔄 Auto-commit staged changes with AI-generated messages.
  • ☁️ Push changes to the repository automatically.
  • Works with Google Gemini API for intelligent commit suggestions.
  • 🏗 Easy to use & install as a CLI tool.

📦 Installation

1️⃣ Install via pip

pip install autocommit-cli

2️⃣ Set Up Google Gemini API Key

AutoCommit-CLI requires a Google Gemini API key. Get your key from Google AI Studio and store it in a .env file in your project:

GEMINI_API_KEY="your_api_key_here"

🛠 Usage

1️⃣ Analyze Changes & Get a Suggested Commit Message

autocommit --analyze

📌 Example Output:

💡 Suggested Commit Message:
fix: resolved authentication issue in login flow

2️⃣ Commit with AI-Generated Message

autocommit --commit

📌 Example Output:

✅ Committed Successfully: fix: updated error handling in user registration

⚙️ How It Works

  1. The tool fetches staged Git changes using git diff --staged.
  2. It sends these changes to the Google Gemini API to generate a relevant commit message.
  3. It commits the changes with the generated message.
  4. (Optional) It pushes the changes to the repository if --push is used.

🔧 Development & Contribution

Want to improve AutoCommit-CLI? Follow these steps:

Clone the repository:

git clone https://github.com/Pranjal-88/Autocommit-CLI.git
cd Autocommit-CLI

Install dependencies:

pip install -r requirements.txt

Run locally for testing:

python autocommit.py --analyze

Contribute:

  • Fork the repo ✅
  • Create a new branch ✅
  • Make your changes ✅
  • Submit a pull request ✅

📝 License

This project is licensed under the MIT License.


❤️ Support

If you like this project, give it a ⭐ on GitHub! 🙌

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

autocommit_cli-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

autocommit_cli-0.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file autocommit_cli-0.1.2.tar.gz.

File metadata

  • Download URL: autocommit_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for autocommit_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b7c0b24c4ad5e6a0f9008e355fa82782dd315a1a76f62de340787e87195bb461
MD5 3144c3ae69655a5e39a55df01be1188a
BLAKE2b-256 bb6b5784ff9b0c1a561ea80de2e67e22bbf00ceb7ce94f9eabb90e0c06dc63b0

See more details on using hashes here.

File details

Details for the file autocommit_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: autocommit_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for autocommit_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61b5e04564204a48d4338b2c1d5e437740f5a0107ca302ed2c9cd68b9dad49d8
MD5 8b70794516b5a75189b81b8ecdfb2fd7
BLAKE2b-256 82e1569a23c71484ed970d7b4d9f75a04001e927f03790ac0518e258301c871f

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