Skip to main content

AI-powered git commit message generator using Gemini API

Project description

Git Auto-Commit with Gemini API

AI-powered git commit message generator using Gemini API's structured JSON output.

What It Does

Analyzes your staged git changes and generates 5 Conventional Commits-compliant commit message suggestions using Gemini AI. Select one or enter your own.

Installation

Via PyPI (Recommended)

# Use uvx (no installation required)
uvx commit-with-ai

# Or install globally
pip install commit-with-ai

From Source

# Clone the repository
git clone https://github.com/chenwei791129/git-auto-commit.git
cd git-auto-commit

# Run directly with uv
uv run commit_with_ai.py

Setup

1. Configure API Key

Set your Gemini API key as an environment variable:

export GEMINI_API_KEY="your-api-key-here"

Get your API key from Google AI Studio.

For persistent configuration, add to your shell profile (~/.bashrc, ~/.zshrc):

export GEMINI_API_KEY="your-api-key-here"

2. Configure Git Alias (Optional)

Add to your ~/.gitconfig:

[alias]
    # If installed via pip
    ac = !commit-with-ai

    # Or if using uvx (no installation)
    ac = !uvx commit-with-ai

    # Or if running from source
    ac = !/your-script-path/git-auto-commit/commit_with_ai.py

Usage

git add <files>
git ac

Example

Analyzing staged changes...
Generating commit message options with Gemini API...

======================================================================
Select a commit message:
======================================================================
1. feat(auth): add user authentication system
2. feat: implement login and registration flow
3. chore(deps): add authentication dependencies
4. docs: update README with auth setup instructions
5. refactor(auth): restructure authentication module
6. Enter custom message
7. Cancel
======================================================================

Enter selection [1-7]:

Resources

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

commit_with_ai-1.0.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

commit_with_ai-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file commit_with_ai-1.0.0.tar.gz.

File metadata

  • Download URL: commit_with_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for commit_with_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cb673cdf5b43db166b96f79bea9b3c701385e67bb1f78206a28bb14f661d4d4c
MD5 78540de9bb734bd8d8d5686c83523d39
BLAKE2b-256 da2b40d16f6c48460026f3e5bf9d67624d9f97f7e69bb4e0fc7969b40dca3cc0

See more details on using hashes here.

File details

Details for the file commit_with_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: commit_with_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for commit_with_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f2127397747a6bd90f6c967ecee85f9bd608fc4f3bb0a5540646c63ff72c0a5
MD5 df0114232c387540d61d567049bade2a
BLAKE2b-256 82aaf1f270f0763ddd8b8b6f2501d8fcb2e86b94954dfd459d9cc47c78f9c74f

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