gorefact is a package-centric explorer for Go import and reference graphs. Browse a module's packages, inspect a package's public API, and see exactly who depends on it — built for planning refactors.
What it does
Browse a module's packages, read off a package's public API, and trace exactly who depends on it — down to individual reference sites.
Browse a module's packages as a flat list, a folder tree nested by path segment, or an import tree nested by dependency edge.
A package's exported const, var, func, and types — structs and interfaces expand inline into their exported methods and fields.
See who imports a package, flat or as a tree, then drill into CallerPkg.CallerFunc → Symbol reference sites with file:line.
Interactive TUI on a terminal, or structured text, JSON, and Markdown reports — pipe into jq, less, or your editor.
Install
Pick the install path that matches your setup.
brew tap flaticols/apps brew install flaticols/apps/gorefact
go install:go install go.flaticols.dev/gorefactor/cmd/gorefact@latest
go get -tool go.flaticols.dev/gorefactor/cmd/gorefact@latest go tool gorefact ./...
nix profile install github:flaticols/gorefactor
inputs.gorefactor.url = "github:flaticols/gorefactor";
amd64, arm64):
Download the latest .tar.gz from the
releases page,
extract, and drop gorefact onto your $PATH.
Usage
Run gorefact bare to open the explorer, or target a package
and pass --format for a structured report. Module-only by
default, with --filter-pkg scoping for large repos.
# open the explorer on a TTY gorefact # focus the explorer on a package gorefact github.com/acme/tasks # structured report (non-TTY, or force with --format) gorefact internal/loader --format json | jq . gorefact internal/loader --format md
t # cycle picker: flat / folder / import tree g # cycle importers: grouped tree / flat m # toggle module-only / include externals enter # select package / expand struct or node / # fuzzy-search the picker e # open symbol or ref site in $EDITOR ? # toggle help q # quit (or ctrl+c)