git-commit-app / README.md
bhargavirengarajan21
Add read me
3cefa9d
|
raw
history blame contribute delete
9.07 kB
---
title: git-commit-at
emoji: πŸ€–
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 6.18.0
app_file: app.py
tags:
- build-small-hackathon
pinned: false
---
# git-commit-app 🎯
**A suite of AI-powered git commit tools** for effortless, consistent commit messages.
This monorepo contains multiple projects for generating and managing git commits:
## Community
- [Reddit: I made a CLI that generates conventional commit messages locally using AI](https://www.reddit.com/user/bhargavi_r/comments/1u6v9uc/i_made_a_cli_that_generates_conventional_commit/)
- [dev.to: git-commit-at β€” Generate conventional commit messages locally with AI, no API key needed](https://dev.to/bhargavirengarajan21/git-commit-at-generate-conventional-commit-messages-locally-with-ai-no-api-key-needed-1nc4)
## Projects
### πŸš€ [git-commit-at](./git-commit-at)
**AI-powered commit message generator with interactive CLI and web UI**
- Generate conventional commit messages using AI (Ollama)
- Interactive selection from 3 AI-suggested options
- Web UI for login, commit history, and branch visualization
- Session persistence and Redis caching
- Docker Compose setup with Ollama, Redis, and Gradio
**Quick start:**
```bash
npm install -g git-commit-at
git add .
git commit-at
```
**Features:**
- βœ… Conventional commit format (`feat:`, `fix:`, `refactor:`, etc.)
- βœ… Custom commit format templates
- βœ… Ticket number integration
- βœ… Live branch graph visualization
- βœ… Commit history tracking
- 🧠 Fine-tuned model integration (see below)
## Directory Structure
```
git-commit-app/
β”œβ”€β”€ git-commit-at/ # npm package β€” CLI + bundled web UI
β”‚ β”œβ”€β”€ index.js # Core commit logic (Ollama AI)
β”‚ β”œβ”€β”€ wrapper.js # CLI orchestrator
β”‚ β”œβ”€β”€ docker-compose.yml # All services (Ollama, Redis, Gradio)
β”‚ β”œβ”€β”€ Dockerfile # Node app container
β”‚ β”œβ”€β”€ entrypoint.sh # Docker setup script
β”‚ β”œβ”€β”€ gradio/ # Bundled web UI (Python/Gradio)
β”‚ β”‚ β”œβ”€β”€ app.py # Login + history + branch visualizer
β”‚ β”‚ β”œβ”€β”€ auth_service.py # Redis-based user auth
β”‚ β”‚ β”œβ”€β”€ generate_graph.py
β”‚ β”‚ β”œβ”€β”€ git_graph.py
β”‚ β”‚ └── Dockerfile
β”‚ └── package.json
β”‚
└── README.md # This file
```
## Getting Started
### Prerequisites
- Docker & Docker Compose
- Node.js 18+
### Installation
```bash
npm install -g git-commit-at
```
### First Use
```bash
# Stage your changes
git add .
# Generate commit message
git commit-at
# Follow the interactive prompts
# - Log in or register
# - Select a suggested message
# - Confirm and commit
```
## Fine-Tuned Model Integration
`git-commit-at` now uses a **custom fine-tuned model** as its primary AI, with automatic fallback to a general model.
### Model
**[Bhargavi5q1/git-commit-messages](https://huggingface.co/Bhargavi5q1/git-commit-messages)** β€” Fine-tuned on 2,179 real git diffs using Unsloth + QLoRA on a Qwen2.5-Coder 1.5B base model. Trained to output conventional commit messages in one line with no explanation.
### How it works
```
git diff (staged changes)
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Fine-tuned model (primary) β”‚ hf.co/Bhargavi5q1/git-commit-messages
β”‚ via Ollama β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ fails?
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ qwen2.5-coder:1.5b (fallback) β”‚ general-purpose model
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
- Primary model is pulled automatically on first run (~986 MB)
- If unavailable, falls back silently to `qwen2.5-coder:1.5b`
- Terminal shows which model was used on each run
### Training details
| | |
|---|---|
| Base model | Qwen2.5-Coder 1.5B |
| Method | QLoRA (Unsloth) |
| Dataset | 2,179 git diff β†’ commit message pairs |
| Epochs | 3 |
| Format | Conventional Commits |
| Export | GGUF Q4_K_M (~986 MB) |
## Architecture
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ git-commit-at (npm package) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ CLI (Node.js) ←→ Docker Compose β”‚
β”‚ β”œβ”€β”€ Ollama (AI) β”‚
β”‚ β”œβ”€β”€ Redis (cache) β”‚
β”‚ β”œβ”€β”€ Gradio (web UI) β”‚
β”‚ └── commit-at (Node) β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
## Features Overview
### git-commit-at
- πŸ€– **AI Suggestions** β€” 3 smart commit message options
- 🎯 **Conventional Format** β€” Follows commit standards
- 🌐 **Web UI** β€” Login, history, branch visualization
- πŸ“ **Custom Formats** β€” Define your own commit template
- πŸ” **Session Persistence** β€” Stay logged in
- 🐳 **Docker Ready** β€” One-click setup
- πŸ“Š **Branch Visualizer** β€” See your git graph live
## Development
### Project Docs
- **git-commit-at**: [README](./git-commit-at/README.md) β€” Full setup, troubleshooting, contributing
### Development Workflow
```bash
# Install all dependencies
npm install
# Run services
docker compose up -d
# Access web UI
# http://localhost:7860
# Run CLI
node wrapper.js
```
### File Structure (git-commit-at)
| File | Purpose |
|------|---------|
| `wrapper.js` | CLI entry; manages Docker services |
| `index.js` | Main commit logic |
| `diff-parser.js` | Parses git diffs |
| `entrypoint.sh` | Docker setup |
| `gradio/app.py` | Web UI |
| `gradio/git_graph.py` | Branch visualization |
## Contributing
We welcome contributions! Here's how:
1. **Fork** the repo
2. **Create a branch** for your feature: `git checkout -b feature/my-feature`
3. **Make changes** and test locally
4. **Use git-commit-at** for your commits πŸ˜‰
5. **Push** and open a PR
### Commit Guidelines
Use [Conventional Commits](https://www.conventionalcommits.org/):
- `feat:` β€” New feature
- `fix:` β€” Bug fix
- `docs:` β€” Documentation
- `refactor:` β€” Code refactor
- `test:` β€” Tests
- `chore:` β€” Build, dependencies, etc.
## Troubleshooting
### General Issues
| Problem | Solution |
|---------|----------|
| Docker won't start | Check if Docker daemon is running |
| Port already in use | Change port in `docker-compose.yml` |
| "Not a git repo" | Run from inside a git repository |
### git-commit-at Issues
See [git-commit-at Troubleshooting](./git-commit-at/README.md#troubleshooting)
## Performance
| Operation | Time |
|-----------|------|
| First run (download models) | ~30s |
| Generate suggestions | ~5-10s |
| Web UI load | <1s |
## Environment Setup
### Using Docker (Recommended)
Everything runs in containersβ€”no local setup needed!
```bash
docker compose up -d
npm start
```
### Local Development
```bash
# Set up Node environment
node --version # Should be 18+
# Install deps
npm install
# Start Docker services only
docker compose up -d ollama redis gradio
# Run app
node wrapper.js
```
## FAQ
**Q: Do I need Ollama installed locally?**
A: No! Ollama runs in a Docker container. Just ensure Docker is running.
**Q: Which AI model does this use? (Inprogress)**
A: A custom fine-tuned model ([Bhargavi5q1/git-commit-messages](https://huggingface.co/Bhargavi5q1/git-commit-messages)) trained specifically for git commit messages. Falls back to `qwen2.5-coder:1.5b` if unavailable.
**Q: Does this work offline?**
A: After the first run (which downloads the AI model), yes!
**Q: Can I use this without the web UI?**
A: Yes! Just run `git-commit-at` from the CLI.
**Q: How do I customize the commit format?**
A: You'll be prompted each time. Or edit the format in the Gradio UI after logging in.
## License
MIT β€” See [LICENSE](LICENSE) for details
## Links
- 🐳 Docker Hub: [git-commit-at](https://hub.docker.com)
- πŸ€— Hugging Face: [Fine-tuned model](https://huggingface.co/Bhargavi5q1/git-commit-messages) Β· [Spaces](https://huggingface.co/spaces/build-small-hackathon/git-commit-a)
- πŸ“¦ NPM: [git-commit-at](https://npmjs.com/package/git-commit-at)
## Support
- πŸ“– **Docs**: Check individual project READMEs
- πŸ› **Issues**: Report on GitHub
- πŸ’¬ **Discussions**: Ask questions in GitHub Discussions
---
**Made with ❀️ for developers who want better commits, faster.**
πŸš€ Start generating smarter commits today!