hunk  by modem-dev

Terminal diff viewer for agentic code review

Created 3 weeks ago

New!

402 stars

Top 72.0% on SourcePulse

GitHubView on GitHub
Project Summary

Hunk is a terminal-based diff viewer specifically designed for reviewing code changes generated by AI agents. It offers an interactive, multi-file interface with inline AI annotations, aiming to significantly improve the efficiency and clarity of code review workflows for developers leveraging AI coding assistants.

How It Works

Hunk utilizes OpenTUI for its interactive terminal user interface and Pierre diffs for parsing. Its core design emphasizes a "review-first" approach, presenting changes in a navigable stream with a sidebar for multi-file context. A key differentiator is the integration of inline AI and agent annotations, allowing AI-generated comments and rationale to be displayed directly alongside code, enhancing understanding and review speed. It supports flexible split, stack, and responsive layouts, along with a watch mode for automatic updates.

Quick Start & Requirements

  • Primary install / run command (pip, Docker, binary, etc.). npm i -g hunkdiff
  • Non-default prerequisites and dependencies (GPU, CUDA >= 12, Python 3.12, large dataset, API keys, OS, hardware, etc.). Node.js 18+, macOS or Linux. Git is recommended for most workflows.
  • Estimated setup time or resource footprint. N/A (typical npm install time)
  • If they are present, include links to official quick-start, docs, demo, or other relevant pages. N/A (No direct links provided in README)

Highlighted Details

  • Review-first interactive UI with multi-file stream and sidebar navigation.
  • Inline AI and agent annotations directly beside code.
  • Responsive auto split/stack layouts and mouse support.
  • Seamless Git integration, usable as a pager (git config --global core.pager "hunk pager").
  • Watch mode for auto-reloading file and Git-backed reviews.

Maintenance & Community

  • The README does not provide specific details on maintainers, community channels (e.g., Discord/Slack), sponsorships, or a roadmap. Contribution guidelines are available in CONTRIBUTING.md.

Licensing & Compatibility

  • License type and notable restrictions (GPL -> copyleft, SSPL, etc.). MIT License.
  • Compatibility notes for commercial use or closed-source linking. Permissive license, generally compatible with commercial use and closed-source linking.

Limitations & Caveats

Hunk does not support structural diffing. When integrated as a Git pager, untracked files are not automatically included in the diff output, as Git controls the patch content in that scenario.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
176
Issues (30d)
18
Star History
410 stars in the last 25 days

Explore Similar Projects

Feedback? Help us improve.