About this project
Hunk is a terminal-based diff viewer designed around reviewing changesets produced by coding agents. Rather than printing a plain patch, it opens an interactive review interface built on OpenTUI and the Pierre diffs library. The project is MIT-licensed and distributed as a standalone binary for macOS, Linux, and Windows, with additional install paths through npm, Homebrew, mise, and Nix.
The core workflow mirrors familiar Git commands but renders results in a review UI. `hunk diff` shows current repository changes including untracked files, `hunk show` reviews a specific commit, and `hunk log` opens a history browser that falls back to static output when redirected. A watch mode auto-reloads file- and Git-backed reviews as the working tree changes. Raw files and patches can also be compared directly, and patches can be piped in from stdin.
Key interface features include a multi-file review stream with sidebar navigation, split, unified, and responsive auto layouts, syntax highlighting, mouse support, runtime view toggles, and a pager-compatible mode. A distinguishing capability is inline AI and agent annotations placed beside the code, supported by a documented agent workflow where an agent loads a skill file and interacts with a live Hunk session.
Hunk auto-detects Jujutsu and Sapling checkouts in addition to Git, and can be configured as the pager for all three version control systems. Preferences are persisted in TOML config files at the user or repository level, covering themes, layout mode, VCS selection, tab width, spacing, animations, and more. Every keyboard shortcut is a named command that can be remapped through a keybindings table.
An experimental extension API allows loading TypeScript extensions that can add CLI workflows, contribute themes and language mappings, add VCS backends, transform changesets before review, replace the sidebar with a custom React component, and respond to lifecycle events. Extensions can be installed from Git repositories, and a `hunk-extension` GitHub topic marks community contributions. The same diff renderer is also published as an OpenTUI component for embedding in other applications.
The README includes a feature comparison table against lumen, difftastic, delta, diff-so-fancy, and GNU diff, noting that Hunk focuses on interactive full-changeset review rather than structural diffing.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.