gitr - the Git Randomizer

Why settle for:
fix: typo
When you could inscribe your legacy into the git log like:
“Ye olde letter-polish hath been administered, verily!”
‘Many people are saying this documentation is the best - tremendous words, the best words!’”
Your git log should feel like a cursed scroll -
etched in arcane symbols, whispered about in hushed tones by future interns.
This isn’t just version control.
It’s a ritual, a rebellion, a beautiful mistake waiting to be discovered.
Write weird. Commit louder.
Let the chaos compile.

Ten commits, ten voices, one very confused git blame.
The demos are recorded against a scripted local fake model (demo/) so they come out the same every time. Real output varies by model, and is usually less polite.
🌀 What is this?
gitr rewrites your commit messages and branch names in the voice of whoever (or whatever) you fancy:
Yoda, Michael Jackson, Deadpool, Jim Lahey, Gandalf, Doge, your local weatherman… you name it.
Perfect for side projects, internal tooling, or simply annoying your teammates during code review.
⚠️ SERIOUS WARNING
This tool is satire. If you push these messages to a production repo, your CI may pass -
but HR might not. You’ve been warned.
📜 A real-ish git log, for science
$ git log --oneline
a1b2c3d Committed, this fix is. Broken, the login no longer will be. Hmm.
d4e5f6a The tests were flaky, Randy. Like a shitstorm of crumbs in the CI breeze.
0badc0d You shall not pass... null pointers. Not today. Not in my codebase.
c0ffee1 Such refactor. Very clean. Much fewer if-statements. Wow.
deadbee THEY don't want you to know the cache was stale. I invalidated it ANYWAY.
Five personas, one repo, zero regrets. Your team lead will have questions.
✨ Features
| Area |
What it does |
| Commit messages |
Takes your boring message and runs it through an LLM, rewriting it in the chosen persona, mood, and length. Interactive “Yes / generate another / use my original / cancel” loop. |
| Diff-aware |
By default the persona also peeks at your staged diff (trimmed to diff_max_bytes), so the joke actually matches the code. Too lazy to write a message at all? -m "" and the persona describes the change for you. |
| Branch names |
Describe the idea, gitr returns a short / medium / long kebab-case slug in character and runs git checkout -b for you if you approve. Name already taken? You get a -2. Æ, ø and å are politely transliterated. |
| Bring your own brain |
Google Gemini out of the box, or anything that speaks the OpenAI /v1/chat/completions dialect: OpenAI, OpenRouter, LM Studio, and Ollama for free, fully local chaos. |
| Random everything |
--random, --group cartoons, or config defaults like default_mood: random re-roll persona/mood every generation. |
| Groups |
Built-in sets: supervillains, cartoons, politicians, celebrities, conspiracy_theorists, trailer_park_boys, misc (plus many more, and anything you add in the config). |
| Bring your own cast |
Add your own personas, groups and moods straight from the YAML config. No recompiling, no Go knowledge required. |
| Tagline |
After a successful commit, adds a one-liner in a separate persona (“Yoda says: Committed, your code is”). If the persona is speechless, gitr says so and moves on. |
| Scriptable |
-y skips the prompts, --dry-run prints without touching git, and piped stdin becomes the message. Without a terminal and without -y, gitr refuses before it spends a single token. |
| pass secret |
Reads your API key from pass so you don’t leak it into your shell history. |
| Config + autosave |
First run drops a commented ~/.config/git-randomizer/git-randomizer.yaml (respects $XDG_CONFIG_HOME). Use --save to write the flags you used back as defaults, comments and all. |
| Safety exits |
Press Ctrl-C or select Cancel at any prompt → immediate exit, no commit/branch created, and a non-zero exit code (130 for Ctrl-C, 1 for Cancel), so gitr branch && git push stops right there. Keys mashed while the persona was thinking are thrown away, so a stray Enter can't approve a message you never saw. |
🚀 Quick start
⚠️ Note: gitr needs a brain. That is either a Google Gemini API key, an OpenAI-compatible API key,
or a local model server like Ollama (no key, no bill, no cloud).
🔐 Step 1: Set up your API key
# 1. Get your Gemini API key from Google AI Studio:
https://aistudio.google.com/apikey
# 2. Export it as an environment variable:
export GEMINI_API_KEY=your-api-key
# (Optional) Or store it in pass instead:
pass insert gemini_api_key
# The default config already points pass_secret at "gemini_api_key".
Where the key comes from, first match wins:
--pass-secret some/entry on the command line (if that lookup fails, gitr stops right there)
- the env var named by
api_key_env in the config, or GEMINI_API_KEY / OPENAI_API_KEY by default
pass_secret in the config
The key only ever travels in a request header, never in the URL, and gets scrubbed from error messages.
The default gemini_api_key pass entry is only used with the Gemini provider, so your Gemini key never
wanders off to some other endpoint.
Using Ollama or LM Studio? Skip this step entirely, see Pick your brain.
💾 Step 2: Install gitr
🔧 Option A - 1-liner (recommended)
curl -fsSL https://raw.githubusercontent.com/Andr0id88/git-randomizer/main/install.sh | bash
Downloads the latest release for your OS/arch, verifies its sha256 against checksums.txt,
and installs gitr to ~/.local/bin (it warns you if that is not in your PATH). No sudo unless you ask for it.
Optional knobs:
GITR_VERSION=v2.0.0 # a specific release tag (default: latest)
GITR_INSTALL_DIR=/some/dir # default: $HOME/.local/bin
GITR_USE_SUDO=1 # allow sudo if the install dir is not writable
GITR_DOWNLOAD_BASE=https://… # a mirror for the release assets
# e.g.
curl -fsSL https://raw.githubusercontent.com/Andr0id88/git-randomizer/main/install.sh | GITR_VERSION=v2.0.0 bash
🐹 Option B: go install
go install github.com/Andr0id88/git-randomizer/v2/cmd/gitr@latest
Note the /v2/cmd/gitr at the end. The /v2 is Go being Go about major versions; leave off the /cmd/gitr and you get a binary called git-randomizer, which is a lot to type for a joke.
📦 Option C: Download from the Release Page
# 1. Visit the latest release and download the binary for your OS:
https://github.com/Andr0id88/git-randomizer/releases/latest
# gitr-linux-amd64, gitr-linux-arm64, gitr-darwin-amd64,
# gitr-darwin-arm64, gitr-windows-amd64.exe (+ checksums.txt)
# 2. (Recommended) verify it:
sha256sum --check --ignore-missing checksums.txt
# 3. Rename it, make it executable and move it into your PATH (e.g.):
chmod +x gitr-linux-amd64
mv gitr-linux-amd64 ~/.local/bin/gitr
🛠️ Option D: Build from Source
git clone https://github.com/Andr0id88/git-randomizer.git
cd git-randomizer
make build # -> bin/gitr
make install # -> ~/.local/bin/gitr (override with PREFIX=/usr/local)
No make? go build -o gitr ./cmd/gitr works too.
✅ Step 3: Verify Installation
gitr --version
gitr --help
🧪 Step 4: Try It Out!
cd ~/code/my-project
git add -A
gitr commit -s "Donald Trump"
gitr commit -s yoda -m "fix login bug"
gitr commit -s "jim lahey" --dry-run -m "" # persona reads the diff, nothing is committed
gitr branch -g cartoons add dark mode

