@coderook/cli 0.46.11 → 0.46.12
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "coderook",
|
|
3
3
|
"displayName": "CodeRook",
|
|
4
4
|
"description": "Save, browse and restore whole-snapshot versions of a project on CodeRook, with cbx or plain git, from Claude Code.",
|
|
5
|
-
"version": "0.46.
|
|
5
|
+
"version": "0.46.12",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "ACCA Gaming Productions",
|
|
8
8
|
"url": "https://coderook.com"
|
package/dist/cli/src/cli.js
CHANGED
|
@@ -653,7 +653,8 @@ async function commandStatus(parsed) {
|
|
|
653
653
|
});
|
|
654
654
|
console.log(bold(node_path_1.default.basename(folder)) + dim(` ${folder}`));
|
|
655
655
|
console.log(link
|
|
656
|
-
|
|
656
|
+
/* "Account holds" read as the project's latest; it is what this folder is on (exercise 2). */
|
|
657
|
+
? `This folder is on ${accent(`v${link.sequence}`)} · ${Object.keys(link.manifest).length} ${Object.keys(link.manifest).length === 1 ? "file" : "files"} ${dim(`(${link.slug})`)}`
|
|
657
658
|
: dim("This folder is not linked to a project."));
|
|
658
659
|
if (!link) {
|
|
659
660
|
const likes = (0, folder_match_js_1.similarProjects)(await (0, api_js_2.projects)().catch(() => []), node_path_1.default.basename(folder));
|
|
@@ -1547,7 +1548,8 @@ Pass ${accent("--allow-secrets")} if these are not real keys.`);
|
|
|
1547
1548
|
if (plan.repositoryCreated)
|
|
1548
1549
|
createdRepositoryId = plan.repositoryId;
|
|
1549
1550
|
console.log(plan.estimated
|
|
1550
|
-
|
|
1551
|
+
/* Before compression: the summary's "sent" is after it, and the two read as a contradiction (exercise 2). */
|
|
1552
|
+
? `${accent("Upload plan")} ${bytes(plan.sourceBytes)} selected; ${bytes(plan.chargeableBytes)} of changes, compressed before sending.`
|
|
1551
1553
|
: `${accent("Upload plan")} ${bytes(plan.sourceBytes)} selected → ` +
|
|
1552
1554
|
`${bytes(plan.compactedBytes)} compacted; ${bytes(plan.chargeableBytes)} new storage.`);
|
|
1553
1555
|
console.log(plan.estimated
|
|
@@ -1725,8 +1727,9 @@ The connection failed: ${text}`));
|
|
|
1725
1727
|
*/
|
|
1726
1728
|
const repacked = Math.min(result.repackedFiles ?? 0, result.sentFiles);
|
|
1727
1729
|
const changedSent = result.sentFiles - repacked;
|
|
1728
|
-
console.log(`Saved ${accent(`v${result.sequence}`)} · sent ${bytes(result.sentBytes)}
|
|
1729
|
-
|
|
1730
|
+
console.log(`Saved ${accent(`v${result.sequence}`)} · sent ${bytes(result.sentBytes)} ` +
|
|
1731
|
+
/* "sent 565 B in 0 files, 11 removed" read as a failure; nothing but the list of changes went (exercise 2). */
|
|
1732
|
+
(changedSent ? `in ${changedSent} file${changedSent === 1 ? "" : "s"}` : "(the list of changes, no file contents)") +
|
|
1730
1733
|
(repacked ? ` (and re-packed ${repacked} unchanged small file${repacked === 1 ? "" : "s"} together)` : "") +
|
|
1731
1734
|
/*
|
|
1732
1735
|
Three different things, kept apart. Sent is what crossed the wire.
|
|
@@ -2090,8 +2093,9 @@ trackName) {
|
|
|
2090
2093
|
let result;
|
|
2091
2094
|
try {
|
|
2092
2095
|
result = await downloader.run(repositoryId, latest.id, destination, (progress) => {
|
|
2093
|
-
|
|
2094
|
-
|
|
2096
|
+
/* The bar and percent count bytes, the fraction files: "11% 284/298" read as a contradiction (exercise 2). */
|
|
2097
|
+
line(` ${track(progress.percent)} ${String(progress.percent).padStart(3)}% of the bytes ` +
|
|
2098
|
+
`${progress.files}/${progress.totalFiles} files ` +
|
|
2095
2099
|
dim(progress.path.slice(-40)));
|
|
2096
2100
|
},
|
|
2097
2101
|
// What this folder received last time, so a file the project has since
|
|
@@ -3208,6 +3212,23 @@ const SPECS = [
|
|
|
3208
3212
|
],
|
|
3209
3213
|
run: project_commands_js_1.commandVersions,
|
|
3210
3214
|
},
|
|
3215
|
+
{
|
|
3216
|
+
name: "files",
|
|
3217
|
+
aliases: ["ls"],
|
|
3218
|
+
group: "Versions and releases",
|
|
3219
|
+
summary: "what a saved version holds",
|
|
3220
|
+
usage: "files [project] [version]",
|
|
3221
|
+
detail: "Every file in a saved version, with its size. The current one unless you\n" +
|
|
3222
|
+
"name another (12 or v12). Run it inside a linked folder to leave the\n" +
|
|
3223
|
+
"project out; --path narrows it to one folder.",
|
|
3224
|
+
options: [
|
|
3225
|
+
{ flags: "--path <prefix>", description: "only files under this path, e.g. src/" },
|
|
3226
|
+
{ flags: "--version <n>", description: "which version (the second argument does the same)" },
|
|
3227
|
+
{ flags: "--json", description: "the list as JSON" },
|
|
3228
|
+
],
|
|
3229
|
+
examples: ["cbx files", "cbx files my-project 12 --path stress/"],
|
|
3230
|
+
run: project_commands_js_1.commandFiles,
|
|
3231
|
+
},
|
|
3211
3232
|
{
|
|
3212
3233
|
name: "workspace",
|
|
3213
3234
|
group: "Workspaces",
|
|
@@ -20,6 +20,7 @@ exports.splitVisibility = splitVisibility;
|
|
|
20
20
|
exports.offeredPublicly = offeredPublicly;
|
|
21
21
|
exports.agreed = agreed;
|
|
22
22
|
exports.commandVisibility = commandVisibility;
|
|
23
|
+
exports.commandFiles = commandFiles;
|
|
23
24
|
exports.commandVersions = commandVersions;
|
|
24
25
|
const node_process_1 = __importDefault(require("node:process"));
|
|
25
26
|
const promises_1 = require("node:readline/promises");
|
|
@@ -325,6 +326,47 @@ async function commandVisibility(parsed) {
|
|
|
325
326
|
return 0;
|
|
326
327
|
}
|
|
327
328
|
/** Every saved version of a project, newest first. */
|
|
329
|
+
/*
|
|
330
|
+
What a saved version holds: its files, with sizes.
|
|
331
|
+
|
|
332
|
+
There was no way to ask from the terminal. An agent checking that a rename
|
|
333
|
+
had been saved tried "cbx files", was told "Did you mean cbx rules?", and
|
|
334
|
+
had to piece it together from a diff (2026-11-11 exercise 2).
|
|
335
|
+
*/
|
|
336
|
+
async function commandFiles(parsed) {
|
|
337
|
+
const project = await resolveProject(parsed.positional[0]);
|
|
338
|
+
if (!project)
|
|
339
|
+
return 1;
|
|
340
|
+
const saved = await (0, api_js_1.versions)(project.id);
|
|
341
|
+
if (!saved.length) {
|
|
342
|
+
console.log((0, colour_js_1.dim)("Nothing has been saved to this project yet."));
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
const asked = parsed.positional[1] ?? (typeof parsed.flags.get("version") === "string" ? String(parsed.flags.get("version")) : undefined);
|
|
346
|
+
const sequence = asked ? Number(asked.replace(/^v/i, "")) : null;
|
|
347
|
+
const version = sequence !== null
|
|
348
|
+
? saved.find((one) => one.sequence === sequence)
|
|
349
|
+
: saved.find((one) => one.head) ?? saved[0];
|
|
350
|
+
if (!version) {
|
|
351
|
+
console.error((0, colour_js_1.red)(`${project.name} has no v${asked?.replace(/^v/i, "")}. cbx versions lists them.`));
|
|
352
|
+
return 1;
|
|
353
|
+
}
|
|
354
|
+
const prefix = typeof parsed.flags.get("path") === "string" ? String(parsed.flags.get("path")) : "";
|
|
355
|
+
const listed = await (0, api_js_1.callApi)(`/v1/repositories/${encodeURIComponent(project.id)}/versions/${encodeURIComponent(version.id)}/files`);
|
|
356
|
+
const files = (listed.files ?? [])
|
|
357
|
+
.map((one) => ({ path: String(one.path ?? ""), size: Number(one.sourceSize ?? 0) }))
|
|
358
|
+
.filter((one) => one.path.startsWith(prefix))
|
|
359
|
+
.sort((a, b) => a.path.localeCompare(b.path));
|
|
360
|
+
if (parsed.flags.get("json") === true) {
|
|
361
|
+
console.log(JSON.stringify({ version: version.sequence, files }, null, 2));
|
|
362
|
+
return 0;
|
|
363
|
+
}
|
|
364
|
+
console.log(`${(0, colour_js_1.bold)(project.name)} ${(0, colour_js_1.accent)(`v${version.sequence}`)} ` +
|
|
365
|
+
(0, colour_js_1.dim)(`${files.length.toLocaleString("en-US")} file${files.length === 1 ? "" : "s"}${prefix ? ` under ${prefix}` : ""}`));
|
|
366
|
+
for (const one of files)
|
|
367
|
+
console.log(` ${bytes(one.size).padStart(9)} ${one.path}`);
|
|
368
|
+
return 0;
|
|
369
|
+
}
|
|
328
370
|
async function commandVersions(parsed) {
|
|
329
371
|
const project = await resolveProject(parsed.positional[0]);
|
|
330
372
|
if (!project)
|
package/dist/cli/src/registry.js
CHANGED
|
@@ -41,7 +41,7 @@ exports.LISTING_ORDER = [
|
|
|
41
41
|
"status", "submit", "diff", "get", "track", "ignore", "licence",
|
|
42
42
|
"init", "save", "log", "restore", "switch", "push", "pull",
|
|
43
43
|
"tracks", "line-rules", "merges", "merge", "propose", "proposals", "pr",
|
|
44
|
-
"versions", "mark", "notes", "labels", "promote", "release", "releases", "attach", "held", "review", "undo",
|
|
44
|
+
"versions", "files", "mark", "notes", "labels", "promote", "release", "releases", "attach", "held", "review", "undo",
|
|
45
45
|
"take-down", "verify", "deps",
|
|
46
46
|
"about", "features", "visibility", "ai", "private", "upload-rules", "people", "watch", "hooks", "secret", "assistant",
|
|
47
47
|
"security", "pages", "fork", "hand-over", "delete",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderook/cli",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.12",
|
|
4
4
|
"description": "The command line for CodeRook (coderook.com): version control and project hosting for projects of any size. Every save is a compressed snapshot, private or public, never used to train AI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://coderook.com",
|