seerepo 1.2.2 → 1.3.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/bin/seerepo.js CHANGED
@@ -26,6 +26,7 @@ import { connect } from "../lib/connect.js";
26
26
  import { BASE, CONFIG, VERSION, command, die, get } from "../lib/core.js";
27
27
  import { mcp } from "../lib/mcp.js";
28
28
  import { changes, docs, found, health, history, impact, map, open, pages } from "../lib/read.js";
29
+ import { files } from "../lib/files.js";
29
30
 
30
31
  const HELP = `seerepo ${VERSION}: your project's map from the terminal
31
32
 
@@ -36,6 +37,8 @@ Usage:
36
37
  seerepo map [path] A world of the map, like / or /checkout
37
38
  seerepo changes [--since] What changed: the last 24 hours, or since a date (2026-10-19)
38
39
  seerepo impact <file> What depends on a file: who names it, how many, which pages and processes (--name x, --to file)
40
+ seerepo files [folder] What's in the repo and how much it weighs: a folder, or --whole for the heaviest
41
+ (--sort size|lines|changes|untested|unused, --class image, --limit 100)
39
42
  seerepo pages Every page of the app: who gets in and the states it handles or misses
40
43
  seerepo found How search engines and AI see each public page, and what needs work
41
44
  seerepo health [n] What's worth fixing: how many things, whether it can ship and the tasks; with n, that task's prompt
@@ -78,7 +81,7 @@ async function login() {
78
81
 
79
82
 
80
83
 
81
- const commands = { login, connect, mcp, map, changes, impact, pages, found, health, history, docs, open, ignore, false: markFalse, snooze, accept, claim };
84
+ const commands = { login, connect, mcp, map, changes, impact, files, pages, found, health, history, docs, open, ignore, false: markFalse, snooze, accept, claim };
82
85
  if (!command || command === "--help" || command === "-h" || command === "help") console.log(HELP);
83
86
  else if (command === "--version" || command === "-v") console.log(VERSION);
84
87
  else if (commands[command]) await commands[command]();
package/lib/files.js ADDED
@@ -0,0 +1,42 @@
1
+ // The repo's files (decision 209): one folder with its sums, its folders by weight and its files, or the whole repo by a column
2
+ import { flag, get, rest, whichRepo } from "./core.js";
3
+
4
+ const weight = (b) => (b === null || b === undefined ? "size unknown" : b >= 1e6 ? `${(b / 1e6).toFixed(1)} MB` : b >= 1e3 ? `${Math.round(b / 1e3)} KB` : `${b} B`);
5
+ const MARKS = { generated: "generated", vendored: "copied in", static: "served as is", lfs: "in LFS", submodule: "submodule" };
6
+
7
+ const fileLine = (f) => {
8
+ const said = [weight(f.size), f.class, ...f.flags.map((m) => MARKS[m] || m)];
9
+ if (f.code) {
10
+ if (f.code.lines !== null) said.push(`${f.code.lines} lines`);
11
+ said.push(f.code.tested ? "tested" : "no test");
12
+ if (f.code.unused) said.push("unused");
13
+ if (f.code.changedDays) said.push(`${f.code.changedDays} days changed in 30`);
14
+ if (f.code.tasks) said.push(`${f.code.tasks} in health`);
15
+ }
16
+ return ` ${f.path} ${said.join(" · ")}`;
17
+ };
18
+
19
+ export async function files() {
20
+ const repo = await whichRepo();
21
+ // flag() takes each one out of the arguments: read them all before the folder
22
+ const [sort, kind, limit] = [flag("sort"), flag("class"), flag("limit")];
23
+ const whole = rest.includes("--whole");
24
+ const path = rest.find((a) => !a.startsWith("--"));
25
+ const q = new URLSearchParams({ sort: sort || "size" });
26
+ if (path) q.set("path", path);
27
+ if (whole) q.set("whole", "1");
28
+ if (kind) q.set("class", kind);
29
+ if (limit) q.set("limit", limit);
30
+ const x = await get(`/repos/${repo.id}/files?${q}`);
31
+ const lines = [];
32
+ if (x.whole) lines.push(`${x.repo.name}: ${x.class ? `${x.class} files` : "files"} by ${x.sort}${x.total > x.files.length ? ` (${x.files.length} of ${x.total})` : ""}`, ...x.files.map(fileLine));
33
+ else {
34
+ const t = x.totals;
35
+ lines.push(`${x.path} · ${x.repo.name}: ${t.files} files, ${t.folders} folders, ${weight(t.size)}`);
36
+ if (x.folders.length) lines.push("", ...x.folders.slice(0, 30).map((f) => ` ${f.path}/ ${f.files} files · ${weight(f.size)}`));
37
+ if (x.files.length) lines.push("", ...x.files.map(fileLine));
38
+ }
39
+ if (x.read.partial) lines.push("", "GitHub sent only part of the tree: some files have no size.");
40
+ if (x.read.ignored) lines.push("", `${x.read.ignored} ignored paths are not listed.`);
41
+ console.log(lines.join("\n"));
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seerepo",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "SeeRepo from your terminal: your project's map, what changed, and a world in the browser.",
5
5
  "type": "module",
6
6
  "bin": {