Skip to content

SirTenzin/hunks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/hunks

Usage

Run inside any git repository with uncommitted changes:

hunks

No 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 HEAD via node:child_process
  • Vendored UI: Four files adapted from opencode's TUI diff plugin

License

MIT

About

OpenCode's diff viewer, extracted for use anywhere.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors