{"id":47638907,"url":"https://github.com/modem-dev/hunk","last_synced_at":"2026-05-17T04:04:11.848Z","repository":{"id":345747558,"uuid":"1184626912","full_name":"modem-dev/hunk","owner":"modem-dev","description":"Review-first terminal diff viewer for agentic coders","archived":false,"fork":false,"pushed_at":"2026-04-10T14:20:01.000Z","size":2772,"stargazers_count":393,"open_issues_count":14,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-10T16:12:13.432Z","etag":null,"topics":["cli","code-review","diff","git","tui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modem-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-17T19:16:15.000Z","updated_at":"2026-04-10T15:41:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/modem-dev/hunk","commit_stats":null,"previous_names":["modem-dev/hunk"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/modem-dev/hunk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modem-dev%2Fhunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modem-dev%2Fhunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modem-dev%2Fhunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modem-dev%2Fhunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modem-dev","download_url":"https://codeload.github.com/modem-dev/hunk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modem-dev%2Fhunk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31810856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","code-review","diff","git","tui"],"created_at":"2026-04-02T00:33:07.303Z","updated_at":"2026-05-17T04:04:11.841Z","avatar_url":"https://github.com/modem-dev.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","🚀 AI Tools for Vim, Neovim, and Terminal","Developer Tools"],"sub_categories":[],"readme":"# hunk\n\nHunk is a review-first terminal diff viewer for agent-authored changesets, built on [OpenTUI](https://github.com/anomalyco/opentui) and [Pierre diffs](https://www.npmjs.com/package/@pierre/diffs).\n\n[![CI status](https://img.shields.io/github/actions/workflow/status/modem-dev/hunk/ci.yml?branch=main\u0026style=for-the-badge\u0026label=CI)](https://github.com/modem-dev/hunk/actions/workflows/ci.yml?branch=main)\n[![Latest release](https://img.shields.io/github/v/release/modem-dev/hunk?style=for-the-badge)](https://github.com/modem-dev/hunk/releases)\n[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)\n\n- multi-file review stream with sidebar navigation\n- inline AI and agent annotations beside the code\n- split, stack, and responsive auto layouts\n- watch mode for auto-reloading file and Git-backed reviews\n- keyboard, mouse, pager, and Git difftool support\n\n\u003ctable\u003e\n \u003ctr\u003e\n   \u003ctd width=\"60%\" align=\"center\"\u003e\n     \u003cimg width=\"794\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f6ffd9c4-67f5-483c-88f1-cbe88c19f52f\" /\u003e\n     \u003cbr /\u003e\n     \u003csub\u003eSplit view with sidebar and inline AI notes\u003c/sub\u003e\n   \u003c/td\u003e\n   \u003ctd width=\"40%\" align=\"center\"\u003e\n     \u003cimg width=\"508\" alt=\"image\" src=\"https://github.com/user-attachments/assets/44c542a2-0a09-41cd-b264-fbd942e92f06\" /\u003e\n     \u003cbr /\u003e\n     \u003csub\u003eStacked view and mouse-selectable menus\u003c/sub\u003e\n   \u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\n## Install\n\n```bash\nnpm i -g hunkdiff\n```\n\nOr with Homebrew:\n\n```bash\nbrew install modem-dev/tap/hunk\n```\n\nRequirements:\n\n- Node.js 18+\n- macOS, Linux, or Windows\n- Git recommended for most workflows\n\n\u003e Nix users can use the `default` package exported in `flake.nix` instead. See [nix/README.md](./nix/README.md) for details.\n\n## Quick start\n\n```bash\nhunk           # show help\nhunk --version # print the installed version\n```\n\n### Working with Git\n\nHunk mirrors Git's diff-style commands, but opens the changeset in a review UI instead of plain text.\n\n```bash\nhunk diff                      # review current repo changes, including untracked files\nhunk diff --watch              # auto-reload as the working tree changes\nhunk show                      # review the latest commit\nhunk show HEAD~1               # review an earlier commit\n```\n\n### Working with Jujutsu\n\nHunk auto-detects Jujutsu checkouts, so `hunk diff [revset]` and `hunk show [revset]` use jj revsets inside a jj workspace. To override VCS detection, set `vcs = \"git\"` or `vcs = \"jj\"` in [config](#config).\n\n### Working with raw files and patches\n\n```bash\nhunk diff before.ts after.ts                # compare two files directly\nhunk diff before.ts after.ts --watch        # auto-reload when either file changes\ngit diff --no-color | hunk patch -          # review a patch from stdin\n```\n\n### Working with agents\n\n1. Open Hunk in another terminal with `hunk diff` or `hunk show`.\n2. Tell your agent to add the skill file returned by `hunk skill path`.\n3. Ask your agent to use the skill against the live Hunk session.\n\nA good generic prompt is:\n\n```text\nLoad the Hunk skill and use it for this review.\n```\n\nFor the full live-session and `--agent-context` workflow guide, see [docs/agent-workflows.md](docs/agent-workflows.md).\n\n## Feature comparison\n\n| Capability                         | [hunk](https://github.com/modem-dev/hunk) | [lumen](https://github.com/jnsahaj/lumen) | [difftastic](https://github.com/Wilfred/difftastic) | [delta](https://github.com/dandavison/delta) | [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) | [diff](https://www.gnu.org/software/diffutils/) |\n| ---------------------------------- | ----------------------------------------- | ----------------------------------------- | --------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------- |\n| Review-first interactive UI        | ✅                                        | ✅                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Multi-file review stream + sidebar | ✅                                        | ✅                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Inline agent / AI annotations      | ✅                                        | ❌                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Responsive auto split/stack layout | ✅                                        | ❌                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Mouse support inside the viewer    | ✅                                        | ✅                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Runtime view toggles               | ✅                                        | ✅                                        | ❌                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Syntax highlighting                | ✅                                        | ✅                                        | ✅                                                  | ✅                                           | ❌                                                         | ❌                                              |\n| Structural diffing                 | ❌                                        | ❌                                        | ✅                                                  | ❌                                           | ❌                                                         | ❌                                              |\n| Pager-compatible mode              | ✅                                        | ❌                                        | ✅                                                  | ✅                                           | ✅                                                         | ✅                                              |\n\nHunk is optimized for reviewing a full changeset interactively.\n\n## Advanced\n\n### Config\n\nYou can persist preferences to a config file:\n\n- `~/.config/hunk/config.toml`\n- `.hunk/config.toml`\n\nExample:\n\n```toml\ntheme = \"graphite\"   # graphite, midnight, paper, ember\nmode = \"auto\"        # auto, split, stack\nvcs = \"git\"          # git, jj\nwatch = false\nexclude_untracked = false\nline_numbers = true\nwrap_lines = false\nagent_notes = false\n```\n\n`exclude_untracked` affects Git working-tree `hunk diff` sessions only.\n\n### Git integration\n\nSet Hunk as your Git pager so `git diff` and `git show` open in Hunk automatically:\n\n\u003e [!NOTE]\n\u003e Untracked files are auto-included only for Hunk's own `hunk diff` working-tree loader. If you open `git diff` through `hunk pager`, Git still decides the patch contents, so untracked files will not appear there.\n\n```bash\ngit config --global core.pager \"hunk pager\"\n```\n\nOr in your Git config:\n\n```ini\n[core]\n    pager = hunk pager\n```\n\nIf you want to keep Git's default pager and add opt-in aliases instead:\n\n```bash\ngit config --global alias.hdiff \"-c core.pager=\\\"hunk pager\\\" diff\"\ngit config --global alias.hshow \"-c core.pager=\\\"hunk pager\\\" show\"\n```\n\n### Jujutsu pager integration\n\nTo use Hunk as jj's pager, run `jj config edit --user` and update:\n\n```toml\n[ui]\npager = [\"hunk\", \"pager\"]\ndiff-formatter = \":git\"\n```\n\n### OpenTUI component\n\nHunk also publishes `HunkDiffView` and lower-level primitives from `hunkdiff/opentui` for embedding the same diff renderer in your own OpenTUI app.\n\nSee [docs/opentui-component.md](docs/opentui-component.md) for install, API, and runnable examples.\n\n## Examples\n\nReady-to-run demo diffs live in [`examples/`](examples/README.md).\n\nEach example includes the exact command to run from the repository root.\n\n## Contributing\n\n💬 _Chat with users/contributors on the [Modem Discord server](https://discord.gg/WZFjaP6Gt8)_\n\nFor source setup, tests, packaging checks, and repo architecture, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Sponsor\n\nSponsored by [Modem](https://modem.dev?utm_source=github\u0026utm_medium=oss\u0026utm_campaign=hunk).\n\n\u003ca href=\"https://modem.dev?utm_source=github\u0026utm_medium=oss\u0026utm_campaign=hunk\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://modem.dev/images/logo/svg/modem-combined-white.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://modem.dev/images/logo/svg/modem-combined-black.svg\"\u003e\n    \u003cimg src=\"https://modem.dev/images/logo/svg/modem-combined-black.svg\" alt=\"Modem\" width=\"220\"\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodem-dev%2Fhunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodem-dev%2Fhunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodem-dev%2Fhunk/lists"}