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()