# diffnav turns a git diff into a file tree with a navigable pager

> diffnav is a Go terminal pager for git diffs that borrows its colouring from delta and adds a file tree in the style of GitHub, so a large diff can be navigated rather than scrolled. It is built on the Charm libraries with a fuzzy finder and viewport handling, and it ships as a Go module with cross platform releases.

**dlvhdr/diffnav** — A git diff pager based on delta but with a file tree, à la GitHub.

- Repository: https://github.com/dlvhdr/diffnav
- Stars: 1,626 · Forks: 54
- Language: Go
- License: MIT
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/dlvhdr-diffnav

## A file tree sits next to the patch

The project describes itself in one line: a git diff pager based on delta but with a file tree, in the style of GitHub. The two halves come from different places and the combination is the point. The colouring of additions and removals follows the approach delta established, and the navigation model is the one GitHub uses in its pull request file view, where a tree of changed files sits beside the content and you pick a file rather than scrolling through hunks. A terminal pager normally has one pane and a long scrollback. diffnav replaces the scrollback habit with a tree, so the first action in a review is picking a file, and only then reading the change. That is a workflow change rather than a cosmetic one, and it is worth it precisely when the diff has too many files for scrolling to be reasonable.

## Built on the Charm TUI stack, with a fuzzy finder for long file lists

The dependency list in go.mod is a good map of the implementation. The interface is built on bubbletea, the Charm terminal UI framework, with bubbles for the components, lipgloss for styling and log for output. Two dependencies point at specific parts of the experience. `github.com/sahilm/fuzzy` is a fuzzy matching library, which is what a file tree with hundreds of entries needs so you can jump to a file by an approximate name. `github.com/robinovitch61/viewport` handles the scrollable region. There is also `github.com/atotto/clipboard`, so copying a path or a hunk is a supported action rather than an accident of the terminal, and `github.com/muesli/reflow` for text wrapping, which matters for long lines in a narrow pane.

## Diffs are parsed with go-gitdiff, not with git itself

The diff parsing is handled by `github.com/bluekeyes/go-gitdiff`, a Go library for parsing unified diffs. That choice tells you something about the architecture: the program consumes a diff as data rather than shelling out to git and parsing terminal output, which is what lets the same binary work on a diff produced anywhere. The module also pulls in `github.com/cli/go-gh/v2` and `github.com/shurcooL/githubv4`, the GitHub CLI library and the GitHub GraphQL client, and `gopkg.in/yaml.v3` for configuration. The presence of the GitHub libraries and a `cfg/` directory in the repository suggests the pager can be pointed at a pull request rather than only at local output, and `examples/` contains a file named `gh_dash_pr.diff` alongside diffs named for single file, two files, multiple files, a long file name, which look like fixtures for the tree and viewport behaviour rather than documentation samples.

## A Go module, a Taskfile, and GoReleaser for the binaries

The module path is `github.com/dlvhdr/diffnav` and the manifest requires Go 1.26. The repository layout shows a conventional Go project with `cmd/`, `internal/`, `pkg/` and `main.go` at the root, and the build tooling is visible rather than hidden. There is a `Taskfile.yml` for the task runner, a `devbox.json` with a matching lock file for a reproducible development environment, a `mise.toml` for tool version pinning, and a `.envrc` for direnv. Releases are handled by GoReleaser through `.goreleaser.yaml`, which is how a Go project ships binaries for several operating systems and architectures from one pipeline, and the README links a releases badge pointing at the release assets. The linting setup is a `.golangci.yml`, and the `demo.tape` file with the VHS tape format is how the terminal recording in the README is produced.

## The README is mostly a sponsor wall, so look elsewhere for usage

This is worth flagging because it affects how you evaluate the project. The README in this repository is dominated by sponsor tiers, with a list of sponsor categories and a large set of sponsor links generated by GoReleaser, and a sponsorship call at the top. The functional description is a single line plus screenshots. There is no configuration reference and no usage section in that README, and no install command is given either. That does not mean the project lacks documentation, since the repository holds an `examples/` directory, a `CONTRIBUTING.md` and a `cfg/` directory, but it does mean the README is not where you will learn the key bindings or the pager configuration. Anyone evaluating diffnav should plan to read the repository's other files and the release notes rather than assuming the README covers the usage.

## A pager is the wrong shape for automation

The limitation follows from what diffnav is. A pager is an interactive terminal program, so it needs a terminal, it takes over the screen, and it does not produce machine-readable output. If your workflow pipes a diff into a script, counts lines, or generates a report, a pager is the wrong tool, and adding a file tree makes it worse rather than better. The same applies to reviewing a diff on a web interface or in a code review tool, where the GitHub style tree already exists and diffnav has nothing to add. What diffnav is for is the case where the diff is on your own machine, produced by a local branch, a rebase, or a stash, and you want the review experience of a pull request without leaving the terminal. The other practical limit is terminal capability, since the interface depends on colour profiles, an overlay zone and a viewport, and the Charm dependencies include an ultraviolet renderer and a colour profile package, so a plain or very limited terminal is the first place to test it.

## Conclusion

Adopt diffnav if you review large diffs in the terminal and want a file tree beside the patch, since the tree turns a wall of hunks into a navigable list of changed files. Do not adopt it if you pipe diffs into other tools or need a scriptable diff, because this is a terminal UI built on a TUI framework rather than a filter. Verify first that your terminal handles the colour profile and the overlay zone the interface uses, and check the release assets for your platform, since the build is driven by GoReleaser and the module targets Go 1.26.

## FAQ

### What is diffnav?

It is a git diff pager based on delta but with a file tree, in the style of GitHub. It is written in Go and built as a terminal user interface with the Charm libraries.

### How is diffnav written in Go?

The module path is `github.com/dlvhdr/diffnav` and the manifest requires Go 1.26. The interface is built on bubbletea with bubbles components and lipgloss for styling, and diffs are parsed with the go-gitdiff library.

### What licence is diffnav released under?

The project is released under the MIT licence, with the licence text held in the LICENSE.txt file at the root of the repository.

### How are diffnav binaries distributed?

The repository carries a `.goreleaser.yaml` configuration, so the release pipeline is driven by GoReleaser, and the README links a badge pointing to the project's release assets.

### Can diffnav be used in scripts?

Not as a diff filter. It is an interactive terminal pager, and the implementation depends on a TUI framework, a colour profile and a viewport, so it is built for reading a diff in a terminal rather than for producing output you can pipe onward.

## Sources

- [dlvhdr/diffnav on GitHub](https://github.com/dlvhdr/diffnav)
- [Issues](https://github.com/dlvhdr/diffnav/issues)
- [License: MIT](https://github.com/dlvhdr/diffnav/blob/main/LICENSE)
- [README](https://github.com/dlvhdr/diffnav/blob/main/README.md)
- [Releases](https://github.com/dlvhdr/diffnav/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/dlvhdr-diffnav
