Catalog PyPI
PACKAGE EXPLORERView in registry

ai-git-commit-gen

PyPI

AI-powered git commit message generator

aiclicommitdeveloper-toolsgit
Versions collected1
Direct dependencies5From release 0.1.2
Last observed21 Oct, 10:49 UTC

README

Version 0.1.2 documentation

🚀 ai-git-commit-gen

AI-powered git commit message generator - Zero configuration, instant intelligent commits

PyPI version Python License: MIT Code style: black

Generate meaningful git commit messages instantly using AI. No API keys required - works right out of the box with free HuggingFace models.

✨ Features

  • 🔑 Zero Configuration - No API keys or setup required
  • 🤖 AI-Powered - Uses state-of-the-art language models
  • 🎨 Multiple Styles - Conventional commits, Gitmoji, or simple format
  • ⚡ Lightning Fast - Smart caching for instant repeated suggestions
  • 🎯 Context Aware - Analyzes your actual code changes
  • 📝 Interactive CLI - Beautiful terminal UI with rich formatting
  • 🔄 Regenerate - Don't like the suggestions? Generate new ones instantly
  • ✏️ Edit Mode - Fine-tune messages before committing

📦 Installation

pip install ai-git-commit-gen

That's it! No configuration needed.

🚀 Quick Start

  1. Stage your changes:
git add .
  1. Generate commit message:
gcai generate
  1. Select from AI-generated suggestions or regenerate for new options!

📖 Usage

Basic Commands

# Generate commit message suggestions
gcai generate
gcai g  # Short alias

# Auto-commit with first suggestion
gcai generate --auto

# Generate more suggestions
gcai generate --num 5

# Use different commit styles
gcai generate --style conventional  # Default
gcai generate --style gitmoji       # With emojis 🎨
gcai generate --style simple        # Simple format

# Dry run - see what would be committed
gcai generate --dry-run

# Check if ready to generate
gcai check

Interactive Mode

When you run gcai generate, you'll see:

🔍 Analyzing staged changes...

📁 Files changed:
   📝 src/auth/jwt.py (modified)
   ✨ src/auth/refresh.py (added)
   📝 tests/test_auth.py (modified)

✨ Suggested commit messages:

  [1] feat(auth): implement JWT refresh token rotation
  [2] fix(auth): add automatic token refresh mechanism
  [3] feat(auth): add refresh token support with rotation

Select [1-3], [r]egenerate, [e]dit, or [q]uit:

Choose an option:

  • 1-3: Select a suggestion
  • r: Generate new suggestions
  • e: Edit selected message before committing
  • q: Quit without committing

🎨 Commit Styles

Conventional Commits (Default)

feat(auth): add JWT refresh token rotation
fix(api): handle null response in user endpoint
docs(readme): update installation instructions

Gitmoji

✨ feat(auth): add JWT refresh token rotation
🐛 fix(api): handle null response in user endpoint
📝 docs(readme): update installation instructions

Simple

Add JWT refresh token rotation
Fix null response handling in user endpoint
Update readme installation instructions

🛠️ Advanced Features

Caching

git-commit-ai intelligently caches suggestions for identical changes, making repeated operations instant.

Smart Diff Handling

Large diffs are automatically truncated while preserving the most important context.

Fallback Mechanisms

  • Primary model unavailable? Automatically switches to backup model
  • No internet? Generates basic but functional commit messages
  • Rate limited? Implements smart exponential backoff

🧪 Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/git-commit-ai.git
cd git-commit-ai

# Install in development mode
pip install -e .

# Install development dependencies
pip install pytest pytest-asyncio pytest-cov

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=git_commit_ai --cov-report=html

# Run specific test file
pytest tests/test_cli.py

Code Quality

# Format code
ruff format src tests

# Lint
ruff check src tests

# Type checking (optional, if using mypy)
mypy src

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (using git-commit-ai of course! 😄)
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built with Typer for the amazing CLI experience
  • Powered by HuggingFace free inference API
  • Beautiful terminal output with Rich
  • Git operations via GitPython

🐛 Troubleshooting

"Not a git repository"

Make sure you're in a git repository. Initialize one with:

git init

"No staged changes found"

Stage your changes first:

git add .

"API is busy, retrying..."

The free HuggingFace API may be under load. The tool will automatically retry with exponential backoff.

Network Issues

Check your internet connection. The tool will fallback to basic commit messages if the API is unreachable.

📊 Stats

  • ⚡ Average response time: 2-3 seconds
  • 🎯 Suggestion accuracy: High
  • 💾 Cache hit rate: ~30% in typical usage
  • 🔄 API reliability: 99%+ with fallback

🚗 Roadmap

  • Support for commit body generation
  • Custom prompt templates
  • Git hooks integration
  • Multiple language support
  • Team-specific style guides
  • VSCode extension
  • Pre-commit integration

Made with ❤️ by developers, for developers

Report Bug • Request Feature

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.227 Dec 20255

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
yogichoudhari/ai-git-commit-gen

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:49 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:01050d667f0f396757ebd60980ba2e7a608c4fe61cb278c064a67f89ae4101ad