repo-dive 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -16
- package/dist/cli.js +2651 -2104
- package/dist/dashboard/assets/index-BUMg5mjh.js +9 -0
- package/dist/dashboard/assets/index-I183mcU_.css +2 -0
- package/dist/dashboard/index.html +2 -2
- package/package.json +15 -14
- package/dist/dashboard/assets/index-BHAI3PZl.js +0 -9
- package/dist/dashboard/assets/index-DFKSaas-.css +0 -2
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# repo-dive
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_Dive into a git repo's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard_ <!-- markdownlint-disable-line MD036 -- a tagline, not a heading -->
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/repo-dive)
|
|
6
|
+
[](https://www.npmjs.com/package/repo-dive)
|
|
7
|
+
[](LICENSE.md)
|
|
8
|
+
[](https://effect.website)
|
|
9
|
+
[](#ai-agents-mcp)
|
|
8
10
|
|
|
9
11
|
## What it does
|
|
10
12
|
|
|
11
|
-
Point
|
|
13
|
+
Point `repo-dive` at any git repository and get an explorable catalog of insights derived from its history:
|
|
12
14
|
|
|
13
15
|
```sh
|
|
14
16
|
cd /path/to/your/repo
|
|
@@ -19,18 +21,31 @@ One command runs the whole pipeline — scan, index, dashboard — and opens the
|
|
|
19
21
|
|
|
20
22
|
- **Map**: walk the repo's commits (all or sampled) and let pluggable collectors capture raw snapshots per commit — language/LOC breakdowns, author stats, lint diagnostics and more.
|
|
21
23
|
- **Reduce**: index those snapshots into a local metrics store shaped like a data cube — numbers at intersections of open-ended categories (author, language, date, lint rule, …).
|
|
22
|
-
- **Explore**: query the cube to draw charts,
|
|
24
|
+
- **Explore**: query the cube to draw charts, export shareable reports and ask AI questions about how the codebase evolved.
|
|
23
25
|
|
|
24
26
|
Everything is local-first, incremental and resumable: results live in a catalog folder inside the repo being analyzed and are refined over multiple runs.
|
|
25
27
|
|
|
26
28
|
See [docs/specs](docs/specs/README.md) for the architecture and [docs/research/prior-art.md](docs/research/prior-art.md) for a survey of existing tools and why none of them fills this niche.
|
|
27
29
|
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Live dashboards for a few popular repositories, produced by running the tool on their full history:
|
|
33
|
+
|
|
34
|
+
- [curl](https://kachkaev.github.io/repo-dive/examples/curl/) (C, since 1999)
|
|
35
|
+
- [ollama](https://kachkaev.github.io/repo-dive/examples/ollama/) (Go, since 2023)
|
|
36
|
+
- [prettier](https://kachkaev.github.io/repo-dive/examples/prettier/) (JavaScript, since 2016)
|
|
37
|
+
- [react](https://kachkaev.github.io/repo-dive/examples/react/) (JavaScript, since 2013)
|
|
38
|
+
- [transformers](https://kachkaev.github.io/repo-dive/examples/transformers/) (Python, since 2018)
|
|
39
|
+
- [vite](https://kachkaev.github.io/repo-dive/examples/vite/) (TypeScript, since 2020)
|
|
40
|
+
|
|
41
|
+
Each one is a single self-contained HTML file exported with `repo-dive report` and redeployed weekly by [a scheduled workflow](.github/workflows/examples.yaml) — see [examples](examples/README.md) for how they are defined.
|
|
42
|
+
|
|
28
43
|
## Usage
|
|
29
44
|
|
|
30
|
-
Run from inside the repository you want to analyze (or pass `--repo /path/to/repo`)
|
|
45
|
+
Run from inside the repository you want to analyze (or pass `--repo /path/to/repo`).
|
|
46
|
+
Node 22.13 or newer is required.
|
|
31
47
|
|
|
32
48
|
```sh
|
|
33
|
-
cd /path/to/your/repo
|
|
34
49
|
npx repo-dive # the whole pipeline: scan + index + dashboard
|
|
35
50
|
npx repo-dive scan # collect snapshots into .repo-dive/
|
|
36
51
|
npx repo-dive index # roll up into the metrics cube + dashboard data
|
|
@@ -38,10 +53,10 @@ npx repo-dive dashboard # serve the interactive dashboard
|
|
|
38
53
|
npx repo-dive status # show catalog coverage
|
|
39
54
|
npx repo-dive collectors # list available collectors
|
|
40
55
|
npx repo-dive report # export one shareable self-contained HTML file
|
|
56
|
+
npx repo-dive mcp # serve the cube to AI agents (Model Context Protocol)
|
|
57
|
+
npx repo-dive gc # clean up the catalog interactively
|
|
58
|
+
npx repo-dive ignore # keep other tools out of the catalog
|
|
41
59
|
npx repo-dive query "SELECT metric, sum(value) FROM facts GROUP BY metric"
|
|
42
|
-
npx repo-dive mcp # serve the cube to AI agents (Model Context Protocol)
|
|
43
|
-
npx repo-dive gc # clean up the catalog interactively
|
|
44
|
-
npx repo-dive ignore # keep other tools out of the catalog
|
|
45
60
|
```
|
|
46
61
|
|
|
47
62
|
`scan` walks the repository's history and runs collectors against every commit (or a sample, per collector), writing raw snapshots into a `.repo-dive/` catalog inside the analyzed repo.
|
|
@@ -53,15 +68,16 @@ Collectors so far:
|
|
|
53
68
|
- **churn** — lines added/deleted per commit, by file extension
|
|
54
69
|
- **file-types** — file count and bytes per extension at each commit's tree
|
|
55
70
|
- **directives** — eslint-disable comments by rule (block disables tracked as gray areas) and `@ts-ignore`/`@ts-expect-error`/`@ts-nocheck`
|
|
56
|
-
- **dependencies** —
|
|
71
|
+
- **dependencies** — resolved package totals from lockfiles, per package manager (pnpm, npm, yarn classic and yarn berry), plus direct/dev/optional dependencies and manifest counts read straight from `package.json` files; version-aware, monorepo-aware and extensible to more managers
|
|
57
72
|
- **todo-comments** — TODO/FIXME/HACK/XXX counts
|
|
58
73
|
- **languages** — lines and file count per language across a commit's source files (lockfiles, minified bundles and generated data excluded)
|
|
59
74
|
- **survival** — `git blame` line survival by extension, author and age cohort (sampled monthly)
|
|
60
75
|
|
|
61
76
|
The catalog hides itself from git, but other tools that walk the repository (prettier, markdownlint, cspell, docker builds) each read one ignore file at its root.
|
|
62
|
-
`scan` warns when the catalog is missing from those; `repo-dive ignore` adds it to every one
|
|
77
|
+
`scan` warns when the catalog is missing from those; `repo-dive ignore` adds it to every one that needs it, writing the entry in the shape the file is already written in and skipping the files whose tool learns about the catalog elsewhere.
|
|
63
78
|
|
|
64
|
-
`index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite`
|
|
79
|
+
`index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` — a facts-by-categories cube, rebuildable at any time — plus `dashboard.json`.
|
|
80
|
+
`dashboard` then serves a local React app with interactive charts: languages over time, a GitHub-style commit calendar, monthly commits with AI-assisted share, churn, lint-suppression trends, dependency counts over time, code survival by cohort and author, and more.
|
|
65
81
|
|
|
66
82
|
## Configuration
|
|
67
83
|
|
|
@@ -98,7 +114,9 @@ export default defineConfig({
|
|
|
98
114
|
```
|
|
99
115
|
|
|
100
116
|
`charts.weekStartsOn` sets the first day of the week in calendar-shaped charts such as the commit calendar (`"monday"` by default, `"sunday"` also supported).
|
|
101
|
-
`contributors.aliases` merges the multiple identities one person commits under (work + personal email, GitHub noreply, name variants) so attribution, the contributors table and code-survival-by-contributor count them once
|
|
117
|
+
`contributors.aliases` merges the multiple identities one person commits under (work + personal email, GitHub noreply, name variants) so attribution, the contributors table and code-survival-by-contributor count them once.
|
|
118
|
+
A group can also carry a `displayName`, a profile `url` and a `kind` (`human`/`bot`/`ai`, otherwise auto-derived).
|
|
119
|
+
The dashboard badges bots and AI agents, listing them apart from humans.
|
|
102
120
|
`catalog.dir` moves the catalog; point it outside the repository (e.g. `"../repo-dive-catalogs/my-repo"`) to leave the analyzed working tree untouched altogether, ignore files included.
|
|
103
121
|
Apart from `catalog`, which every command needs, the config is read by `index`.
|
|
104
122
|
See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
|
|
@@ -148,9 +166,18 @@ pnpm lint
|
|
|
148
166
|
pnpm fix
|
|
149
167
|
```
|
|
150
168
|
|
|
169
|
+
To see how heavy the published package would be:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
pnpm build && pnpm report-package-size
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
It prints the tarball and unpacked sizes with a per-file breakdown, comparing them against the previous measurement.
|
|
176
|
+
CI runs the same report on every push and adds it to the job summary, comparing against the latest `main`.
|
|
177
|
+
|
|
151
178
|
## Acknowledgements
|
|
152
179
|
|
|
153
|
-
Thanks to [@WillJack20](https://github.com/WillJack20) for suggesting the name
|
|
180
|
+
Thanks to [@WillJack20](https://github.com/WillJack20) for suggesting the name `repo-dive`, formerly [repo-insighter](https://www.npmjs.com/package/repo-insighter).
|
|
154
181
|
|
|
155
182
|
## License
|
|
156
183
|
|