Skip to content

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dig

CI Release Go version License: MIT

πŸ” A single static Go binary that turns any git repository into a self-contained HTML code-archaeology report.

$ dig --out report.html ../some-repo
$ open report.html

Note: flags must come before the positional <repo-path> argument (standard Go flag behaviour).

One HTML file. Zero network. Zero CDN. Zero JS framework. The report works offline, can be emailed as an attachment, and renders the same in any modern browser.

dig report on cli/cli β€” 11,470 commits, 711 contributors, 6.8 years of history

Above: dig rendered against cli/cli β€” the official GitHub command-line tool. 11,470 commits, 711 contributors, 81 months of activity, bus factor 8.

What you get

A single report.html containing:

  • Project header β€” name, age, total commits, contributors, file count, dominant language.
  • Timeline β€” commit activity per month across the repo's lifetime.
  • Contributors β€” table sorted by commit share, with a horizontal bar visualisation.
  • Bus factor β€” the smallest set of contributors whose removal would orphan >50% of recent commits. Honest definition; see docs/spec.md.
  • Hot files β€” the files touched most often across all refs. If it breaks, who do you call.
  • Languages β€” file-extension histogram with line counts.
  • First commit β€” verbatim message plus a --stat of the day-one tree, so you can see what the project looked like at the start.
  • Latest commit β€” the same, for "where we are now."
  • README excerpt β€” the first 80 non-empty lines of the project's README if one exists.
  • Changes since <base> (only when --base is set) β€” commit diff, new/departed contributors, hot-file shifts, language line deltas, and the bus-factor shift between the base ref and HEAD.

Install

  • Pre-built binaries: download from releases β€” linux/amd64+arm64, darwin/amd64+arm64, windows/amd64 (+SHA256SUMS)
go install github.com/NovaLux12/dig@latest

Or build from source:

git clone https://github.com/NovaLux12/dig
cd dig && go build -o dig .

Requires Go 1.26+ and a git binary on $PATH.

Usage

dig <repo-path>                             # writes dig-report.html in CWD
dig --out report.html <repo-path>           # custom output path
dig --accent #ff5577 <repo-path>            # custom accent colour
dig --since 12mo <repo-path>                # restrict analysis window
dig --base v1.0 <repo-path>                 # compare against a ref; emit a delta report
dig --json report.json <repo-path>          # also emit machine-readable JSON
dig --top 10 <repo-path>                    # show only top 10 hot files
dig --json report.json --top 5 <repo-path>  # JSON keeps full data; HTML is truncated
dig --help

dig is read-only. It never modifies, stages, or commits anything in the target repo.

Compare mode

--base <ref> walks the commit log for an arbitrary ref (branch, tag, or SHA prefix) and emits the delta against the current state. The resulting HTML includes a "Changes since <ref>" section listing the commits added and removed, new and departed contributors, hot files only in one side or the other, language line deltas, and the bus-factor shift:

dig --base v1.0 ../my-repo          # changes since the v1.0 tag
dig --base main ../feature-branch   # changes between branches
dig --base 7a4e2c1 ../repo          # changes since a specific SHA

Exit codes: 0 success, 1 not a git repo, 2 git not installed, 3 other I/O.

Design

Single static binary, stdlib only (no go-git, no template engines, no Chart.js). All HTML, CSS, and SVG is generated in-process and embedded in the output file. The git binary is the source of truth for diff parsing and rename detection.

See docs/spec.md for the full design.

Why

Code archaeology is a real thing. When you join a project, or come back to one after a year away, or take over maintenance, the first questions are always the same: who else knows this code? what's been hot lately? what's the bus factor? what did this thing look like on day one?

Most answers are scattered across git log, GitHub's UI, git blame, and institutional memory. dig pulls them into one page.

License

MIT. See LICENSE.

Related

About

πŸ” dig β€” generate a self-contained HTML code-archaeology report from any git repo. Single static Go binary, zero deps, beautiful output.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages