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 yours 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

3️⃣ Auto-Commit & Push

autocommit --commit --push

📌 Example Output:

✅ Committed Successfully: refactor: improved API response handling
🚀 Pushed changes to remote repository!

⚙️ 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/yourusername/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.tar.gz (3.6 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-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autocommit_cli-0.1.tar.gz
  • Upload date:
  • Size: 3.6 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.tar.gz
Algorithm Hash digest
SHA256 6a65c2c2786bab4ba9ff06f95ad2c7c8b72971134be9c15b698d6a3508836437
MD5 1fb008e953f49c92c7a85c17b1358b66
BLAKE2b-256 573ef3cf30af0e132c8682e021ae5660e6daa9b662a7e6d81d2252d89b2701e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: autocommit_cli-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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-py3-none-any.whl
Algorithm Hash digest
SHA256 9e031e9f1bf5a5f38c3806273ecda5be67637fd08d44fd8f70510d902ac270b2
MD5 49230136b3ddca338cbd267d5500a8bf
BLAKE2b-256 b264e21b7cc7cb9be064d7193b45d4b4435a5ff9227707770fb01a94f2724669

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