Go · Imports · References

Browse every package.
See who depends on it.

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

Imports in. References out.

Browse a module's packages, read off a package's public API, and trace exactly who depends on it — down to individual reference sites.

Package picker

Browse a module's packages as a flat list, a folder tree nested by path segment, or an import tree nested by dependency edge.

Public API view

A package's exported const, var, func, and types — structs and interfaces expand inline into their exported methods and fields.

Importers & usage

See who imports a package, flat or as a tree, then drill into CallerPkg.CallerFunc → Symbol reference sites with file:line.

Pick your format

Interactive TUI on a terminal, or structured text, JSON, and Markdown reports — pipe into jq, less, or your editor.

Install

Get gorefact in 30 seconds

Pick the install path that matches your setup.

Tap the repo and install:

brew tap flaticols/apps
brew install flaticols/apps/gorefact

Install globally with go install:

go install go.flaticols.dev/gorefactor/cmd/gorefact@latest

Or pin it per-module as a Go tool dependency (Go 1.24+):

go get -tool go.flaticols.dev/gorefactor/cmd/gorefact@latest
go tool gorefact ./...

Install into your profile:

nix profile install github:flaticols/gorefactor

Or wire it up as a flake input:

inputs.gorefactor.url = "github:flaticols/gorefactor";

macOS archives (amd64, arm64):

Download the latest .tar.gz from the releases page, extract, and drop gorefact onto your $PATH.

Usage

Explore on a TTY, or pipe a report

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.

Run it

# 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

TUI keys

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)