Diffdesk

$ diffdesk

Review the PR you are about to open, without opening it.

A native macOS diff viewer for the work still on your machine. Comment on lines like on GitHub, then hand the comments back to whoever writes the code: you, or your agent.

brew install --cask vmaerten/tap/diffdesk

0.7.1 · macOS 13+ · Apple Silicon · Git · MIT

~/dev/api · stack-nav
$ diffdesk comments
1 comment on main...stack-nav

4e23a9bb web/src/stack.ts:11
Return null here, like layerBelow does.

The terminal prints what diffdesk comments would.

// the loop

Review the change before anyone else has to.

  1. 01 · write

    You or your agent change the code. Nothing is committed yet.
  2. 02 · diffdesk

    The branch against its base, working tree included, in one window.
  3. 03 · comment

    Select lines, press c. Fold what you read with v.
  4. 04 · hand back

    ⇧⌘C copies the comments for your agent. Fix, run diffdesk again.

// for agents

Comments an agent can act on.

Each comment gives its ID, its lines and what to change. The agent reads the code in the file it edits, so Diffdesk only quotes the lines the file no longer has: removed by the change, or changed since you wrote the remark.

diffdesk comments resolve <id> closes one once it is done, and --json gives the comments to a script.

$ diffdesk comments
2 comments on main...stack-nav

05de55da go/internal/app/stack.go:8-9
Log why the layer is skipped.

4e23a9bb web/src/stack.ts:11
Return null here, like layerBelow does.

// features

Everything a review needs, nothing it does not.

Unified or split

A file tree in diff order, expandable context, and a search across the whole diff, not just what is on screen.

Stacks and bases

The base comes from your choice, the branch, or its gh stack chain. Step through layers with [ and ].

Comments that last

Stored per branch in the checkout's .git folder. Resolve one when it is done: it leaves the diff and stays on record.

Viewed files

Press v and the file folds away. Change its diff and the tick clears itself.

Code intelligence beta

Hold ⌘ over a symbol for its type and docs, click to go to its definition. Answers come from the language servers on your Mac.

Pull request and checks

The branch's GitHub pull request in the title bar: its state, its checks and what is not pushed yet, through the gh CLI you already use.

Command palette

⌘K finds a command by name, with its shortcut. ⌘P jumps to any file of the review.

Any comparison

Another branch without checking it out, a single commit, with or without untracked files and whitespace.

Light, dark, your theme

Follows macOS, with a syntax theme for each mode and your code font. Image changes get before and after previews.

// usage

One command, a few flags.

diffdesk
The current branch, uncommitted work included.
diffdesk feature
Another revision, without checking it out.
diffdesk --base main
The comparison base. Otherwise gh stack or the trunk.
diffdesk --repo ../other
Another checkout.
diffdesk comments
The comments, compact for an agent.
diffdesk comments resolve <id>
Close a comment once it is done.

// keys

Hands stay on the keyboard.

  • jk next, previous file
  • v toggle Viewed
  • c comment lines
  • bt base, target
  • [] stack layers
  • ⌘K command palette
  • ⌘P go to a file
  • ⌘F search the diff
  • ⌘ click go to definition
  • ⇧⌘C copy comments

Review before you push.

Free and open source under the MIT license. Needs macOS 13 or later on Apple Silicon, and Git.

$ brew install --cask vmaerten/tap/diffdesk$ mise use -g github:vmaerten/ghl@latest