Dev In The Mountain Header
A Developer In The mountains having fun

katCompare

โ† The kat Suite ยท GitHub ยท Download

Compare files, directories and git refs, then merge just the changes you want.

katCompare is a fast, color-coded diff and merge tool written in Go. It ships two ways from one engine: a native desktop app (Wails) and a keyboard-driven terminal UI (Bubble Tea). I also wrote it to be easier for red/green color-blind people to use, because I'm tired of every diff tool defaulting to red and green. Here additions are blue.

katCompare desktop GUI comparing a config file between HEAD and origin/main in unified view

Features

  • ๐ŸŽจ Readable diffs: blue for additions, red for deletions, with old/new line numbers and live +added / -deleted counts
  • ๐Ÿ‘ฅ Unified or side-by-side views, switchable instantly while staying on the same line
  • ๐ŸŒฑ Git-aware: diff any ref against another ref or against your working tree
  • ๐Ÿ“ Whole-directory comparison: recursively finds every text file on both sides and marks identical (โœ“), different (โœ—) and one-side-only files
  • ๐Ÿ”€ Cherry-pick merging: tick individual lines or whole blocks and save them over the target file (the old version is kept as .orig), and each save is checked afterwards
  • โš”๏ธ Git conflict resolver: step through each conflict, take ours, theirs or both, then save and git add
  • ๐Ÿ“‹ Directory sync: copy files that exist on only one side into the other, either direction
  • โœ๏ธ Hand off to your own tools: open a file in your editor at the line you're looking at, send the pair to your external diff tool (meld, kdiff3, VS Code, nvimdiffโ€ฆ), or run git mergetool. That makes it easy to use katCompare as just a diff viewer if you want
  • ๐Ÿ”Ž Filtering and path autocomplete
  • โš™๏ธ Ignore rules for folders like node_modules, and options to ignore line endings or whitespace
  • ๐Ÿ” 60+ text file types recognized, plus anything else that looks like text

Terminal UI

bash
katcmp                          # interactive path entry
katcmp old.yaml new.yaml        # two files
katcmp ./project-v1 ./project-v2   # two directories
katcmp --git HEAD~1             # a git ref vs the working tree
katcmp --git main feature-branch   # two refs

The file list sits beside the diff, and the diff follows the selection, so you can move through a folder and read each change without switching screens:

 katCompare  project-v1 โ†” project-v2                      5 files ยท 2 differ
โ•ญโ”€ Files 1/5 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎโ•ญโ”€ long.txt ยท Unified ยท +1 -1 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ–ถ โœ— long.txt             โ”‚โ”‚    19   line number 19                       โ”‚
โ”‚   โ—„ onlyleft.txt    left โ”‚โ”‚โ–ถ   20 - line number 20                       โ”‚
โ”‚   โ–บ onlyright.txt  right โ”‚โ”‚    20 + LINE NUMBER 20 changed               โ”‚
โ”‚   โœ“ same.txt             โ”‚โ”‚    21   line number 21                       โ”‚
โ”‚   โ—† uni.txt         safe โ”‚โ”‚    22   line number 22                       โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
 j/k move  Enter open diff  m merge  / filter  c copy  r reload  ? help

Main keys

KeyAction
j / kmove
] / [next / previous change
sunified โ‡„ side-by-side
n / pnext / previous file
mmerge (or resolve a git conflict)
ccopy one-side-only files
e / Eedit right / left file at the cursor line
Dopen in your external diff tool
Rresolve with git mergetool
xswap left and right
/filter the file list
F2 / Ctrl+Gcompare git refs
?help

Desktop app

katcmp-gui has the same engine behind a point-and-click interface: a Files / Directories tab and a Git tab, unified and side-by-side views, a Merge view where you tick changes per line or per block, a Conflicts view with Ours / Theirs / Both cards, native file pickers, and path autocomplete. You can collapse the file list and paths bar or press Focus to give the diff the whole window. Fonts and sizes are configurable, and Ctrl+= / Ctrl+- zoom.

Settings

toml
[compare]
ignore = ["node_modules", "dist", "*.log"]
show_hidden = false
hide_identical = false
ignore_line_endings = false
ignore_whitespace = "none"     # none | trailing | all

[view]
default_view = "unified"       # or "sidebyside"

[tools]
editor = ""                    # ahead of $KATCMP_EDITOR, $VISUAL and $EDITOR

Diff and merge tools come from your git config (diff.tool, merge.tool, diff.guitool), so you set them once. The TUI prefers terminal tools and the GUI prefers GUI tools.

Install

  • Windows: download the installer. It installs per user, no admin needed
  • Linux / macOS: the Linux GUI and the TUI for Linux, macOS and Windows are on the releases page
  • From source, with Go, go-task, Node and the Wails v3 CLI:
bash
git clone https://github.com/devinthemtn/katCompare.git
cd katCompare
task install       # installs katcmp (TUI) and katcmp-gui (GUI)

Under WSL, task install also installs the Windows builds and a katcmp-win wrapper. Use katcmp-win --wait when another program (like git difftool or katbackup) uses it as its diff tool.

More places to find me
Mental Health
follow me on Mastodon