MCPcopy Index your code
hub / github.com/JanSmrcka/differ

github.com/JanSmrcka/differ @v1.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.0 ↗ · + Follow
326 symbols 1,090 edges 17 files 95 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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)
b open branch picker
v toggle split (side-by-side) diff
e open in editor ($EDITOR, configurable)
P push (auto --set-upstream if needed)
F pull (fast-forward only)
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
b open branch picker
v toggle split diff
e open in editor
esc / h back to file list

Commit Mode

Key Action
enter confirm commit
esc cancel

Branch Picker

Key Action
type filter branches
↑/↓ / ^j/^k navigate
enter switch branch
ctrl+n create new branch
esc clear 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

Core symbols most depended-on inside this repo

run
called by 25
internal/git/repo.go
Dir
called by 18
internal/git/repo.go
updateBranchMode
called by 17
internal/ui/model.go
ChangedFiles
called by 13
internal/git/repo.go
loadDiffCmd
called by 9
internal/ui/model.go
ParseDiff
called by 9
internal/ui/diff.go
renderCard
called by 8
internal/ui/model.go
PairLines
called by 8
internal/ui/diff.go

Shape

Function 201
Method 92
Struct 28
TypeAlias 5

Languages

Go100%

Modules by API surface

internal/ui/model.go77 symbols
internal/ui/model_test.go53 symbols
internal/git/repo.go41 symbols
internal/git/repo_test.go39 symbols
internal/ui/diff_test.go28 symbols
internal/ui/diff.go19 symbols
internal/theme/theme_test.go18 symbols
internal/ui/log.go17 symbols
internal/config/config.go7 symbols
cmd/root.go7 symbols
internal/config/config_test.go5 symbols
internal/ui/highlight_test.go4 symbols

For agents

$ claude mcp add differ \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact