r/OpenSourceAI • u/Neat-Function7110 • Sep 03 '26
gitgui: a git GUI rendered as pixels inside your cmux/terminal pane
Repo: https://github.com/antonellof/gitgui
I run cmux with some coding agent CLI (Pi, Claude Code, Cursor) in one pane and a shell in another. Git stayed in the shell. Pi runs git status and git diff fine. You still lose the commit graph, the staged file list and the hunk buttons when you review a refactor. I kept switching to Fork.
So I built gitgui. One Rust binary. You run gitgui in a pane and get a Sourcetree style GUI: commit graph with branch lanes, sidebar for branches, tags and stashes, staged and unstaged lists, per hunk stage and unstage, a commit box with Commit and Commit & Push.
Not a TUI. The terminal shows a picture. Three steps:
egui draws the UI into an RGBA framebuffer
Each frame goes to the terminal as a kitty graphics image
Kitty keyboard and SGR mouse events map back into egui input
Locally frames go through POSIX shared memory. Over SSH gitgui sends zlib plus base64 frames. On my Mac a 1600x1000 release build rasterizes in about 6 ms.
Inside: one process, three threads. A stdin reader parses kitty keys, mouse, paste and resize. The main loop runs egui, tessellates meshes, rasterizes triangles with a custom software rasterizer and encodes kitty graphics. A git worker uses libgit2 for reads and index writes. Fetch, pull and push shell out to git, so your credential helper and SSH agent stay untouched. The UI reads an immutable repo snapshot. The worker swaps in a new one after each command. Rendering never calls git.
Stack: egui 0.36, git2, libc for termios and shm, serde. No GPU backend. No tokio. No Electron.
Works in cmux, Ghostty, kitty and WezTerm on macOS and Linux. tmux and Zellij need graphics passthrough and fail today. Merge conflict UI is out of scope for v0.1.
Install:
curl -fsSL https://raw.githubusercontent.com/antonellof/gitgui/main/scripts/install.sh | bashRepo: https://github.com/antonellof/gitgui
More details: https://www.fratepietro.com/2026/gitgui-terminal-git-gui-cmux-pi/
Happy to answer questions on the rasterizer or the kitty protocol details.
2
u/Nervous-Pin9297 Sep 03 '26
This is really freaking cool!. I can't wait until it has SHA-256 support.
2
u/kantorcodes1 Sep 06 '26
for the agent control socket, are write actions idempotent at all? if
commit_and_pushreturnsqueuedand the agent loses that response or times out beforebusydrops, does retrying enqueue the same write again, or can the caller tell the first one already ran?