{"id":23988792,"url":"https://github.com/adelelawady/ai-git-commit","last_synced_at":"2025-02-25T03:13:03.763Z","repository":{"id":271281968,"uuid":"912947753","full_name":"adelelawady/ai-git-commit","owner":"adelelawady","description":"This repository contains scripts that automatically generate meaningful Git commit messages using AI. scripts analyze your code changes and create descriptive commit messages, with optional emoji support.","archived":false,"fork":false,"pushed_at":"2025-01-06T18:24:51.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T19:26:01.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adelelawady.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-06T18:09:09.000Z","updated_at":"2025-01-06T18:24:54.000Z","dependencies_parsed_at":"2025-01-07T03:45:35.202Z","dependency_job_id":null,"html_url":"https://github.com/adelelawady/ai-git-commit","commit_stats":null,"previous_names":["adelelawady/ai-git-commit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelelawady%2Fai-git-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelelawady%2Fai-git-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelelawady%2Fai-git-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelelawady%2Fai-git-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adelelawady","download_url":"https://codeload.github.com/adelelawady/ai-git-commit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240593179,"owners_count":19825939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-07T16:15:53.844Z","updated_at":"2025-02-25T03:13:03.342Z","avatar_url":"https://github.com/adelelawady.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Git Commit Message Generator 🤖 ✨\n\n![Python Version](https://img.shields.io/badge/python-3.x-blue?style=flat-square\u0026logo=python)\n![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)\n![Status](https://img.shields.io/badge/status-active-success?style=flat-square)\n![AI Models](https://img.shields.io/badge/AI%20Models-Ollama%20%7C%20Hyperbolic-orange?style=flat-square\u0026logo=openai)\n\nThis repository contains two scripts that automatically generate meaningful Git commit messages using AI. Both scripts analyze your code changes and create descriptive commit messages, with optional emoji support.\n\n## Scripts Overview 📜\n\n### 1. Generate.py (Ollama Version) 🐳\n![Ollama](https://img.shields.io/badge/Ollama-local%20AI-blue?style=flat-square\u0026logo=docker)\n\nUses Ollama's local AI model to generate commit messages.\n\n**Features:**\n- 🔄 Local AI processing with Ollama\n- 🔍 Analyzes both staged and unstaged changes\n- 👀 Watch mode for automatic commits\n- 😊 Optional emoji in commit messages\n- 📝 Detailed change summaries\n- 🎯 Support for staged-only commits\n\n**Requirements:**\n- Python 3.x\n- Ollama installed and running\n- qwen2.5-coder:3b model in Ollama\n\n### 2. Generate_Hyperbolic.py (Cloud Version) ☁️\n![Hyperbolic](https://img.shields.io/badge/Hyperbolic-cloud%20API-brightgreen?style=flat-square\u0026logo=cloud)\n\nUses Hyperbolic's cloud API for commit message generation.\n\n**Features:**\n- 🌐 Cloud-based AI processing\n- 🔍 Analyzes both staged and unstaged changes\n- 👀 Watch mode for automatic commits\n- 😊 Optional emoji in commit messages\n- 📝 Detailed change summaries\n- 🎯 Support for staged-only commits\n\n**Requirements:**\n- Python 3.x\n- Hyperbolic API key\n- Internet connection\n\n## Installation 🛠️\n\n### Option 1: Install all dependencies\n```bash\n# Windows\npip install -r .\\requirements.txt\n\n# Linux/Mac\npip install -r requirements.txt\n```\n\n### Option 2: Install in virtual environment (recommended)\n```bash\n# Create virtual environment\npython -m venv venv\n\n# Activate virtual environment\n# Windows\n.\\venv\\Scripts\\activate\n# Linux/Mac\nsource venv/bin/activate\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n### Option 2: Install individual packages\n1. Install required packages:   \n```bash\npip install gitpython watchdog\n```\n\n2. For generate.py\n```bash\npip install ollama-python\n```\n\n3. For generate_hyperbolic.py\n```bash\npip install requests\n```\n\n## Usage 🚀\n\n### Basic Usage:\n\n```bash\npython generate.py\n```\n\n\n## Using Ollama version\n```bash\npython generate.py\n```\n\n\n## Using Hyperbolic version\n```bash\n python generate_hyperbolic.py\n```\n\n\n### Command Line Options 🎮\n\nBoth scripts support the following options:\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--path` | `-p` | Path to Git repository (default: current directory) |\n| `--emoji` | `-e` | Enable emoji in commit messages |\n| `--staged` | `-s` | Only process staged files |\n| `--watch` | `-w` | Enable watch mode for automatic commits |\n| `--delay` | `-d` | Delay in seconds before auto-commit (default: 5) |\n| `--debug` | | Enable debug logging |\n\n### Examples 📋\n\n```bash\npython generate.py -p /path/to/repo -e -s -w -d 10\n```\n\n\n\n## Watch mode with emojis\n```bash\npython generate.py -w -e\n```\n\n## Process only staged changes\n```bash\npython generate.py -s\n```\n\n## Watch staged changes with custom delay\n```bash\npython generate.py -w -s -d 10\n```\n\n## Use specific repository path\n```bash\npython generate.py -p /path/to/repo\n```\n\n## Features in Detail 🔍\n\n### Watch Mode 👀\n- Monitors repository for changes\n- Automatically generates commit messages\n- Configurable delay before commit\n- Can be limited to staged changes only\n\n### Emoji Support 😊\n- Adds relevant emojis based on change type\n- Follows conventional commit message format\n- Makes commits more expressive and readable\n\n### Logging 📊\n- Detailed debug logs available\n- UTF-8 support for emoji logging\n- Tracks all operations and errors\n\n## Error Handling 🛡️\n- Graceful handling of Git errors\n- API connection error management\n- Unicode/encoding error protection\n- Duplicate processing prevention\n\n## Contributing 🤝\nFeel free to submit issues and enhancement requests!\n\n## License 📄\nMIT License\n\n## Note ℹ️\n- The Ollama version (generate.py) requires a local Ollama installation\n- The Hyperbolic version (generate_hyperbolic.py) requires an API key and internet connection\n- Both scripts provide similar functionality with different AI backends\n\n\n```\npython .\\generate_hyperbolic.py --watch --staged --emoji --delay 2 -p /path/to/proj\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadelelawady%2Fai-git-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadelelawady%2Fai-git-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadelelawady%2Fai-git-commit/lists"}