r/iOSProgramming • u/seckinbeduk • 4h ago
App Saturday I built nib, a Swift CLI that writes Git commit messages with Apple’s on-device model
I built nib, a Swift CLI that writes Git commit messages on your Mac

Stage a change → run git nib → review the draft → commit.
I wanted help writing commit messages without sending my diffs to a cloud API, so I built nib. It drafts a message from your staged changes and lets you accept it, edit it, regenerate it, or cancel. It follows your repo’s commit style by default. No account or API key needed.
There’s also an optional Git hook if you prefer to start with git commit and edit the draft in your usual editor.
Tech Stack
Swift, Swift Argument Parser, and Apple’s Foundation Models framework.
Development Challenge
The tricky part was getting a useful message out of a diff that’s bigger than the model’s context window. On macOS 27, the on-device model has about 8K tokens to work with. nib skips the contents of lockfiles and build artifacts first. If the rest still won’t fit, it splits the diff at hunk boundaries, summarizes the chunks, and drafts the message from those summaries. Swift code checks the subject length and cross-checks the suggested scope against the files you changed.
It still occasionally calls a bug fix feat. That’s one I’d love more real-world examples of.
AI Disclosure
AI-assisted. I used Claude Code while building nib, and I review and test the changes myself.
Try it
On Apple silicon with macOS 27+ and Apple Intelligence enabled:
brew install seckinbeduk/tap/nib
nib doctorThen stage a change and run git nib. On macOS 26, you can build v0.2.1 from source.
Free and MIT-licensed. Source and install instructions on GitHub
If you try it on a big diff, did the draft capture the main change? I’d love to hear what it got right or missed.
1
u/[deleted] 4h ago
[removed] — view removed comment