Skip to content
withnicPublic

About

Lightweight code review editor for AI agents' parallel Git worktrees (Rust + Tauri).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nod

nod — a lightweight native code review editor for parallel Git worktrees

A lightweight native code review editor for quickly reviewing and approving ("nodding" at) changes that AI coding agents made in parallel across Git worktrees (.bare layouts and regular repositories).

Built with Rust (Cargo workspace) + Tauri v2. The frontend (ui/) is plain Vanilla JS / CSS / HTML and needs no Node.js build. The terminal uses bundled xterm.js 6.0.0 and Fit Addon 0.11.0. Their licenses are in ui/vendor/xterm/.

Review uncommitted changes, individual commits, and commit ranges in one window. Track reviewed files, search across worktrees, open files in an external editor, and run a shell in the selected worktree.

Layout

Path Layer Contents
crates/nod-core Core Pure domain logic (shared/, features/*). No UI / OS / I/O; enforced by clippy.toml.
src-tauri/src/commands, src-tauri/src/main.rs Presentation Tauri IPC handlers and the CLI entry point.
src-tauri/src/infra Infra Git / file system / PTY implementations of the Core ports.
ui/ Presentation WebView frontend (frontendDist).

See docs/design/ for the full design.

Prerequisites

  • Rust 1.92 or newer for the dependencies pinned in Cargo.lock. The workspace manifest declares a baseline of 1.77.2.
  • Git
  • Platform requirements of Tauri v2:
    • Linux (Debian / Ubuntu):

      sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev \
        libayatana-appindicator3-dev librsvg2-dev patchelf pkg-config build-essential

      (libappindicator3-dev may be used instead of libayatana-appindicator3-dev.)

    • Windows 11 — Microsoft C++ Build Tools with the Desktop development with C++ workload, an MSVC Rust toolchain, and the WebView2 Runtime (preinstalled on Windows 11).

    • macOS — Xcode Command Line Tools (xcode-select --install).

Build

cargo build --release --features custom-protocol
# binary: target/release/nod (nod.exe on Windows)

Windows x64 distribution

Double-click build-windows.cmd in Explorer to build both files. The first build downloads a pinned Tauri CLI and NSIS tools into target/, so it requires internet access. Install the Rust MSVC toolchain and Microsoft C++ Build Tools listed above before building.

  • Standalone app — target/x86_64-pc-windows-msvc/release/nod.exe
  • Installer — target/x86_64-pc-windows-msvc/release/bundle/nsis/*-setup.exe

The app embeds its UI and runs with Git on PATH and WebView2 Runtime. The installer downloads WebView2 if needed. Launch Nod from the Start menu or double-click the standalone app to choose a repository. From a terminal, you can still pass a repository path or launch from inside a repository.

Releases

On a branch, run pwsh ./release.ps1 bump patch (bug fixes), minor (new features) or major. It bumps version in src-tauri/tauri.conf.json and the workspace Cargo.toml, updates Cargo.lock, and commits. Merge it through a pull request, update local main, and run pwsh ./release.ps1 tag to push the matching tag such as v0.2.0. The Release workflow builds Windows (installer and standalone exe), macOS (Apple Silicon and Intel dmg), and Linux (AppImage and deb), and attaches them to a draft GitHub Release. Check the draft and publish it. The builds are not code-signed, so Windows SmartScreen and macOS Gatekeeper warn on first launch.

Test

The three checks below must pass before every commit:

cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
  • crates/nod-core/clippy.toml bans file system, process, network, stdout / stderr, environment and wall-clock APIs inside the Core crate.
  • src-tauri/tests/architecture.rs checks that the Presentation layer does not touch the file system or spawn processes directly, and validates Cargo.toml, clippy.toml, tauri.conf.json and capabilities/default.json.

Run

Run nod [options] [path...] with the binary on PATH. From the workspace, use cargo run -p nod -- . or ./target/release/nod .. On Windows, use .\target\release\nod.exe .. Both regular Git repositories and .bare layouts with linked worktrees are supported.

Option What it opens Example
-e, --existing (default) Focuses a window containing all requested repositories, or opens a new one. nod -e . or nod .
-a, --add Adds the repositories to the last focused window and selects the first. nod -a ../another-repo
-r, --reuse Replaces the last focused window's project list. nod -r ../another-repo
-n, --new Opens the repositories in a new window. nod -n .

Running nod with no arguments focuses the last active window when nod is running. On a fresh start, it restores saved windows, then tries the current directory if none can be restored. Windows offers a folder picker if the current directory is outside Git. An explicit mode without a path uses the current directory. A fresh launch with paths restores saved windows before applying the requested mode.

Each window has its own projects, selection, and terminal tabs. Settings and viewed status are shared. On the next launch, nod restores the open windows and their selected projects. Closing a window removes it from the session when other windows remain. Closing the final window exits nod and preserves that window for the next launch.

Use --help or --version for CLI information. Exit codes are 0 for success, 1 for an invalid argument or repository, and 2 for a startup or environment error. On Windows, PowerShell and cmd can return to the prompt before the release executable finishes writing. In PowerShell, use nod --version | Out-String or Start-Process nod -ArgumentList '--version' -Wait -NoNewWindow. In cmd, use start "" /wait nod --version.

Manual checks for CLI and windows

  1. Start nod in a Git repository. Run nod . from a second terminal in the same repository and verify that the original window comes forward. Run nod ../another-repo and verify that a new window opens. Focus a window, run nod -a ../another-repo, and verify that the project is added and selected there. Run nod -r . to replace that window's project list and nod -n . to open another window. Check that each secondary nod process exits promptly after forwarding.
  2. Leave two windows open with distinguishable project lists, quit the application, then start nod with no arguments. Verify that both windows reopen with their projects and selections. Close one window and then close the last one. Verify that the next start restores only the last one.
  3. Open a terminal in each window and record the shell PIDs with $PID in PowerShell or echo $$ in a POSIX shell. Close one window and check with Get-Process -Id <PID> or ps -p <PID> that its shell exited and the other shell is still running.
  4. With both the installed and standalone Windows release builds, check nod --version, nod --help, and nod --unknown in PowerShell and cmd using the wait forms above. Verify that launching from Explorer or Start opens the GUI without a console window.
  5. On macOS and Linux, repeat the open-mode checks and run nod --version.

GitHub Pull Requests

Install GitHub CLI (gh) with support for gh pr checkout --worktree, put it on PATH, and run gh auth login. Open the Pull Requests activity icon to see up to 100 open PRs for the selected project. Worktrees shows matching PR numbers, review decisions, and CI badges from the last fetch. The PR number and CI icon open GitHub in your default browser. Use either panel's Refresh button to fetch current status.

Select a PR title to open its existing worktree or import it on a pr/<number> branch next to the other worktrees. A .bare layout uses <root>/pr-<number>. A regular repo uses <parent>/<repo>.pr-<number>. Use Update on an imported PR to fast-forward its branch. A dirty or diverged worktree is left untouched. GitHub integration is enabled by default and can be turned off in Settings.

The PR range starts at the worktree's merge-base with your local tracking ref for the default branch. The diff can differ from GitHub's when the PR targets another branch or your local tracking ref is stale.

Send selected lines to the terminal

Click a line number to select one line, Shift-click a second number to select a range, or drag across the code to select text. This works in the worktree file viewer, Markdown Source, and Unified and Split diffs.

Click Send to terminal in the viewer toolbar or press Ctrl/Cmd+Shift+L. nod pastes the location into the active terminal tab and leaves it ready for you to add a prompt and press Enter. A hidden terminal opens and receives focus. The default format is src/main.rs:12 for one line or src/main.rs:12-18 for a range, including the trailing space. Historical diff lines include (at a1b2c3d). A mixed selection uses the line numbers on the after side.

The path is relative if you opened the tab in the displayed worktree. For a tab opened in a different worktree, nod pastes an absolute path and briefly shows the destination project and branch. When you ask an agent to read a file in another project, it may ask for permission to access that directory. For example, Claude Code can request access through /add-dir.

To change the format, edit terminal.send_template in settings.jsonc and click Reload settings.jsonc in Settings. For example, add or update this entry to paste @src/main.rs#L12-18 .

"terminal": {
  "send_template": "@{path}#L{start}-{end} "
}

{path} is required. You can also use {start}, {end}, {lines} (one number or a range), and {at} (the commit suffix when applicable). Change the key binding in Shortcuts under Send to terminal.

Send to terminal manual checks

  1. Open a worktree file and a terminal tab from the same worktree. Select lines by clicking a number, Shift-clicking a range, and dragging over code. Try the toolbar button and Ctrl/Cmd+Shift+L. Check the highlight, relative path, line or range, trailing space, and that the prompt remains unsubmitted. Repeat with Claude Code and Codex CLI and check that each paste arrives as a single input. In a Markdown file, try Source and Preview and verify that sending is available in Source. Check that it is disabled for an image.
  2. In both Unified and Split, select added, context, deletion-only, and mixed ranges in each scope. Check the after-side numbers for added, context, and mixed ranges. Expect no SHA in Uncommitted, the selected commit SHA in Commit, and the To SHA in Range. For deletion-only ranges, check the before-side numbers with the seven-character SHA of HEAD, the selected commit's first parent, or From, respectively. In Split, drag across several deleted lines within the Before column where the After column also contains added lines. Check that only the Before lines are highlighted and that the paste uses their line numbers and the corresponding before-side SHA.
  3. Keep a tab open in a different worktree or project, return to the source file, and send again. Check the absolute path and the brief notice naming the destination project and branch. Send to the original worktree tab again and confirm the path is relative.
  4. Send with all tabs closed and again after the active shell exits. Check for “Open a terminal tab first”. With a running tab, hide the terminal and send again. Check that the pane opens and the tab receives focus.
  5. On Linux or macOS, create a text file with a newline in its name in a test worktree. Open the file, select a line, and send it. Check that the control character notice appears and the terminal input stays unchanged.
  6. Set terminal.send_template to @{path}#L{start}-{end} , reload Settings and send a range. Check that the custom format is pasted. Change the binding in Shortcuts and check that the new keys send the selection.

Keyboard shortcuts

Shortcut Action
Alt+1 through Alt+9 Select one of the first nine worktrees.
Ctrl/Cmd+P Open file-name search.
Ctrl/Cmd+Shift+F Open file-content search.
Alt+← / Alt+→ Go back / forward in file history. Change these keys in Shortcuts.
Ctrl/Cmd+Shift+L Paste the selected line location into the active terminal tab.
Enter on the open file in Changed Files Mark the file viewed.
↑ / ↓ in the file list Open the previous or next visible file.
Escape Dismiss the search dialog.
Arrow keys on a dock divider Resize the dock along its width or height.
Enter, Backspace, arrow keys in the terminal Send input to the active shell.
Ctrl+C, Ctrl+D in the terminal Copy the selection with Ctrl+C, or interrupt the shell when there is no selection. Ctrl+D sends EOF input.

手動確認手順

  1. Desktop review UI. Open a test repository with two or more worktrees and both committed and uncommitted changes using cargo run -p nod -- /path/to/repository. Check selection by mouse and Alt+1..9, dirty counts and viewed progress, all three diff scopes, the changed-file and full trees, and Unified/Split rendering and highlighting. Mark a file viewed, refresh and reopen the app to verify persistence, then edit the file and refresh to verify Stale Reset. Try both search shortcuts, current and all-worktree searches, and opening a result in an installed Code, Cursor, or Zed editor.

  2. Terminal UI. Use Terminal to show and hide the pane, drag its divider, and open multiple New tab sessions. Rename a tab with ✎ and verify that its title, close button, and terminal background share a color. Run pwd (PowerShell also accepts pwd) before and after switching worktrees and creating a new tab. Check that existing tabs retain their shells and transcripts. In a POSIX shell, use printf '\033[1;32m日本語\033[0m\n' to check UTF-8 and SGR, and stty size before and after dragging the divider or resizing the window. In PowerShell, use [Console]::WindowWidth and [Console]::WindowHeight to check the dimensions. Verify scrolling, typing, Enter, Backspace, arrow keys, and Ctrl+C/D. For IME input, type echo , compose and commit 日本語, then press Enter to submit. Verify that the command runs with the committed text appearing once in the input line. Close one tab with × and use exit in another to check the exit status in the pane.

  3. DI wiring. Inspect src-tauri/src/app.rs and confirm it constructs Core services with Infra implementations and delegates requests. Check that review-state, diff, and validation decisions are handled in Core.

  4. PTY cleanup at app exit (RunEvent::Exit). Open at least two terminal tabs. Record each shell PID using echo $$ on a POSIX shell or $PID on PowerShell. Leave the shells open, close the desktop window normally, and confirm from a separate terminal that none of those PIDs remain using ps -p <PID> or Get-Process -Id <PID>. Repeat with the terminal pane hidden during close.

  5. Windows 11 release CLI. Build with cargo build --release --features custom-protocol and run the following commands in PowerShell.

    (Start-Process .\target\release\nod.exe -ArgumentList '--version' -Wait -NoNewWindow -PassThru).ExitCode
    (Start-Process .\target\release\nod.exe -ArgumentList '--help' -Wait -NoNewWindow -PassThru).ExitCode
    (Start-Process .\target\release\nod.exe -ArgumentList '--unknown' -Wait -NoNewWindow -PassThru).ExitCode

    Verify that the calling console displays the version, help, and argument error, and that the exit codes are 0, 0, and 1. Repeat in cmd with start "" /wait nod ..., then check that launching from Explorer or the Start menu opens the app without a console window.

Phase 09 review features

Use + in Worktrees to add another Git repository, or pass multiple paths with nod path1 path2. Each project has its own worktree group. Select any worktree to change the review target and project path. Use × to remove a project from the list.

Use the Settings gear to assign Projects, Changed Files, Worktree Files, Terminal, Pull Requests and Project Files to either slot on any edge. Set their initial visibility, default dock sizes and project path bar position or size. The outer icon bars toggle panels for the current window. Drag a dock divider to resize it for the current window. Save writes the default layout to settings.jsonc. Open settings.jsonc uses the selected Code, Cursor or Zed editor, and Reload settings.jsonc applies external edits.

Annotate shows blame on tracked source lines in file and diff views. Markdown files have Source and Preview modes, supported images open inline, and ignored entries are dimmed in Worktree Files. Both search modes support current-worktree, current-project and all-project scopes, extension filters and an Include test files checkbox.

Worktree Files shows the selected worktree. Project Files starts at the project root and labels worktree folders with their branches. Files inside a worktree open with that worktree's Annotate and external editor actions while the current review target stays selected. Files alongside the worktrees open read-only, with Markdown and image previews. Refresh project files reloads the tree, and nod remembers expanded folders for each project until exit. Settings reads the legacy layout.panels.project_files key and writes it as worktree_files the next time you save.

Phase 16 manual checks

  1. With an older settings.jsonc containing layout.panels.project_files, reload Settings. Check that Worktree Files uses the existing placement and shows the selected worktree. Save settings and verify that the panel is now stored as worktree_files.
  2. Open a .bare project with two worktrees and a root-level AGENTS.md. Open Project Files. Check the root, both branch labels, and the active worktree highlight. Open AGENTS.md, switch between Source and Preview, and verify that Annotate, Open in editor and Send to terminal are disabled.
  3. Expand a different worktree in Project Files. Check that ignored entries are dimmed. Open a tracked text file, turn on Annotate, and open it in an external editor. Confirm that Worktrees selection, the diff scope and the terminal session stay on the original worktree. Use Back and Forward to revisit both files.
  4. Open a regular repository and check that Project Files starts with one root worktree entry.
  5. Expand folders and scroll in Project Files. Switch to Changed Files and Worktree Files and back using the outer icons. Check that each panel keeps its expanded folders and scroll position. Switch projects and back to check that each remembers its own folders. Add a file to the project root and use Refresh project files to make it appear.

Phase 09 manual checks

  1. Add a second repository with + and select worktrees across both projects. Check the project path, scope, diff data, dirty and viewed counts, and Back and Forward across projects. Use the Worktrees refresh icon, remove a project with ×, and restart while retaining a project to check persistence. Remove the last project and check the Add project prompt.
  2. Set Changed Files and Worktree Files to the same side and slot. Open Worktree Files, expand a folder and scroll. Switch via the outer icons and switch back. Check that the folder, selected item and scroll position persist. Click the active icon again to hide the panel, then reopen it.
  3. Open settings.jsonc from Settings. Set diff_files to right slot 1 and worktree_files to right slot 2, with both visible, then reload. Check vertical stacking and that either remaining panel fills the dock when the other is hidden. Hide both and check that only the icon bar remains. Move panels to the top, bottom and left, test horizontal slot placement on the top and bottom, and resize each dock. Move the path bar to all four sides and test Hidden. Save and relaunch to verify the saved layout. Tab to the Terminal, Shortcuts, Settings and outer icons and check tooltips, focus and active state. Move or hide an open terminal and verify its tabs and output persist and resize with the dock.
  4. Toggle Annotate in a tracked file and in Unified and Split diffs. Switch a Markdown file containing bold text, headings and a table between Source and Preview. Open a JPG or PNG and check its size and dimensions. Inspect an ignored file and directory in Worktree Files. Search across both projects with an extension filter, toggle Include test files, and open a result from the other project.
  5. On Windows, select terminal text and press Ctrl+C, then verify the copied text. With no selection, start a long-running shell command and verify Ctrl+C interrupts it. Paste a short Japanese string with Ctrl+V, Ctrl+Shift+V, right-click with no selection, and Hex while the terminal has focus. Check that each paste inserts the text once. Right-click a selection to verify copy and selection clearing.

Settings and local data

OS settings.jsonc directory projects.json and state/ directory
Windows %APPDATA%\nod\ %APPDATA%\nod\
macOS ~/Library/Application Support/nod/ ~/Library/Application Support/nod/
Linux $XDG_CONFIG_HOME/nod/ (default ~/.config/nod/) $XDG_DATA_HOME/nod/ (default ~/.local/share/nod/)

settings.jsonc accepts // and /* … */ comments and trailing commas. Settings and Shortcuts preserve comments and field order when saving. Back, Forward, and Send to terminal are stored under shortcuts. Use Mod for Ctrl on Windows and Linux and Cmd on macOS.

On the first launch after upgrading, nod converts the old settings.json to settings.jsonc and keeps the original as settings.json.bak. It moves the project list and viewed state if their directory changed. The Windows installer keeps the application under %LOCALAPPDATA%\nod. The first launch also imports valid history shortcuts from WebView local storage. nod retains settings, projects and viewed state when you uninstall. After migration, an old version starts with defaults for the files that were moved or converted.

Settings and migration manual checks

  1. On the old Windows installer version, customize the layout and a history shortcut, add a project and mark a file as viewed. Upgrade and launch nod. Verify that the layout, projects and viewed marks carry over, and that %APPDATA%\nod\ contains settings.jsonc, projects.json and state\. Check that %LOCALAPPDATA%\nod\ retains the app files and settings.json.bak.
  2. Check that the customized history shortcut from before the upgrade still works and appears under shortcuts in settings.jsonc.
  3. Add a comment to settings.jsonc. Change and save a setting in Settings, then change a binding in Shortcuts. Verify that the comment remains after each save.
  4. Uninstall nod. Verify that %APPDATA%\nod\ remains, reinstall nod, and check that it uses the retained settings.
  5. In Settings, verify the labels Open settings.jsonc and Reload settings.jsonc. Open the file in the selected editor, change a value, then reload and verify that nod applies it.

GitHub Pull Requests manual checks

  1. Run gh auth login, open a GitHub project with open PRs in nod, and open Pull Requests from the activity bar. Compare PR numbers, titles, authors, Draft, review and CI indicators with GitHub. Check the Local label and corresponding Worktrees badges and tooltips. Switch between projects, then move Pull Requests to another dock and slot in Settings and reopen it.
  2. Use Tab and Enter or Space on a PR title with a local worktree. Check that nod selects it and shows the range up to the local HEAD, including when the remote PR has commits you have yet to fetch. From Commit or Range, select a PR whose worktree has no merge-base. Check that nod keeps the scope and uses that worktree's commits, and that reselecting it keeps its chosen refs. Select a PR without a worktree and check the progress indicator, the pr/<number> branch, and the new selection and diff. Check the expected paths in both a .bare and a regular repo. Try a fork PR whose head branch name matches an unrelated local branch and check that nod imports it into its own worktree.
  3. With a test PR whose remote head has advanced by a fast-forward, use Update from the PR row and from Worktrees. Check that HEAD, the changed files, and the scoped diff reflect the new commits. Repeat with uncommitted changes, and with a clean worktree and a test PR whose remote head has diverged after a force push. Each refusal should explain the reason and preserve HEAD and local changes.
  4. Launch nod once with gh removed from the process's PATH, once with gh installed but no credentials (use gh auth logout in a test profile), and once with a project without a GitHub remote. Check the dim activity icon, its tooltip, and the matching guidance inside the panel. Check that local worktree selection and diffs still work.
  5. Turn off GitHub integration (gh CLI) in Settings and save. Check that the activity icon, panel, badges, and Update controls disappear immediately and after restarting. Use a process monitor to check that Refresh and project switches launch no gh process while disabled. Turn it back on, save, and check that nod fetches PRs and restores the UI.
  6. After CI completes on GitHub, use the Worktrees Refresh button and check that the badge changes. Repeat with Pull Requests Refresh. Confirm that the cached badges remain visible while waiting for a refresh.
  7. On each supported OS, click and keyboard-activate a PR number and CI badge in both panels. Check that the default browser opens the PR and the first failed or running check, or the PR's Checks tab when appropriate. Neither control should select or import a worktree. Verify that a missing CI URL has no action.
  8. In a disposable test repo, set core.hooksPath to a tracked directory and use a test PR containing an executable post-checkout hook that only writes a marker file. Import the PR and verify that the marker file is absent.

About

Lightweight code review editor for AI agents' parallel Git worktrees (Rust + Tauri).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages