https://github.com/mblode/diffhub
Local git diff viewer
https://github.com/mblode/diffhub
Last synced: 13 days ago
JSON representation
Local git diff viewer
- Host: GitHub
- URL: https://github.com/mblode/diffhub
- Owner: mblode
- Created: 2026-04-12T08:15:05.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-29T23:30:15.000Z (15 days ago)
- Last Synced: 2026-05-30T00:16:08.038Z (15 days ago)
- Language: TypeScript
- Homepage: https://diffhub.blode.co
- Size: 3.04 MB
- Stars: 7
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# DiffHub
[](https://www.npmjs.com/package/diffhub)
[](https://nodejs.org)
Local diff viewer for cmux.
DiffHub opens your branch in a browser split so you can review it locally. By default it compares against the detected base branch, usually `origin/main`.

## Quick start
### cmux
```bash
npx diffhub@latest cmux
```
Run that inside any git repository. DiffHub starts the local viewer and opens it in a cmux browser split.
cmux mode currently expects `cmux.app` on macOS at `/Applications/cmux.app`.
### Normal browser window
```bash
npx diffhub@latest
```
Use that if you want the same viewer in your default browser instead.
### Global install
```bash
npm install -g diffhub
```
## What it does
- Opens in a cmux browser split
- Shows your branch against the merge-base
- Supports split and unified views
- Lets you add notes and open files in your editor
## Usage
Run inside any git repository.
```bash
# Open in cmux
diffhub cmux
# Open in a normal browser window
diffhub
```
```bash
# Use a different base branch
diffhub cmux --base develop
# Point at a repo in another directory
diffhub cmux --repo ~/projects/my-app
# Use a different port in browser mode
diffhub --port 3000
# Don't open the browser automatically
diffhub --no-open
```
### Commands
| Command | Description |
| --------------- | ------------------------------------------- |
| `diffhub` | Open DiffHub in your default browser |
| `diffhub cmux` | Open DiffHub in a cmux browser split |
| `diffhub serve` | Same as `diffhub`, starts the local web app |
### `diffhub` / `diffhub serve` options
| Flag | Default | Description |
| --------------------- | ------- | --------------------------- |
| `-p, --port ` | `2047` | Port to serve on |
| `-r, --repo ` | `cwd` | Path to the git repository |
| `-b, --base ` | auto | Base branch to diff against |
| `--no-open` | — | Skip automatic browser open |
### `diffhub cmux` options
| Flag | Default | Description |
| --------------------- | ------- | --------------------------- |
| `-r, --repo ` | `cwd` | Path to the git repository |
| `-b, --base ` | auto | Base branch to diff against |
## Keyboard shortcuts
| Key | Action |
| --------- | --------------------------- |
| `j` / `k` | Next / previous file |
| `s` | Toggle split / unified view |
| `/` | Focus file filter |
| `r` | Refresh diff |
## Requirements
- Node.js 20.11+
- A git repository with at least one commit on your current branch
- For `cmux` mode, `cmux.app` installed on macOS
## License
MIT