CoolFace
Apppublic

build-small-hackathon/git-commit-app

sourceHugging Faceupdated 3mo agoView on Hugging Face
3likes
README.md308 linesDownload Raw Back to root
1---2title: git-commit-at3emoji: πŸ€–4colorFrom: blue5colorTo: indigo6sdk: gradio7sdk_version: 6.18.08app_file: app.py9tags:10  - build-small-hackathon11pinned: false12---13 14# git-commit-app 🎯15 16**A suite of AI-powered git commit tools** for effortless, consistent commit messages.17 18This monorepo contains multiple projects for generating and managing git commits:19 20## Community21 22- [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/)23- [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)24 25## Projects26 27### πŸš€ [git-commit-at](./git-commit-at)28 29**AI-powered commit message generator with interactive CLI and web UI**30 31- Generate conventional commit messages using AI (Ollama)32- Interactive selection from 3 AI-suggested options33- Web UI for login, commit history, and branch visualization34- Session persistence and Redis caching35- Docker Compose setup with Ollama, Redis, and Gradio36 37**Quick start:**38```bash39npm install -g git-commit-at40git add .41git commit-at42```43 44**Features:**45- βœ… Conventional commit format (`feat:`, `fix:`, `refactor:`, etc.)46- βœ… Custom commit format templates47- βœ… Ticket number integration48- βœ… Live branch graph visualization49- βœ… Commit history tracking50- 🧠 Fine-tuned model integration (see below)51 52## Directory Structure53 54```55git-commit-app/56β”œβ”€β”€ git-commit-at/          # npm package β€” CLI + bundled web UI57β”‚   β”œβ”€β”€ index.js            # Core commit logic (Ollama AI)58β”‚   β”œβ”€β”€ wrapper.js          # CLI orchestrator59β”‚   β”œβ”€β”€ docker-compose.yml  # All services (Ollama, Redis, Gradio)60β”‚   β”œβ”€β”€ Dockerfile          # Node app container61β”‚   β”œβ”€β”€ entrypoint.sh       # Docker setup script62β”‚   β”œβ”€β”€ gradio/             # Bundled web UI (Python/Gradio)63β”‚   β”‚   β”œβ”€β”€ app.py          # Login + history + branch visualizer64β”‚   β”‚   β”œβ”€β”€ auth_service.py # Redis-based user auth65β”‚   β”‚   β”œβ”€β”€ generate_graph.py66β”‚   β”‚   β”œβ”€β”€ git_graph.py67β”‚   β”‚   └── Dockerfile68β”‚   └── package.json69β”‚70└── README.md               # This file71```72 73## Getting Started74 75### Prerequisites76 77- Docker & Docker Compose78- Node.js 18+79 80### Installation81 82```bash83npm install -g git-commit-at84```85 86### First Use87 88```bash89# Stage your changes90git add .91 92# Generate commit message93git commit-at94 95# Follow the interactive prompts96# - Log in or register97# - Select a suggested message98# - Confirm and commit99```100 101## Fine-Tuned Model Integration102 103`git-commit-at` now uses a **custom fine-tuned model** as its primary AI, with automatic fallback to a general model.104 105### Model106 107**[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.108 109### How it works110 111```112git diff (staged changes)113        β”‚114        β–Ό115β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”116β”‚  Fine-tuned model (primary)     β”‚  hf.co/Bhargavi5q1/git-commit-messages117β”‚  via Ollama                     β”‚118β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜119             β”‚ fails?120             β–Ό121β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”122β”‚  qwen2.5-coder:1.5b (fallback)  β”‚  general-purpose model123β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜124```125 126- Primary model is pulled automatically on first run (~986 MB)127- If unavailable, falls back silently to `qwen2.5-coder:1.5b`128- Terminal shows which model was used on each run129 130### Training details131 132| | |133|---|---|134| Base model | Qwen2.5-Coder 1.5B |135| Method | QLoRA (Unsloth) |136| Dataset | 2,179 git diff β†’ commit message pairs |137| Epochs | 3 |138| Format | Conventional Commits |139| Export | GGUF Q4_K_M (~986 MB) |140 141## Architecture142 143```144β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”145β”‚          git-commit-at (npm package)         β”‚146β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€147β”‚                                              β”‚148β”‚  CLI (Node.js)  ←→  Docker Compose          β”‚149β”‚                      β”œβ”€β”€ Ollama (AI)         β”‚150β”‚                      β”œβ”€β”€ Redis (cache)       β”‚151β”‚                      β”œβ”€β”€ Gradio (web UI)     β”‚152β”‚                      └── commit-at (Node)    β”‚153β”‚                                              β”‚154β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜155```156 157## Features Overview158 159### git-commit-at160 161- πŸ€– **AI Suggestions** β€” 3 smart commit message options162- 🎯 **Conventional Format** β€” Follows commit standards163- 🌐 **Web UI** β€” Login, history, branch visualization164- πŸ“ **Custom Formats** β€” Define your own commit template165- πŸ” **Session Persistence** β€” Stay logged in166- 🐳 **Docker Ready** β€” One-click setup167- πŸ“Š **Branch Visualizer** β€” See your git graph live168 169## Development170 171### Project Docs172 173- **git-commit-at**: [README](./git-commit-at/README.md) β€” Full setup, troubleshooting, contributing174 175### Development Workflow176 177```bash178# Install all dependencies179npm install180 181# Run services182docker compose up -d183 184# Access web UI185# http://localhost:7860186 187# Run CLI188node wrapper.js189```190 191### File Structure (git-commit-at)192 193| File | Purpose |194|------|---------|195| `wrapper.js` | CLI entry; manages Docker services |196| `index.js` | Main commit logic |197| `diff-parser.js` | Parses git diffs |198| `entrypoint.sh` | Docker setup |199| `gradio/app.py` | Web UI |200| `gradio/git_graph.py` | Branch visualization |201 202## Contributing203 204We welcome contributions! Here's how:205 2061. **Fork** the repo2072. **Create a branch** for your feature: `git checkout -b feature/my-feature`2083. **Make changes** and test locally2094. **Use git-commit-at** for your commits πŸ˜‰2105. **Push** and open a PR211 212### Commit Guidelines213 214Use [Conventional Commits](https://www.conventionalcommits.org/):215- `feat:` β€” New feature216- `fix:` β€” Bug fix217- `docs:` β€” Documentation218- `refactor:` β€” Code refactor219- `test:` β€” Tests220- `chore:` β€” Build, dependencies, etc.221 222## Troubleshooting223 224### General Issues225 226| Problem | Solution |227|---------|----------|228| Docker won't start | Check if Docker daemon is running |229| Port already in use | Change port in `docker-compose.yml` |230| "Not a git repo" | Run from inside a git repository |231 232### git-commit-at Issues233 234See [git-commit-at Troubleshooting](./git-commit-at/README.md#troubleshooting)235 236## Performance237 238| Operation | Time |239|-----------|------|240| First run (download models) | ~30s |241| Generate suggestions | ~5-10s |242| Web UI load | <1s |243 244## Environment Setup245 246### Using Docker (Recommended)247 248Everything runs in containersβ€”no local setup needed!249 250```bash251docker compose up -d252npm start253```254 255### Local Development256 257```bash258# Set up Node environment259node --version  # Should be 18+260 261# Install deps262npm install263 264# Start Docker services only265docker compose up -d ollama redis gradio266 267# Run app268node wrapper.js269```270 271## FAQ272 273**Q: Do I need Ollama installed locally?**274A: No! Ollama runs in a Docker container. Just ensure Docker is running.275 276**Q: Which AI model does this use? (Inprogress)**277A: 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.278 279**Q: Does this work offline?**280A: After the first run (which downloads the AI model), yes!281 282**Q: Can I use this without the web UI?**283A: Yes! Just run `git-commit-at` from the CLI.284 285**Q: How do I customize the commit format?**286A: You'll be prompted each time. Or edit the format in the Gradio UI after logging in.287 288## License289 290MIT β€” See [LICENSE](LICENSE) for details291 292## Links293 294- 🐳 Docker Hub: [git-commit-at](https://hub.docker.com)295- πŸ€— Hugging Face: [Fine-tuned model](https://huggingface.co/Bhargavi5q1/git-commit-messages) Β· [Spaces](https://huggingface.co/spaces/build-small-hackathon/git-commit-a)296- πŸ“¦ NPM: [git-commit-at](https://npmjs.com/package/git-commit-at)297 298## Support299 300- πŸ“– **Docs**: Check individual project READMEs301- πŸ› **Issues**: Report on GitHub302- πŸ’¬ **Discussions**: Ask questions in GitHub Discussions303 304---305 306**Made with ❀️ for developers who want better commits, faster.**307 308πŸš€ Start generating smarter commits today!