shreya518/commit-message-poet
๐ Commit Message Poet
Paste a git diff, get a poem about your code โ plus a clean Conventional Commit message underneath. A tiny, free web app.
Quiet code at rest โ the null check now stands guard where the login once crashed fix(auth): guard against missing sessionWhy it exists
Writing commit messages is a chore, so I taught a web app to write me a haiku about my diff first. The surprise: reading the poem made me actually re-read my own changes โ and the Conventional Commit line underneath keeps my git history clean and searchable.
100% free
Runs on Google Gemini's free tier. No paid API, no credit card. If the free quota is briefly maxed out (e.g. lots of people using it at once), it shows a friendly sample instead of ever breaking.
Try it
Online: (add your Hugging Face Space URL here after deploying)
Locally:
pip install gradio -r requirements.txt
python app.pySet your key first โ PowerShell: $env:GEMINI_API_KEY="your_free_key" ยท macOS/Linux: export GEMINI_API_KEY=your_free_key. (On Hugging Face Spaces, Gradio is provided via sdk_version, so requirements.txt only lists the Gemini client.)
Get a free key at <https://aistudio.google.com/app/apikey>.
Deploy your own (free, ~5 min)
- Create a new Gradio Space at <https://huggingface.co/new-space>.
- Upload
app.py,poet.py,samples.py,requirements.txt, and thisREADME.md. - In the Space's Settings โ Secrets, add
GEMINI_API_KEYwith your free key. - The Space builds and goes live at a public URL. Done.
The key lives as a Space secret โ it is never in the code and never exposed to visitors.
How it works
git diff โ trim/summarize (keeps filenames + key hunks)
โ prompt Gemini for a grounded poem + a Conventional Commit line
โ graceful sample fallback if the model is unavailableFiles:
poet.pyโ diff trimming, prompt, Gemini call, fallback (UI-agnostic core)app.pyโ the Gradio web UIsamples.pyโ example diffs so visitors can try it with one click
