git-commit-app / app.py
bhargavirengarajan21
Add read me
659462c
import gradio as gr
INSTALL_CMD = "npm install -g git-commit-at"
NPM_URL = "https://www.npmjs.com/package/git-commit-at"
GITHUB_URL = "https://github.com/bhargavirengarajan21/git-commit-at"
DEMO_URL = "#" # TBH
ABOUT_MD = """
# git commit-at
**AI-powered git commit message generator** β€” local, private, no API key needed.
`git commit-at` analyzes your staged changes and suggests 3 conventional commit messages
using a locally-running AI model (Ollama). Pick one, customize it, and commit β€” all from
the terminal.
---
## Why git commit-at?
| | git commit-at | Manual commits | Cloud AI tools |
|---|---|---|---|
| **Private** | βœ… 100% local | βœ… | ❌ sends code to cloud |
| **No API key** | βœ… | βœ… | ❌ requires subscription |
| **Conventional commits** | βœ… auto | ❌ manual discipline | ⚠️ sometimes |
| **Branch visualizer** | βœ… built-in | ❌ | ❌ |
| **Commit history** | βœ… tracked | ❌ | ❌ |
---
## Install
```bash
npm install -g git commit-at
```
Requires: **Docker** (all AI/backend services run in containers β€” no extra setup).
---
## How to use
```bash
# 1. Stage your changes
git add .
# 2. Run the tool
git commit-at
# 3. First time: register/login at http://localhost:7860
# 4. Pick a suggested commit message
# 5. Confirm β€” done!
```
On first run, Docker starts Ollama, Redis, and the Gradio UI automatically.
---
## Features
- πŸ€– **3 AI suggestions** per run, tailored to your actual diff
- πŸ“‹ **Conventional commits** β€” `feat:`, `fix:`, `refactor:`, `chore:`, etc.
- 🎫 **Ticket integration** β€” prefix messages with JIRA/Linear ticket numbers
- 🌿 **Branch visualizer** β€” live git branch DAG in the web UI
- πŸ“Š **Commit history** β€” track everything you've committed across repos
- πŸ” **Session persistence** β€” stay logged in between runs
- 🐳 **Zero local dependencies** β€” everything runs in Docker
---
## Numbers
*(TBH β€” to be updated with real metrics)*
| Metric | Value |
|--------|-------|
| Average suggestion time | ~5–10 s |
| First-run setup time | ~30 s |
| AI model size | ~1 GB (qwen2.5-coder:1.5b) |
| Runs entirely offline after setup | βœ… |
---
## Links
- πŸ“¦ **npm**: [{npm}]({npm})
- πŸ’» **GitHub**: [{gh}]({gh})
- 🎬 **Demo**: [Coming soon]({demo})
""".format(npm=NPM_URL, gh=GITHUB_URL, demo=DEMO_URL)
QUICKSTART_MD = """
## Quick Start
```bash
# Install
npm install -g git commit-at
# Go to any git repo
cd your-project
git add .
# Generate commit message
git commit-at
```
The first run starts all Docker services and opens the login UI at `http://localhost:7860`.
After login, you'll see 3 commit message suggestions based on your staged diff.
"""
HOW_IT_WORKS_MD = """
## How it works
```
git commit-at (CLI)
β”‚
β”œβ”€β”€ Checks Docker services
β”‚ β”œβ”€β”€ Ollama (AI model, port 11434)
β”‚ β”œβ”€β”€ Redis (session + cache, port 6379)
β”‚ └── Gradio (web UI, port 7860)
β”‚
β”œβ”€β”€ Waits for login at http://localhost:7860
β”‚
└── Runs commit flow
β”œβ”€β”€ Reads git diff of staged files
β”œβ”€β”€ Sends diff to Ollama (qwen2.5-coder:1.5b)
β”œβ”€β”€ Streams 3 commit suggestions
β”œβ”€β”€ Prompts: ticket number? format?
β”œβ”€β”€ You pick a message
└── git commit -m "..."
```
"""
with gr.Blocks(title="git commit-at") as demo:
with gr.Row():
with gr.Column(scale=2):
gr.Markdown(ABOUT_MD)
with gr.Column(scale=1):
gr.Markdown("## Install now")
gr.Code(value=INSTALL_CMD, language="shell", label="npm")
gr.Markdown(f"[View on npm]({NPM_URL}) Β· [GitHub]({GITHUB_URL})")
gr.Markdown("---")
gr.Markdown(QUICKSTART_MD)
with gr.Row():
gr.Markdown(HOW_IT_WORKS_MD)
if __name__ == "__main__":
demo.launch()