A drop in replacement for meld with monaco diff. A lightweight Electron based app for fast diffing 2 files.
- Hopefully lightweight, so fast start
- Arrow based navigation
- ⌥ Alt + ⬆︎: Navigate to previous change
- ⌥ Alt + ⬇︎: Navigate to next change
- ⌥ Alt + ⬅︎: Accept current change from right to left
- Editor switching
- Ctrl + ⬆︎: Switch to previous editor
- Ctrl + ⬇︎: Switch to next editor
- Syntax highlighting with Monaco
# Install electron globally first (required)
npm install -g electron
# Install dependencies and install globally
npm install
npm run install-global
Basic file comparison:
monacomeld file1.js file2.js
Compare file with stdin content:
echo "modified content" | ./monacomeld file1.js -
Compare with multiline content:
monacomeld file1.js - <<'EOF'
new content here
with multiple lines
EOF
In web mode, you can also send diffs via HTTP:
curl -X POST http://localhost:3000/diff \
-H "Content-Type: application/json" \
-d '{
"leftPath": "examples/file1.js",
"rightPath": "examples/file2.js"
}'
Or with direct content:
curl -X POST http://localhost:3000/diff \
-H "Content-Type: application/json" \
-d '{
"leftContent": "original content",
"rightContent": "modified content",
"leftPath": "file1.js",
"rightPath": "file2.js"
}'
To only start the UI in case you would want to connect to a remote server:
monacomeld --no-server
Some might need to run .appImages on Ubuntu 24.04:
sudo apt install libfuse2
git clone https://github.com/SixZero/monaco-meld cd monaco-meld npm install npm run build npm install -g .
npm install
npm run build
Some might need to run .appImages on Ubuntu 24.04.
sudo apt install libfuse2
As mentioned in the reference documentation, the problem is that Ubuntu 24.04 implemented new restrictions for AppImage apps, which restricts the use of sandboxes.
If you encounter sandbox-related errors like:
FATAL:setuid_sandbox_host.cc(163)] The SUID sandbox helper binary was found...
You can either:
- Run with the --no-sandbox flag (less secure but works everywhere):
monacomeld --no-sandbox
- Or properly configure the sandbox (recommended for production):
sudo sysctl -w kernel.unprivileged_userns_clone=1
- You might see a harmless warning about
mime.cache
in the console. This is a known Electron/Chromium issue on some Linux systems and doesn't affect functionality.
- Start the app in web mode on the remote server:
monacomeld --web
- Set up SSH port forwarding from your local machine:
ssh -L 3000:localhost:3000 user@remote-host
- Open in your local browser:
http://localhost:3000
You can specify a different port with the PORT environment variable:
PORT=8080 monacomeld --web