differ

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 1 Imported by: 0

README

differ

Terminal UI git diff viewer built with Go and Bubble Tea. Two-panel layout: file list + syntax-highlighted diff 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
Key Action
j/k navigate files
enter / l view diff
tab stage/unstage file
a stage all
c commit (AI-generated message via claude)
e open in editor (nvim via tmux)
g/G first/last file
q quit
Diff View
Key Action
j/k scroll
d/u half page down/up
g/G top/bottom
n/p next/prev file
tab stage/unstage
e open in editor
esc / h back to file list
Commit Mode
Key Action
enter confirm commit
esc cancel

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:"
}

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
  • Commit flow with AI-generated messages
  • Commit log browser with diff preview
  • Compare against any branch/tag/commit ref
  • Single binary, no runtime dependencies

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
git
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL