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/commit-with-ai.git
cd commit-with-ai

# 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

# If installed via pip
git config --global alias.ac '!commit-with-ai'

# Or if using uvx (no installation)
git config --global alias.ac '!uvx commit-with-ai'

# Or if running from source
git config --global alias.ac '!/your-script-path/commit-with-ai/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.1.tar.gz (8.5 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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commit_with_ai-1.0.1.tar.gz
  • Upload date:
  • Size: 8.5 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.1.tar.gz
Algorithm Hash digest
SHA256 b6239938d778802c3a1fb3ced3192f90b62f0264519f269f19cbf067bf77a0c1
MD5 445ed5e6e1d1fb1e20f24b2b2b4954ca
BLAKE2b-256 972cd137c0e508866373cfa8c86d5f002d99e1ddeefc638ea4fb4baef0a54fb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: commit_with_ai-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e732781a7202d31c54ae3712c3bd17cb2e71ea3527c3407267d54e38943939a
MD5 5f50146d43d19dec4689ba9952a71b18
BLAKE2b-256 d6e753d5c15b62b9586c3a3e477060a10cc9ceb28812e97ff3c71d13f760299b

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