@pebblehouse/odin-cli 0.5.0 → 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/dist/index.js +19 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -311,14 +311,13 @@ decisionsCmd.command("get <slug> <id>").description("Get a decision by ID").acti
|
|
|
311
311
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
312
312
|
if (res.error) process.exit(1);
|
|
313
313
|
});
|
|
314
|
-
decisionsCmd.command("log <slug> <title>").description("Log a decision").option("--rationale <rationale>", "Decision rationale").option("--alternatives <alternatives>", "Alternatives considered").
|
|
314
|
+
decisionsCmd.command("log <slug> <title>").description("Log a decision").option("--rationale <rationale>", "Decision rationale").option("--alternatives <alternatives>", "Alternatives considered").action(async (slug, title, opts) => {
|
|
315
315
|
const res = await apiRequest(`/pebbles/${slug}/decisions`, {
|
|
316
316
|
method: "POST",
|
|
317
317
|
body: {
|
|
318
318
|
title,
|
|
319
319
|
rationale: opts.rationale,
|
|
320
|
-
alternatives_considered: opts.alternatives
|
|
321
|
-
session_id: opts.sessionId
|
|
320
|
+
alternatives_considered: opts.alternatives
|
|
322
321
|
}
|
|
323
322
|
});
|
|
324
323
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
@@ -428,7 +427,7 @@ plansCmd.command("delete-phase <slug> <planId> <phaseId>").description("Delete a
|
|
|
428
427
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
429
428
|
if (res.error) process.exit(1);
|
|
430
429
|
});
|
|
431
|
-
plansCmd.command("add-phase-link <slug> <planId> <phaseId>").description("Add a link from a phase to a spec or document").requiredOption("--link-type <type>", "Link type (spec|plan_doc)").requiredOption("--target-type <type>", "Target type (
|
|
430
|
+
plansCmd.command("add-phase-link <slug> <planId> <phaseId>").description("Add a link from a phase to a spec or document").requiredOption("--link-type <type>", "Link type (spec|plan_doc)").requiredOption("--target-type <type>", "Target type (artifact|document)").requiredOption("--target-id <id>", "Target entity UUID").action(async (slug, planId, phaseId, opts) => {
|
|
432
431
|
const res = await apiRequest(`/pebbles/${slug}/plans/${planId}/phases/${phaseId}/links`, {
|
|
433
432
|
method: "POST",
|
|
434
433
|
body: {
|
|
@@ -448,53 +447,52 @@ plansCmd.command("remove-phase-link <slug> <planId> <phaseId> <linkId>").descrip
|
|
|
448
447
|
if (res.error) process.exit(1);
|
|
449
448
|
});
|
|
450
449
|
|
|
451
|
-
// src/commands/
|
|
450
|
+
// src/commands/artifacts.ts
|
|
452
451
|
import { Command as Command7 } from "commander";
|
|
453
452
|
import { readFileSync as readFileSync5 } from "fs";
|
|
454
|
-
var
|
|
455
|
-
|
|
453
|
+
var artifactsCmd = new Command7("artifacts").description("Manage artifacts");
|
|
454
|
+
artifactsCmd.command("list <slug>").description("List artifacts for a pebble").option("--source <source>", "Filter by source (claude-code, superpowers, etc.)").action(async (slug, opts) => {
|
|
456
455
|
const params = {};
|
|
457
456
|
if (opts.source) params.source = opts.source;
|
|
458
|
-
const res = await apiRequest(`/pebbles/${slug}/
|
|
457
|
+
const res = await apiRequest(`/pebbles/${slug}/artifacts`, { params });
|
|
459
458
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
460
459
|
if (res.error) process.exit(1);
|
|
461
460
|
});
|
|
462
|
-
|
|
463
|
-
const res = await apiRequest(`/pebbles/${slug}/
|
|
461
|
+
artifactsCmd.command("get <slug> <id>").description("Get an artifact by ID").action(async (slug, id) => {
|
|
462
|
+
const res = await apiRequest(`/pebbles/${slug}/artifacts/${id}`);
|
|
464
463
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
465
464
|
if (res.error) process.exit(1);
|
|
466
465
|
});
|
|
467
|
-
|
|
466
|
+
artifactsCmd.command("create <slug> <title>").description("Create an artifact").requiredOption("--type <type>", "Artifact type (e.g. brainstorm, plan, research, spec)").option("--source <source>", "Source agent", "claude-code").option("--content <content>", "Artifact content").option("--file <path>", "Read content from file").action(async (slug, title, opts) => {
|
|
468
467
|
const content = opts.file ? readFileSync5(opts.file, "utf-8") : opts.content ?? "";
|
|
469
|
-
const res = await apiRequest(`/pebbles/${slug}/
|
|
468
|
+
const res = await apiRequest(`/pebbles/${slug}/artifacts`, {
|
|
470
469
|
method: "POST",
|
|
471
470
|
body: {
|
|
472
471
|
title,
|
|
473
|
-
|
|
472
|
+
type: opts.type,
|
|
474
473
|
source: opts.source,
|
|
475
|
-
content
|
|
476
|
-
session_id: opts.sessionId ?? null
|
|
474
|
+
content
|
|
477
475
|
}
|
|
478
476
|
});
|
|
479
477
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
480
478
|
if (res.error) process.exit(1);
|
|
481
479
|
});
|
|
482
|
-
|
|
480
|
+
artifactsCmd.command("update <slug> <id>").description("Update an artifact").option("--title <title>", "New title").option("--type <type>", "New type").option("--source <source>", "New source").option("--content <content>", "New content").option("--file <path>", "Read content from file").action(async (slug, id, opts) => {
|
|
483
481
|
const body = {};
|
|
484
482
|
if (opts.title) body.title = opts.title;
|
|
485
|
-
if (opts.
|
|
483
|
+
if (opts.type) body.type = opts.type;
|
|
486
484
|
if (opts.source) body.source = opts.source;
|
|
487
485
|
if (opts.file) body.content = readFileSync5(opts.file, "utf-8");
|
|
488
486
|
else if (opts.content) body.content = opts.content;
|
|
489
|
-
const res = await apiRequest(`/pebbles/${slug}/
|
|
487
|
+
const res = await apiRequest(`/pebbles/${slug}/artifacts/${id}`, {
|
|
490
488
|
method: "PUT",
|
|
491
489
|
body
|
|
492
490
|
});
|
|
493
491
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
494
492
|
if (res.error) process.exit(1);
|
|
495
493
|
});
|
|
496
|
-
|
|
497
|
-
const res = await apiRequest(`/pebbles/${slug}/
|
|
494
|
+
artifactsCmd.command("delete <slug> <id>").description("Delete an artifact").action(async (slug, id) => {
|
|
495
|
+
const res = await apiRequest(`/pebbles/${slug}/artifacts/${id}`, {
|
|
498
496
|
method: "DELETE"
|
|
499
497
|
});
|
|
500
498
|
process.stdout.write(JSON.stringify(res) + "\n");
|
|
@@ -624,7 +622,7 @@ program.addCommand(decisionsCmd);
|
|
|
624
622
|
program.addCommand(contextCmd);
|
|
625
623
|
program.addCommand(searchCmd);
|
|
626
624
|
program.addCommand(plansCmd);
|
|
627
|
-
program.addCommand(
|
|
625
|
+
program.addCommand(artifactsCmd);
|
|
628
626
|
program.addCommand(versionsCmd);
|
|
629
627
|
program.addCommand(guidelinesCmd);
|
|
630
628
|
process.on("exit", () => {
|