Lensmaker is an in-browser diff viewer built with @pierre/trees for the file
tree and @pierre/diffs CodeView for virtualized diff rendering.
The right-hand pane embeds Codex through the local codex app-server protocol
so the diff view can grow toward an agentic IDE workflow.
It follows the DiffHub flow: paste a public GitHub PR, commit, compare, .diff,
or .patch URL, or open the app at a GitHub-style path such as
/ghostty-org/ghostty/pull/12291. For local review, open /local or press the
local diff button in the top bar. The viewer reads the current workspace git
diff, including untracked text files, and refreshes while files change. To review
the workspace against a specific local base, open /local/<target>, such as
/local/main or /local/abc123.
Use the flake for the toolchain and Playwright browser dependencies:
nix develop
npm install
npm run devnpm run dev starts Vite, the PTY bridge, and a localhost Codex bridge. The
Codex bridge spawns codex app-server from the Nix dev shell and connects the
right-hand Codex pane over ws://127.0.0.1:8789/codex. When you prompt Codex
from the right-hand pane, Lensmaker switches the main viewer to the local git
diff and keeps it subscribed to workspace changes so edits can be reviewed as
they arrive.
The default screen renders a real diff excerpt from
ghostty-org/ghostty#12291. You can also paste a raw unified diff into the
textarea and render it without any network request.
The flake pins a Deno canary with deno desktop support because the command has
not shipped in a stable Deno release yet. The desktop entrypoint serves the
production Vite output from dist/, so build the app before packaging or
serving it:
nix develop --command npm run desktop:check
nix develop --command npm run desktop:serve
nix develop --command npm run desktopnpm run desktop:serve builds the Vite app and serves it at
http://127.0.0.1:8000 with the same Deno.serve() handler used by
deno desktop. Pass --port to serve on another local port, for example
nix develop --command deno run --allow-read=dist --allow-net=127.0.0.1 scripts/desktop.ts --port 5175 --route /local/main.
npm run desktop builds the static app and writes the desktop bundle under
desktop-dist/.
To open the generated macOS app directly into the local diff route:
open -n desktop-dist/Lensmaker.app --args --route /localThis currently packages the built diff viewer. The full PTY and Codex panes
still depend on the local Node bridge processes started by npm run dev; moving
those into the desktop binary requires porting the bridge layer to Deno Desktop
bindings or another Deno-native bridge.
Open /local while working in a git repository to review the current local
diff. As files change on disk, Lensmaker updates the file list and diff view so
you can inspect edits without leaving the browser. Open /local/<target> for a
one-shot comparison from that local ref or SHA to the current workspace.
nix develop --command npm run build
nix develop --command npm run desktop:check
nix develop --command npm run test:e2e
nix develop --command npm audit --json
nix buildnix build installs npm dependencies from package-lock.json using the pinned
npmDepsHash and writes the static site to result/share/lensmaker.