A fast, modern visual diff tool built with Tauri, React, and Monaco Editor. Compare files side-by-side with syntax highlighting and merge changes with ease.
- Side-by-side diff view with Monaco Editor (same editor as VS Code)
- Syntax highlighting for 30+ programming languages
- Navigate between changes with Previous/Next buttons
- AI-powered diff analysis - Get intelligent summaries of your changes using LM Studio
- Keyboard shortcuts for efficient workflow
- Command-line driven - easy to integrate with git or other tools
- Lightweight - Small bundle size (~5-10 MB) thanks to Tauri
This guide assumes you have Homebrew installed. If you don't have Homebrew, install it from brew.sh.
To use the AI diff analysis feature, you'll need:
- LM Studio installed and running (lmstudio.ai)
- LM Studio server enabled on port 1234 (default)
- A model loaded in LM Studio
The AI feature will automatically detect when LM Studio is available and show a status indicator in the navigation bar. When ready, click the AI button to get intelligent summaries of your code changes.
Node.js includes npm (Node Package Manager):
brew install nodeVerify the installation:
node --version
npm --versionRust is required for building the Tauri backend:
brew install rustVerify the installation:
rustc --version
cargo --versionInstall Xcode Command Line Tools (required for building Rust projects):
xcode-select --installClone the repository (if you haven't already) and install npm dependencies:
cd diffuse
npm installThis will install:
- React and React DOM
- Tauri CLI and API
- Monaco Editor
- TypeScript and Vite
- All other project dependencies
Build the application:
npm run tauri buildThis creates a standalone executable in src-tauri/target/release/.
On macOS, you'll also find a .app bundle and .dmg installer in src-tauri/target/release/bundle/.
Run the app in development mode:
npm run tauri dev -- path/to/file1.txt path/to/file2.txtThe app will open with both files loaded in the diff viewer.
# Development
npm run tauri dev -- file1.txt file2.txt
# Production (after building)
./diffuse file1.txt file2.txt| Shortcut | Action |
|---|---|
Alt + ↓ |
Navigate to next diff |
Alt + ↑ |
Navigate to previous diff |
Alt + → |
Copy current diff from left to right |
Alt + ← |
Copy current diff from right to left |
Cmd/Ctrl + S |
Save right file |
Cmd/Ctrl + Shift + S |
Save left file |
- Previous/Next buttons: Jump between diff regions
- Left → Right: Copy the current diff from the left file to the right file
- Left ← Right: Copy the current diff from the right file to the left file
- Save Left/Right: Save changes to the respective file
You can use Diffuse as a git difftool:
git config --global diff.tool diffuse
git config --global difftool.diffuse.cmd 'path/to/diffuse "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
# Then use it:
git difftool file.txtOr as a merge tool:
git config --global merge.tool diffuse
git config --global mergetool.diffuse.cmd 'path/to/diffuse "$LOCAL" "$REMOTE"'
git config --global mergetool.prompt false- Backend: Rust (Tauri) for native file system access
- Frontend: React 19 + TypeScript
- Editor: Monaco Editor (VS Code's editor)
- Build tool: Vite
- Bundle size: ~5-10 MB (vs 150+ MB for Electron)
diffuse/
├── src/ # React frontend
│ ├── components/ # React components
│ │ ├── DiffViewer.tsx # Monaco diff editor wrapper
│ │ └── NavigationBar.tsx # Toolbar with controls
│ ├── hooks/
│ │ └── useDiffNavigation.ts # Navigation logic
│ ├── types/
│ │ └── index.ts # TypeScript definitions
│ └── App.tsx # Main application
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── commands.rs # File I/O commands
│ │ ├── lib.rs # App setup & CLI handling
│ │ └── main.rs # Entry point
│ └── tauri.conf.json # Tauri configuration
└── package.json
The app uses Tauri commands to access the file system:
read_file(path)- Read file contentswrite_file(path, content)- Write file contentsget_absolute_path(path)- Resolve relative pathsget_cli_args()- Get command-line arguments
The app uses Monaco's DiffEditor component with these key features:
getLineChanges()- Get all diff regionsexecuteEdits()- Programmatically edit contentrevealLineInCenter()- Scroll to a specific line
Monaco Editor not loading?
- Run
npm installto ensure @monaco-editor/react is installed - Clear browser cache if running in dev mode
Rust not found?
- Install Rust with Homebrew:
brew install rust - Verify installation:
rustc --version - Restart your terminal after installation if needed
Build fails on macOS?
- Install Xcode Command Line Tools:
xcode-select --install
Build fails on Windows?
- Install Microsoft Visual Studio C++ Build Tools
MIT
Contributions are welcome! Please feel free to submit issues or pull requests.
Built with:
- Tauri - Lightweight desktop app framework
- React - UI framework
- Monaco Editor - VS Code's editor
- Vite - Build tool