Oh, mama.
Stage just the
pretty hunks.
git add -p is an interactive
TUI. An agent, a script, a CI job — none of them can drive it. The one git operation a non-interactive
caller can't do is the exact one you need.
hunky stages just the hunks — or the lines — you point at. No TUI. No hands.
No hands.
No keyboard.
No party.
You reach for git add -p like a
civilized creature and… it's a captive TUI. You can't pipe it. You can't script it. Sure is annoying.
If only some good-lookin' tool could stage just the hunks you point at, no TUI required.
Those are some pretty hunks.
hunky parses the diff, rebuilds a clean patch from the hunks — or the individual lines —
you select, and pipes it to git apply --cached. Single-file Go, zero dependencies.
-
--list / by number
Stage hunks by their numbers. List once, stage 1 3 5, then 2 4.
-
--pick-lines A-B
Split a single hunk — stage only the +/- lines in a range.
-
--dry-run
Preview the exact patch before it touches the index.
-
--stdin
Feed it a diff from anywhere. Built for programmatic use.
BOY, that only took go install.
It's real, it's free, it's MIT. The whole product is one Go file and a README written by a man who is very pretty.
go install github.com/whiskeytuesday/hunky@latesthunky --list f.go # 1. see numbered hunks
hunky --dry-run f.go 4 # 2. PREVIEW the exact patch (don't skip this)
hunky f.go 4 # 3. stage just those hunks
git diff --cached --stat # 4. confirm what landed
git commit -m "..." # 5. the leftover hunks are the next commitBrawny Johvo
A Legally Distinct Non-Infringing™ original character. Spends his days admiring his
reflection in a freshly-applied --cached patch. Cannot use a TUI (no patience), which is how this whole tool got started.
He has, regrettably, also founded a startup. You should hear about Hunky Cloud .
Why install a tool…
…when you could pay for it forever?
Introducing Hunky Cloud: the exact same tool, now shipped to a server and billed monthly, with a free unsolicited code review from a model named Brawny. It works. It's worse. We know you've got room in the budget.
See the pricing (oh no)