Skip to content

Latest commit

 

History

History
204 lines (155 loc) · 5.01 KB

File metadata and controls

204 lines (155 loc) · 5.01 KB

AI Commit - Project Documentation

Overview

AI Commit is a command-line tool that generates intelligent git commit messages using local Ollama AI models. It analyzes your staged changes and creates meaningful commit messages following best practices.

Author Information

Himanshu Kumar

Support the Project

Quick Links

Installation

Quick Install

git clone https://github.com/himanshu231204/ai-commit.git
cd ai-commit
bash install.sh

Manual Install

git clone https://github.com/himanshu231204/ai-commit.git
cd ai-commit
pip install -e .

Usage

# Stage your changes
git add .

# Generate commit message
ai-commit

Features

  • 🤖 AI-powered commit message generation
  • 🔒 100% local and private
  • 💰 Free (uses local Ollama)
  • ⚡ Fast generation
  • 🎨 Multiple commit styles
  • 🌐 Works offline

Technical Stack

  • Language: Python 3.8+
  • Dependencies: requests
  • AI Backend: Ollama
  • License: MIT

Project Structure

ai-commit/
├── ai_commit.py              # Main application
├── setup.py                  # Package configuration
├── requirements.txt          # Dependencies
├── install.sh                # Installation script
├── README.md                 # User documentation
├── CONTRIBUTING.md           # Contribution guidelines
├── LICENSE                   # MIT License
├── .gitignore                # Git ignore rules
└── .github/
    └── workflows/
        └── ci.yml            # GitHub Actions CI

How It Works

  1. Analyze: Reads git diff of staged changes
  2. Generate: Sends diff to local Ollama model
  3. Present: Shows generated commit message
  4. Interactive: User can accept, regenerate, edit, or cancel
  5. Commit: Creates git commit with chosen message

Supported Models

  • llama2 (recommended)
  • codellama (code-optimized)
  • mistral (fast)
  • phi (lightweight)
  • llama3 (most powerful)
  • Any Ollama model

Commit Message Styles

Conventional Commits

feat(auth): add user login functionality
fix(api): resolve timeout issue
docs(readme): update installation steps

Semantic

Add user login functionality
Fix timeout issue in API
Update installation steps in README

Detailed

Add user authentication system

- Implement JWT-based authentication
- Add login and logout endpoints
- Create user session management

Development

Setup Development Environment

git clone https://github.com/himanshu231204/ai-commit.git
cd ai-commit
pip install -e .

Running Tests

# Coming soon
pytest tests/

Code Style

  • Follow PEP 8
  • Use type hints
  • Add docstrings
  • Write clean, readable code

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Quick Contribution Guide

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Roadmap

  • Basic commit message generation
  • Multiple commit styles
  • Interactive CLI
  • Configuration file support
  • Custom prompt templates
  • Git hooks integration
  • VSCode extension
  • Multiple language support
  • Batch commit support
  • Commit history analysis

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Ollama - For local LLM runtime
  • Git - Version control system
  • Python - Programming language
  • Community - Contributors and users

Support

Statistics

GitHub stars GitHub forks GitHub issues GitHub pull requests Python version License


Made with ❤️ by Himanshu Kumar

If you find this project useful, please consider giving it a ⭐ on GitHub!