Skip to content
frinfo702Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

rexdiff

A diff viewer for coding agents in Rex. Think herdr-reviewr, but for Rex. It runs on macOS and Linux.

It opens next to the agent and shows the changes. You comment on lines and send the comments to the agent.

demo.mp4

Install

With Homebrew:

brew tap frinfo702/rexdiff https://github.com/frinfo702/rexdiff
brew trust frinfo702/rexdiff
brew install --cask rexdiff

With curl:

curl -fsSL https://raw.githubusercontent.com/frinfo702/rexdiff/main/install.sh | sh

The script downloads the release for this system, checks its checksum, and puts the binary in ~/.local/bin, or in REXDIFF_BIN_DIR. It also says how to add the directory to PATH if it is not there.

To update rexdiff, run rexdiff update. It installs the latest release the way you installed rexdiff: with Homebrew, go install, or a download like the curl script.

With Go:

go install github.com/frinfo702/rexdiff/cmd/rexdiff@latest

Add rexdiff to Rex:

rexdiff install

This adds the "Toggle rexdiff" action and binds it to Shift+Cmd+R. To remove them, run rexdiff uninstall. The install command needs the rex command; it says so when Rex is not installed. The viewer itself runs without Rex.

Use

  • Open: press Shift+Cmd+R next to an agent, or run "Toggle rexdiff" from the command palette. Press it again to close rexdiff.
  • Comment: move to a line and press c. For a range, press v or drag over the line numbers.
  • Copy: drag over the code to select it, or double-click a word. Release copies the selection, and y copies it again. esc clears it. It works in each tab.
  • Send: press s. rexdiff pastes the comments into the agent's input. It does not press Enter.
  • Update: when rexdiff shows a new version at the bottom, press U. Your comments stay.

When the agent edits a file, the comments move with their lines. If the lines are gone, rexdiff marks the comment as stale.

Key Action
u b t uncommitted, branch, or last-turn changes
] [ next or previous change
+ - more or fewer unchanged lines around each change (or click ↕)
f F next or previous file
/ find in the file, or by name when the file list has the focus (n N step)
ctrl+p search all files and code
c comment
s send the comments to the agent
y copy the selected text, or the comments
| side by side or top to bottom
1 … 5 overview, guide, diff, all files, or pull request
r in the guide: write it again
a in the guide: pick the agent that writes it
? all keys

Tabs

  • Overview: the branch and its base, commits ahead and behind, the state against the upstream, and the size of the changes. It reads git only, so it works with no forge and no login.
  • Guide: the changes in the order of their meaning, as on pulls.review. An agent groups the files into sections with a title and a summary; the diff of each file shows beside its section. rexdiff runs the first of claude, pi, codex, opencode, cursor-agent, and agy that is installed, or guide_agent. Press a to pick another agent; in a terminal with the kitty graphics protocol (Rex, Ghostty, kitty), the list shows their logos. opencode, cursor-agent, and agy take the diff as one argument, so a diff over about 1 MB (128 KB on Linux) turns them off. It keeps each guide, so the agent writes it once. Press r to write it again.
  • Diff: the changes, one file at a time. A wide pane shows them side by side; a narrow one, top to bottom. Binary files are not diffed.

Configure

Edit the settings at the top of ~/.config/rex/rexdiff.lua:

local settings = {
  key = "shift+cmd+r",   -- toggle key, or false for none
  placement = "split",   -- split, zoomed, tab, or overlay
  layout = "split",      -- split (the default) or unified
  editor = "code -g {file}:{line}",
  keybindings = { send = { "S" } },
}

Other settings:

  • default_scope
  • markdown_view
  • file_list
  • file_list_width
  • guide_agent: the agent that writes the guide: claude, pi, codex, opencode, cursor-agent, or agy, or a command that reads the prompt on its standard input, for example "claude -p --model sonnet"
  • diff_signs: true marks changed lines with + and -, in place of a coloured bar
  • cursor_line: false turns off the tint of the line at the cursor
  • renderer: "kitty" draws the screen as pictures with the kitty graphics protocol, which Rex supports. A line changes at once, so the screen does not flicker, and box lines join with no gap. The keys and the mouse work the same. The default is "text"
  • review_prefix
  • url_opener
  • focus_agent_after_send
  • github_host
  • gitlab_host
  • azure_devops_host

See herdr-reviewr for the values and the action names.

e opens the file at the cursor line in editor, else in $VISUAL, $EDITOR, or git's core.editor. A terminal editor, such as nvim, micro, or fresh, opens in a new pane beside rexdiff. A window editor, such as code, opens in its window.

After a change:

  • Run rex config reload.
  • Do not edit the line -- rexdiff code below or the code under it.

Requirements

  • Rex for the action in Rex. Rex runs on macOS; the viewer also runs on its own, on macOS and Linux.
  • git
  • gh, glab, or az for the pull request tab. You must be logged in.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages