diffmark is a terminal UI for reviewing uncommitted Git changes and turning selected diff lines into inline comments you can paste into a command-line AI agent.
It watches staged and unstaged tracked changes, and shows untracked files by default.
Repository: https://github.com/su27/diffmark
Prebuilt installers are available from GitHub Releases.
Linux/macOS:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/su27/diffmark/releases/latest/download/diffmark-installer.sh | shWindows PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://github.com/su27/diffmark/releases/latest/download/diffmark-installer.ps1 | iex"Rust users can also build from crates.io:
cargo install diffmarkBuilding from source requires Rust 1.88 or newer.
For local development:
cargo install --path .
cargo run --release -- --context 5 --refresh 1.0 --max-copy-lines 11diffmarkCommon options:
diffmark --context 5
diffmark --refresh 1.0
diffmark --max-copy-lines 11
diffmark --no-untracked
diffmark --max-untracked-bytes 1048576
diffmark -- src/app.rs README.mdNotes:
- Untracked files are shown by default; use
--no-untrackedto hide them. - Untracked files larger than 1 MiB are skipped by default; use
--max-untracked-bytesto change the limit. - Path arguments after
--limit the diff to those files or directories.
j/k: move the selection; in visual mode, extend the selected rangeV: enter or leave visual-line modeEnter: comment on the selected line/range, or edit the selected comment rowf/b: page forward/backwardg/G: jump to top/bottomr: refresh nowEsc: leave visual mode or cancel comment editingq: quit
Mouse controls:
- Wheel: scroll
- Click a diff line: comment on that line
- Drag across diff lines: select a range, then comment on it
- Click a comment row, then press
Enter: edit that comment
The editor appears inline under the selected diff line or block.
Enter: submit the comment, copy the payload, and show the inline commentCtrl-J: insert a new lineEsc: cancel- Arrow keys, Backspace, Delete, Home, End: edit text
When a comment is submitted, diffmark copies a review payload using the first available method:
- WSL/Windows clipboard:
clip.exeorpowershell.exe - Linux/macOS tools:
wl-copy,xclip,xsel,pbcopy, ortermux-clipboard-set - OSC52 terminal clipboard escape sequence, including tmux passthrough
- Fallback file:
/tmp/diffmark-last-comment.txt
Use --no-osc52 to disable the OSC52 fallback.
The copied text includes:
- file path and target line number or line range
- your comment
- a compact diff snippet around the selected line/range
>> target:for single-line selections>> target start/>> target endfor multi-line selections>> comment:immediately after the selected line/block
diffmark does not send data over the network. It only runs git, reads local files when rendering untracked changes, and calls local clipboard tools.
cargo fmt --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --locked
cargo package --locked