differ

February 24, 2026 · View on GitHub

Terminal UI git diff viewer built with Go and Bubble Tea. Two-panel layout: file list + syntax-highlighted diff preview.

differ preview

Install

brew install jansmrcka/tap/differ

Or via Go:

go install github.com/jansmrcka/differ@latest

Or build from source:

make build    # → bin/differ
make install  # → $GOPATH/bin/differ

Usage

differ            # all changes (staged + unstaged + untracked)
differ -s         # staged only
differ -r main    # compare against ref
differ -c         # open in commit mode
differ log        # browse recent commits
differ commit     # review staged + commit

Keyboard Shortcuts

File List

KeyAction
j/knavigate files
enter / lview diff
tabstage/unstage file
astage all
ccommit (AI-generated message via claude)
bopen branch picker
vtoggle split (side-by-side) diff
eopen in editor ($EDITOR, configurable)
Ppush (auto --set-upstream if needed)
Fpull (fast-forward only)
g/Gfirst/last file
qquit

Diff View

KeyAction
j/kscroll
d/uhalf page down/up
g/Gtop/bottom
n/pnext/prev file
tabstage/unstage
bopen branch picker
vtoggle split diff
eopen in editor
esc / hback to file list

Commit Mode

KeyAction
enterconfirm commit
esccancel

Branch Picker

KeyAction
typefilter branches
↑/↓ / ^j/^knavigate
enterswitch branch
ctrl+ncreate new branch
escclear filter / close

AI Commit Messages

When pressing c, differ uses claude -p (Claude CLI) to generate a commit message from the staged diff. The message is pre-filled in the input — edit or confirm with Enter.

Requires Claude CLI installed. Falls back to empty input if unavailable.

Themes

differ --theme dark   # default
differ --theme light

Config file: ~/.config/differ/config.json

{
  "theme": "dark",
  "commit_msg_cmd": "claude -p",
  "commit_msg_prompt": "Write a concise git commit message for this diff:",
  "editor_cmd": "tmux new-window -c {repo} nvim {file}",
  "split_diff": false
}

editor_cmd supports {file} (absolute path) and {repo} (repo root) placeholders. Defaults to $EDITOR {file} (falls back to vi).

Tips

Tmux floating window

Bind differ to a key in tmux for quick access as a popup overlay:

bind g display-popup -E -w 90% -h 90% "cd #{pane_current_path} && differ"

Press prefix + g to open differ in a floating window over your current session. It closes automatically on quit.

Features

  • Syntax highlighting via Chroma (Go, JS/TS, Python, Rust, CSS, HTML, JSON, YAML, Markdown, ...)
  • Staged/unstaged/untracked file indicators
  • Stage/unstage individual files or all at once
  • Split (side-by-side) diff view
  • Branch picker with type-to-filter and branch creation (ctrl+n)
  • Push with auto --set-upstream for new branches
  • Pull with upstream ahead/behind tracking
  • Per-file added/deleted line counts in file list
  • Configurable editor command (editor_cmd)
  • Commit flow with AI-generated messages
  • Commit log browser with diff preview
  • Compare against any branch/tag/commit ref
  • Auto-refresh (2s polling)
  • Single binary, no runtime dependencies