repo-dive 0.4.3 → 0.6.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 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.** 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. Renamed from `repo-insighter` in 0.4.0.
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,22 +43,26 @@ 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. It is resumable: re-running skips everything already collected, and bumping a collector's version invalidates only that collector's outputs. Checkout-based collectors use temporary detached worktrees — the analyzed repo's working tree is never touched. Collectors so far:
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 and direct/dev dependencies from package-manager lockfiles, per package manager (pnpm so far; version-aware and monorepo-aware)
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)
54
59
 
55
- `index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` (a facts-by-categories cube, rebuildable at any time) plus `dashboard.json`, and `dashboard` serves a local React app with interactive charts: languages over time, monthly commits with AI-assisted share, churn, lint-suppression trends, dependency counts over time, code survival by cohort and author, and more.
60
+ `index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` (a facts-by-categories cube, rebuildable at any time) plus `dashboard.json`, and `dashboard` 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.
56
61
 
57
62
  ## Configuration
58
63
 
59
- Everything works with zero config. To refine it, drop a `repo-dive.config.ts` at the root of the repository you analyze (`.mjs`/`.js` also work):
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";
@@ -76,19 +82,28 @@ export default defineConfig({
76
82
  // How many contributors charts keep before folding the rest into "Other" (default 10).
77
83
  maxInCharts: 10,
78
84
  },
85
+ charts: {
86
+ // First day of the week in calendar-shaped charts (default "monday").
87
+ weekStartsOn: "monday",
88
+ },
79
89
  });
80
90
  ```
81
91
 
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). The config is read by `index`. See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
92
+ `charts.weekStartsOn` sets the first day of the week in calendar-shaped charts such as the commit calendar (`"monday"` by default, `"sunday"` also supported).
93
+ `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).
94
+ The config is read by `index`.
95
+ See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
83
96
 
84
97
  ## AI agents (MCP)
85
98
 
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. Two tools:
99
+ `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.
100
+ Two tools:
87
101
 
88
102
  - **`schema`** — tables, available metrics with row counts, sample category keys per metric and the commit range; worth calling before writing queries.
89
103
  - **`query`** — one read-only statement (`SELECT`/`WITH`/`EXPLAIN`) against the cube, returning `{ columns, rows, truncated }` (up to 200 rows).
90
104
 
91
- Run `scan` and `index` first: the server exits immediately if there is no cube at `.repo-dive/index/metrics.sqlite`. The database is opened read-only, so nothing an agent asks can change the catalog.
105
+ Run `scan` and `index` first: the server exits immediately if there is no cube at `.repo-dive/index/metrics.sqlite`.
106
+ The database is opened read-only, so nothing an agent asks can change the catalog.
92
107
 
93
108
  For [Claude Code](https://code.claude.com/docs/en/mcp), run this inside the repository you want to ask questions about:
94
109