Not feeling the first draft? Say no. Yoda has more where that came from.

Branch names nobody will forget, no matter how hard HR tries.
🧠 Pick your brain (LLM providers)
gitr speaks two dialects:
| Provider |
Talks to |
Key needed? |
gemini (default) |
Google Gemini, default model gemini-3.8-flash |
Yes |
openai |
OpenAI, OpenRouter, LM Studio, Ollama, anything with /v1/chat/completions |
Only if the server wants one. You must set a model. |
Free, local, and nobody at Google learns about your branch names: run Ollama,
ollama pull llama3.2, then put this in your config:
provider: openai
model: llama3.2
base_url: http://localhost:11434/v1
Or try it once without touching the config:
gitr commit --provider openai --model llama3.2 --base-url http://localhost:11434/v1 -s gandalf
Reasoning models that like to think out loud? Their <think>…</think> monologue gets stripped before it reaches your history.
Your git log is a stage, not a therapy session.
Plain OpenAI works the same way: provider: openai, model: gpt-4o-mini, leave base_url empty and export OPENAI_API_KEY.
🕵️ Privacy note (read this one, actually)
By default gitr sends your staged diff (trimmed to diff_max_bytes, 8000 by default) to whichever provider
you configured, so the persona can roast the actual change. That means your code leaves your machine,
unless the provider is your machine (hi, Ollama).
Secret sauce, client code, or a .env you staged by accident? Keep it to yourself:
gitr commit --no-diff -m "fix login" # this one time
include_diff: false # forever (privacy mode)
With the diff off, the persona only sees your message. It will still make things up. That is its job.
Upgrading from 1.x? Your old config has no include_diff line, so gitr stays in privacy mode
and tells you so on every commit until you pick a side: add include_diff: true (let it read) or
include_diff: false (hush). Nothing gets sent until you opt in.
💻 CLI cheat-sheet
gitr commit --help # full list
# commit flags
-m, --message your message ("" = let the persona read the diff)
-s, --style persona (string or 'random')
-g, --group pick random persona from group
-r, --random fully random persona (beats config defaults; --style and --group beat it)
-M, --mood playful | sarcastic | ... | random
-l, --length short | medium | long
-y, --yes skip approval step
--dry-run print the message, don't commit
--no-diff don't send the staged diff to the model
-t, --tagline-style persona for the success tagline (or 'random')
-T, --no-tagline no tagline, just the commit
-S, --save write these flags back to YAML defaults (never saves -y)
gitr branch [description...] # same vibe, plus: generates slug & checks out branch
# -s -g -r -M -l -y -S --dry-run (length defaults to branch_length: short)
# global flags (work everywhere)
--provider gemini | openai
--model model id
--base-url API base URL (e.g. http://localhost:11434/v1)
-p, --pass-secret read the API key from this 'pass' entry
--config use another config file
-L / -G list all styles / groups
--list-moods list all moods
# root only
gitr -v, --version who am I (plus commit and build date, when known)
# browsing the cast
gitr list # groups (same as 'gitr list groups')
gitr list personas
gitr list moods
gitr list trailer_park_boys # members of one group
# shell completion
gitr completion bash # or zsh | fish | powershell
⚠️ Upgrading from 1.x? Mood moved from -m to -M, because -m now means message
(like git commit -m, as nature intended). On gitr branch, the old -m fails loudly instead of quietly doing something else.
Pipes work too:
echo "fix the flaky tests" | gitr commit -s "ricky" -y
📝 Configuration file
The first run creates ~/.config/git-randomizer/git-randomizer.yaml
(or $XDG_CONFIG_HOME/git-randomizer/git-randomizer.yaml; use --config to point somewhere else):
# ------------------------------------------------------------
# git-randomizer configuration -- every CLI flag has a YAML twin.
# Anything here is overridden by command-line flags at runtime.
# Set a value to 'random' to enable randomisation.
# 'gitr <command> --save' writes the flags you used back into this file.
# ------------------------------------------------------------
# --- Commit defaults ----------------------------------------
default_character: random # persona, e.g. "yoda" or "donald trump"
default_group: "" # e.g. "cartoons" - random within group
default_mood: playful # 'playful', 'sarcastic', or 'random'
default_length: medium # short | medium | long
confirm: true # true = ask before committing / branching
# --- What the persona gets to read --------------------------
include_diff: true # send the staged diff so the joke matches the code
# (false = privacy mode, persona only sees your message)
diff_max_bytes: 8000 # bigger diffs get a --stat summary plus the first bytes
# --- Brain (LLM provider) -----------------------------------
provider: gemini # gemini | openai (anything that speaks /v1/chat/completions)
model: "" # empty = provider default (gemini: gemini-3.8-flash)
# openai-compatible needs one, e.g. "gpt-4o-mini" or "llama3.2"
base_url: "" # empty = official API. Ollama: http://localhost:11434/v1
# LM Studio: http://localhost:1234/v1, OpenRouter: https://openrouter.ai/api/v1
api_key_env: "" # env var holding the key; empty = GEMINI_API_KEY / OPENAI_API_KEY
# --- API key storage ----------------------------------------
# Where the key comes from, first match wins:
# 1. --pass-secret flag 2. the env var above 3. pass_secret below
# Local servers (Ollama, LM Studio) need no key at all. Lucky them.
pass_secret: "gemini_api_key" # path in 'pass' (https://www.passwordstore.org)
# --- Success tagline ----------------------------------------
tagline_enabled: true
tagline_persona: yoda # persona for the one-liner after commit, or 'random'
# --- Branch-name generator ----------------------------------
branch_persona: random # fixed persona OR 'random'
branch_persona_group: "" # e.g. "trailer_park_boys"
branch_mood: "" # empty = same as default_mood
branch_length: short # short | medium | long
# --- Bring your own cast ------------------------------------
# Merged with the built-ins. Reusing a built-in group name extends it.
custom_groups: {}
# my_buddies:
# - grandma in caps lock
# - steve the intern
# - maria the barista
extra_personas: [] # e.g. ["the build server", "a very tired SRE"]
extra_moods: [] # e.g. ["caffeinated", "post-incident"]
Change a value or set it to random to enable randomness.
Your config is never rewritten behind your back: gitr only writes it on first run and when you pass --save.
🎭 Adding your own personas
No more editing Go and rebuilding. Your cast lives in the config:
- Edit
~/.config/git-randomizer/git-randomizer.yaml
custom_groups:
my_buddies:
- grandma in caps lock
- steve the intern
- maria the barista
cartoons: # reusing a built-in name extends that group
- bluey's dad
extra_personas: # join the random pool without a group
- the build server
- a very tired SRE
extra_moods:
- caffeinated
- post-incident
- Try it
gitr commit -g my_buddies
gitr commit -s "a very tired SRE" -M post-incident
gitr list personas # your new names appear
gitr list groups # group listed too
gitr list my_buddies # and its members
(Personas are just strings. The LLM does the impression; you just name the victim.)
Think a persona deserves to ship to everyone? PRs adding built-ins to
internal/styles/styles.go are very welcome.
🤔 Why does this exist?
Because the world has enough boring commit messages -
and not nearly enough that say things like:
“Screw you guys, I’m rebasing at home.”
- Eric Cartman, 2 seconds before force-pushing to
main
“After three hours of debugging, I realized the bug was me all along.”
- Sir Galahad, softly weeping into main.py
“I am once again asking you to stage your changes before committing.”
- gitr, every time you forget
git add
So really... why?
- Because
git log should read like the diary of a caffeinated raccoon.
- Because you’ve always wanted to
git blame a bug on Alex Jones screaming about interdimensional bugs introduced by globalist devs.
- Because every repo deserves a branch named
feature/screw-you-guys-im-going-home.
- Because you once typed
fix thing and felt a part of you die inside.
- Most importantly, because programming is supposed to be fun.
Yes, you could follow conventional commit standards…
But wouldn’t you rather write something with a little more ✨ chaos?
If your corporate guidelines demand “conventional commits,”
go full goblin in a personal fork, laugh, then cherry-pick a respectable message upstream.
Professional on the outside, feral on the inside.
Use it. Abuse it. Confuse your team.
Fill your repo with mystery, mayhem, and markdown-stained madness.
Because someday, archaeologists will unearth your git history and whisper,
“What the hell were they building?”
And that, my friend, is legacy.
🤝 Contributing (Optional)
Contributions are welcome! If you have ideas for improvements or find a bug, please feel free to:
- Fork the repository.
- Clone your fork to your local machine:
git clone https://github.com/<your-username>/git-randomizer.git
cd git-randomizer
- Create a new feature branch (or let gitr name it):
git checkout -b feature/AmazingFeature
# or: gitr branch -s "jim lahey" amazing feature
- Make your changes, then make sure everything is green:
make test # race-enabled tests (they use fake servers, no API key needed)
make vet
make fmt # gofmt check
make lint # golangci-lint, optional
Touched the output or the prompts? make demo re-records the GIFs in docs/assets/ against a local fake model (needs vhs, see demo/README.md).
5. Commit and push your changes:
git commit -m 'Add some AmazingFeature'
git push origin feature/AmazingFeature
- Open a Pull Request.
📄 License
This project is licensed under the MIT License