@sirtenzin/hunks
v0.1.11
Published
Terminal diff viewer for git working-tree changes with keyboard-navigable TUI
Readme
hunks
Terminal diff viewer extracted from opencode's /diff slash command. Renders git working-tree changes in a keyboard-navigable TUI with file tree sidebar, split/unified diff panes, and reviewed-state tracking.
Install
Requires Bun (>= 1.0).
bun i -g @sirtenzin/hunks
# or
npm i -g @sirtenzin/hunksUsage
Run inside any git repository with uncommitted changes:
hunksNo arguments, no config. It walks up from cwd to find .git, runs git diff HEAD, and opens the viewer.
Keyboard shortcuts
| Key | Action |
|-----|--------|
| j/k or ↑/↓ | Navigate up/down |
| n/p | Next/previous changed file |
| tab/t | Toggle focus between file tree and diff pane |
| m | Mark file as reviewed and stage it; unmark to unstage |
| r | Reload git diff |
| v | Toggle split/unified view |
| s | Toggle single-patch mode |
| e | Expand all directories |
| h/l or ←/→ | Collapse/expand directory |
| q or Ctrl+C | Quit |
Architecture
- Runtime: Bun (TypeScript + JSX via
@opentui/solid) - Renderer:
@opentui/core+@opentui/solid(terminal-native, no webview) - Diff parsing:
git diff HEADvianode:child_process - Vendored UI: Four files adapted from opencode's TUI diff plugin
License
MIT
