@baggiiiie/yadiff
v0.0.2
Published
Yet another diff viewer — browser UI for local git/jj diffs and public GitHub pull requests.
Maintainers
Readme
yadiff, yet another diff viewer
Huge shoutout to pierrecomputer. Inspired by diffshub, this tool is only possible thanks to the incredibly beautiful and high-performance diff and tree packages. All credit goes to the team!
A browser diff viewer for local git/jj diffs and GitHub PRs. It uses pierrecomputer's open-source packages:
@pierre/diffsfor parsing/rendering diffs@pierre/treesfor the file tree
Usage
Run directly with npx:
npx yadiff <git-ref-or-range>/<jj-revset>/<github-pr-url>
npx yadiff --working/--staged/--dirtyOr install globally:
npm install -g yadiff
yadiff HEADThe command starts a local server in the background, opens the browser, acquires a diff from the selected source, and serves the patch to the browser. The shell command exits after launch. When there are no browser sessions for one minute, the local server exits automatically.
Use --foreground to keep the server attached to the current terminal.
Examples:
Git:
npx yadiff HEAD
npx yadiff main..feature
npx yadiff main...HEAD --repo ../some-repo
npx yadiff --working/--staged/--dirtyjj:
npx yadiff @ --repo ../some-jj-repo
npx yadiff 'mine() & mutable()' --vcs jjGitHub:
npx yadiff https://github.com/oven-sh/bun/pull/30412GitHub pull requests
Supported GitHub Targets are public pull request URLs:
https://github.com/OWNER/REPO/pull/123
https://github.com/OWNER/REPO/pull/123/files
https://github.com/OWNER/REPO/pull/123/commitsGitHub PR support intentionally excludes private repositories, authenticated requests, GitHub Enterprise, commit URLs, compare URLs, branch/blob URLs, and GitHub review/comment syncing. GitHub PRs are fetched once by the local server and cached for the life of the yadiff process; browser reloads reuse the captured PR diff.
potential future improvement
- add a button to sync review to github, with
ghcli? - copy filename; open file with
$EDITOR - support for private repo and enterprise, with
ghcli - stdin support
License
MIT.
