gitmyhub

comview

Go ★ 261 updated 25d ago

the best diff viewer ever made

A terminal app for viewing and commenting on git diffs, with vim-style navigation instead of a browser.

Gosetup: easycomplexity 2/5

Comview is a terminal-based program for viewing code diffs — the standard way of displaying what changed between two versions of a file, where added lines appear in green and removed lines appear in red. You pipe a diff directly into it from the command line and it renders the result in a clean, readable format inside your terminal window.

It is designed as an alternative to viewing diffs in a web browser (like on GitHub's pull request pages) or in a basic terminal output. Instead, it provides a keyboard-driven interface with vim-style navigation keys, so you can move around the diff, jump between changed sections, search for specific text, and toggle between a combined and side-by-side view of the changes. You can also open the file at the cursor position directly in your editor.

One distinctive feature is the ability to add comments to specific lines while reviewing, which are saved locally to a JSON file. This lets you take notes during a code review without leaving the terminal. The tool works with any standard unified diff format, so it works with git diff output, git show for viewing individual commits, or the output of tools like the GitHub command-line interface.

It is written in Go and installed by cloning the repository and running a make command. The project describes itself plainly as a small terminal program that does one thing without requiring a web browser.

Where it fits