repo-dive 0.4.3 → 0.5.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 +17 -7
- package/dist/cli.js +621 -408
- package/dist/dashboard/assets/index-C14X9C30.css +2 -0
- package/dist/dashboard/assets/index-pmZJEtjU.js +9 -0
- package/dist/dashboard/index.html +2 -2
- package/package.json +9 -4
- package/dist/dashboard/assets/index-BWfLWCwb.css +0 -2
- package/dist/dashboard/assets/index-Bazp6SwA.js +0 -9
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Dive into a git repository's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard.
|
|
4
4
|
|
|
5
|
-
> **Still 0.x.**
|
|
5
|
+
> **Still 0.x.**
|
|
6
|
+
> The pipeline works end to end and has been run against repositories with tens of thousands of commits, but interfaces, the catalog format and the collector roster still move between minor versions — pin the version if you script against it.
|
|
7
|
+
> Renamed from `repo-insighter` in 0.4.0.
|
|
6
8
|
|
|
7
9
|
## What it does
|
|
8
10
|
|
|
@@ -41,13 +43,16 @@ npx repo-dive mcp # serve the cube to AI agents (Model Context Protocol)
|
|
|
41
43
|
npx repo-dive gc # clean up the catalog interactively
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
`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.
|
|
46
|
+
`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.
|
|
47
|
+
It is resumable: re-running skips everything already collected, and bumping a collector's version invalidates only that collector's outputs.
|
|
48
|
+
Checkout-based collectors use temporary detached worktrees — the analyzed repo's working tree is never touched.
|
|
49
|
+
Collectors so far:
|
|
45
50
|
|
|
46
51
|
- **commit-meta** — identities, dates, parents, subject and trailers (incl. AI co-authors)
|
|
47
52
|
- **churn** — lines added/deleted per commit, by file extension
|
|
48
53
|
- **file-types** — file count and bytes per extension at each commit's tree
|
|
49
54
|
- **directives** — eslint-disable comments by rule (block disables tracked as gray areas) and `@ts-ignore`/`@ts-expect-error`/`@ts-nocheck`
|
|
50
|
-
- **dependencies** — total resolved packages
|
|
55
|
+
- **dependencies** — total resolved packages from package-manager lockfiles, per package manager (pnpm, npm and yarn — classic and berry; version-aware and monorepo-aware, extensible to more managers), plus direct/dev/optional dependencies and the number of manifests read straight from `package.json` files
|
|
51
56
|
- **todo-comments** — TODO/FIXME/HACK/XXX counts
|
|
52
57
|
- **languages** — tokei language/LOC breakdown (sampled monthly; markdown counted whole)
|
|
53
58
|
- **survival** — `git blame` line survival by extension, author and age cohort (sampled monthly)
|
|
@@ -56,7 +61,8 @@ npx repo-dive gc # clean up the catalog interactively
|
|
|
56
61
|
|
|
57
62
|
## Configuration
|
|
58
63
|
|
|
59
|
-
Everything works with zero config.
|
|
64
|
+
Everything works with zero config.
|
|
65
|
+
To refine it, drop a `repo-dive.config.ts` at the root of the repository you analyze (`.mjs`/`.js` also work):
|
|
60
66
|
|
|
61
67
|
```ts
|
|
62
68
|
import { defineConfig } from "repo-dive/config";
|
|
@@ -79,16 +85,20 @@ export default defineConfig({
|
|
|
79
85
|
});
|
|
80
86
|
```
|
|
81
87
|
|
|
82
|
-
`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; a group can also carry a `displayName`, a profile `url` and a `kind` (`human`/`bot`/`ai`, otherwise auto-derived — the dashboard badges bots and AI agents and lists them apart from humans).
|
|
88
|
+
`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; a group can also carry a `displayName`, a profile `url` and a `kind` (`human`/`bot`/`ai`, otherwise auto-derived — the dashboard badges bots and AI agents and lists them apart from humans).
|
|
89
|
+
The config is read by `index`.
|
|
90
|
+
See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
|
|
83
91
|
|
|
84
92
|
## AI agents (MCP)
|
|
85
93
|
|
|
86
|
-
`repo-dive mcp` serves the metrics cube over the Model Context Protocol on stdio, so an agent can explore a repository's history by asking SQL questions.
|
|
94
|
+
`repo-dive mcp` serves the metrics cube over the Model Context Protocol on stdio, so an agent can explore a repository's history by asking SQL questions.
|
|
95
|
+
Two tools:
|
|
87
96
|
|
|
88
97
|
- **`schema`** — tables, available metrics with row counts, sample category keys per metric and the commit range; worth calling before writing queries.
|
|
89
98
|
- **`query`** — one read-only statement (`SELECT`/`WITH`/`EXPLAIN`) against the cube, returning `{ columns, rows, truncated }` (up to 200 rows).
|
|
90
99
|
|
|
91
|
-
Run `scan` and `index` first: the server exits immediately if there is no cube at `.repo-dive/index/metrics.sqlite`.
|
|
100
|
+
Run `scan` and `index` first: the server exits immediately if there is no cube at `.repo-dive/index/metrics.sqlite`.
|
|
101
|
+
The database is opened read-only, so nothing an agent asks can change the catalog.
|
|
92
102
|
|
|
93
103
|
For [Claude Code](https://code.claude.com/docs/en/mcp), run this inside the repository you want to ask questions about:
|
|
94
104
|
|