Skip to content
matheusfillipePublic

About

Terminal code review with vi-like bindings. Live diffs, comments the agent answers, PR review, MCP built in.

Topics

Resources

Contributing

Stars

11 stars

Watchers

0 watching

Forks

Latest commit

 

History

634 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diffler

magit, without Emacs.

crates.io npm IRC

diffler: reviewing an agent's edits as it makes them, a walkthrough of the change, and a pull request review

I like magit a lot, and I wanted it as its own program. That's diffler: one binary with Doom Emacs keys for staging, committing, branching and reading diffs. You can review pull requests from GitHub, GitLab or Forgejo without checking them out. And if you work with a coding agent like Claude Code, it can read the comments you leave in the diff and reply right there, while you watch it fix the code.

Features

  • Stage, commit, branch, push and pull with magit's keys
  • Comment on lines and ranges, mark files as viewed
  • Review pull requests without checking them out
  • Let your agent answer your comments and walk you through its changes (optional)
  • Open several projects as tabs; your agent sees all of them through one connection
  • Open, create and remove git worktrees (jj workspaces), each as its own tab
  • Works in git and jj repos
  • Shows changed images in the terminal, before and after

Install

cargo install diffler
Prebuilt binary

No compiling, and no Rust toolchain needed.

cargo binstall diffler

Or download it straight from the releases page: macOS, Linux and Windows, x86_64 and arm64. Any GitHub-release installer (eget, ubi, ...) works against it too.

Homebrew

macOS and Linux. The tap is this repository.

brew tap matheusfillipe/diffler https://github.com/matheusfillipe/diffler
brew install diffler
Scoop

Windows. The bucket is this repository.

scoop bucket add diffler https://github.com/matheusfillipe/diffler
scoop install diffler
Arch

diffler-bin on the AUR ships the prebuilt binary, so it installs without building.

yay -S diffler-bin
Nix

The flake serves the prebuilt binary. nix run tries it without installing anything, nix profile install keeps it.

nix run github:matheusfillipe/diffler
nix profile install github:matheusfillipe/diffler
npm

A wrapper that fetches the prebuilt binary. The package name is scoped, the command it installs is plain diffler.

npx @mattfillipe/diffler
npm install -g @mattfillipe/diffler

Quick start

diffler                 # open the status screen in the current repo
diffler path/to/repo    # or in another one

Inside diffler, <cr> opens a file's diff, s stages, cc commits, and c comments a line. For pull requests, b p lists the open ones and <cr> opens one's page: its description and conversation, where c comments on the pull request as a whole and R requests a reviewer. <cr> again reviews its diff, and S submits your line comments as a single review. b P opens a new pull request from the current branch.

With a coding agent

Connect your agent once:

Claude Code
claude mcp add diffler -- npx -y diffler-mcp
# or, as a plugin (MCP server plus the /df, /dfa and /dfr commands):
claude plugin marketplace add matheusfillipe/diffler && claude plugin install diffler@diffler
# or, over HTTP, reaching the first diffler you started (it takes port 8417):
claude mcp add --transport http diffler http://127.0.0.1:8417/mcp

Once connected, the server's prompts show up as /diffler:review, /diffler:walkthrough and /diffler:critique. The plugin adds /df, to answer your comments, /dfa, to walk you through a change, and /dfr, to review a change and leave comments.

opencode

Add the server to opencode.json in the project, or globally in ~/.config/opencode/opencode.json:

{
  "mcp": {
    "diffler": {
      "type": "local",
      "command": ["npx", "-y", "diffler-mcp"],
      "enabled": true
    }
  }
}

And install the /df, /dfa and /dfr commands (opencode has no package mechanism for commands, so this fetches the ones maintained in this repo):

mkdir -p ~/.config/opencode/commands
for c in df dfa dfr; do curl -fsSLo ~/.config/opencode/commands/$c.md \
  https://raw.githubusercontent.com/matheusfillipe/diffler/main/.opencode/commands/$c.md; done
Any other MCP agent

Run npx -y diffler-mcp as a stdio server. It finds the port of the diffler running in your repo, since each diffler writes its own to .diffler/mcp.json. Or point it at http://127.0.0.1:8417/mcp (streamable HTTP), the port the first diffler you started takes. The server also ships review, walkthrough and critique prompts that prompt-aware clients surface as commands.

Comment on the agent's changes and press Z to send them. The agent answers in the thread and you resolve it once you're happy. Ask it for a walkthrough of its change and open it from the status screen. More in docs/walkthroughs.md, and the MCP tools are listed in docs/mcp.md. Don't need it? Set enabled = false under [mcp] in the config, or run diffler --no-mcp.

How it compares

diffler tuicr lazygit magit
Standalone binary ✅ ✅ ✅ ❌
Stage and commit ✅ ❌ ✅ ✅
Line comments ✅ ✅ ❌ ❌
PR review ✅¹ ✅² ❌ ❌
Agent replies in the thread ✅ ❌³ ❌ ❌
Agent walkthroughs ✅ ❌ ❌ ❌
jj ✅ ✅ ❌ ❌

¹ GitHub, GitLab and Forgejo.
² GitHub, GitLab, Gitea, Bitbucket, Azure DevOps and Gerrit.
³ tuicr exports your comments as markdown for you to paste into the agent.

Keys

Vim motions everywhere (j/k, gg/G, /, <c-d>/<c-u>). ? shows the full keymap of the screen you're on, and <c-k> fuzzy-finds any action.

Key Action
<cr> open what's under the cursor
s / u stage / unstage
cc commit
c comment on the line (V selects a range first)
Z send comments to the agent
m mark the file viewed
t change how the file list is grouped
| switch between unified and side-by-side diff
] / [ next / previous hunk
za / tab fold or unfold a hunk, or a thread's earlier replies
* / # find references to a symbol on the line; 1-9 or */# again picks which one
d on the status screen, review against another branch or commit
C open the comments list
S submit PR comments as one review
R on a pull request, request a reviewer
gf open any file in the repo
gl set the language a file highlights as, for now or saved to the project
alt-n open another project as a tab
alt-h / alt-l previous / next project tab (alt-1-alt-9 jumps to one)
alt-w close this project tab
w on the status screen, open, create or remove a worktree; on a pull request, check it out in its own worktree
y / Y copy the selection or this file's comments / every comment, as an agent prompt
gy / gx copy / open the forge link to the line
B blame: see who last changed each line
{ / } in the file view, step to the file's older / newer version (H lists them)
c in the file view, comment on the line or the V selection, even code the diff leaves out; on an older version the comment joins that commit's review
e open the file in your editor
q back / quit

Every binding is remappable in docs/config.example.toml. The mouse works, over tmux too: click to select or fold, and right-click (or press and hold) a line, file or comment for what you can do with it.

Configuration

Layered TOML: defaults, then ~/.config/diffler/config.toml, then <repo>/.diffler/config.toml, then CLI flags. Every option is documented in docs/config.example.toml. See the merged result and where each value came from:

diffler config --dump

Themes

Switch live with T, or set ui.theme. See every theme in the gallery. Add your own as a TOML file in ~/.config/diffler/themes/: docs/themes lists every key.

the review screen in catppuccin-mocha: the file tree, a diff carrying a comment thread with the agent's reply, and the comments sidebar

Development

just ci     # fmt + clippy + tests
just e2e    # PTY end-to-end suite (needs uv)

Requires Rust 1.90+, just, cargo-nextest. Hooks: prek install.

License

MIT or Apache-2.0, at your option.

About

Terminal code review with vi-like bindings. Live diffs, comments the agent answers, PR review, MCP built in.

Topics

Resources

Contributing

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages