@clipdone/cli 0.1.14 → 0.1.15

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
@@ -51,8 +51,18 @@ List and create projects:
51
51
  ```bash
52
52
  clipdone projects
53
53
  clipdone projects create --name "Marketing video"
54
+ clipdone projects create --name "Acme launch" --workspace <workspace_id> --client <client_id>
55
+ clipdone projects --workspace <workspace_id>
56
+ clipdone projects <project_id> update --workspace <workspace_id> --client <client_id>
57
+ clipdone projects <project_id> update --client <client_id> --use-client-style
58
+ clipdone projects <project_id> update --clear-workspace --clear-client
54
59
  ```
55
60
 
61
+ Use `--clear-client` to unassign a client while keeping the workspace, or
62
+ `--clear-workspace` to remove the video from its workspace (which also clears
63
+ its client). `--use-client-style` adopts the assigned client's current Brand
64
+ Style; it can be combined with `--client <id>` when changing assignment.
65
+
56
66
  Upload files:
57
67
 
58
68
  ```bash
@@ -73,9 +83,14 @@ clipdone outputs <output_id> download --out ./clipdone-output.mp4
73
83
  Create a revision from feedback:
74
84
 
75
85
  ```bash
76
- clipdone projects <project_id> revise --feedback "Make the intro tighter."
86
+ clipdone projects <project_id> outputs
87
+ clipdone projects <project_id> revise --source-output <output_id> --feedback "Make the intro tighter."
77
88
  ```
78
89
 
90
+ Revisions are tied to the exact completed output you reviewed. `--source-output`
91
+ is required for feedback and subtitle revisions; the API uses the same output ID
92
+ in `sourceOutputVersionId` with `intent: "revision"`.
93
+
79
94
  Run `clipdone --help` for the full command list.
80
95
 
81
96
  ## Automation
package/bin/clipdone.js CHANGED
@@ -800,7 +800,7 @@ function parseProjectScopedCommand(args, parts, action, actionIndex) {
800
800
  );
801
801
  }
802
802
  if (canonicalAction === "create") {
803
- requireExactPositionals(parts, actionIndex + 1, "clipdone projects create [--name <name>] [--description <text>]");
803
+ requireExactPositionals(parts, actionIndex + 1, "clipdone projects create [--name <name>] [--description <text>] [--workspace <id>] [--client <id>]");
804
804
  return { key: "project-create" };
805
805
  }
806
806
  if (!args.project) {
@@ -809,9 +809,9 @@ function parseProjectScopedCommand(args, parts, action, actionIndex) {
809
809
  if (canonicalAction === "upload") {
810
810
  const fileIndex = actionIndex + 1;
811
811
  if (typeof parts[fileIndex] !== "string") {
812
- throw commandUsageError("Missing file path.", "clipdone projects <project_id> upload <file> --type footage|music|script");
812
+ throw commandUsageError("Missing file path.", "clipdone projects <project_id> upload <file> --type footage|music|script|reference");
813
813
  }
814
- requireExactPositionals(parts, fileIndex + 1, "clipdone projects <project_id> upload <file> --type footage|music|script");
814
+ requireExactPositionals(parts, fileIndex + 1, "clipdone projects <project_id> upload <file> --type footage|music|script|reference");
815
815
  if (!args.file) args.file = parts[fileIndex];
816
816
  return { key: "project-upload" };
817
817
  }
@@ -838,9 +838,9 @@ function parseProjectCommand(args, parts) {
838
838
  if (!args.project) args.project = parts[2];
839
839
  if (secondAction === "upload") {
840
840
  if (typeof parts[3] !== "string") {
841
- throw commandUsageError("Missing file path.", "clipdone project upload <project_id> <file> --type footage|music|script");
841
+ throw commandUsageError("Missing file path.", "clipdone project upload <project_id> <file> --type footage|music|script|reference");
842
842
  }
843
- requireExactPositionals(parts, 4, "clipdone project upload <project_id> <file> --type footage|music|script");
843
+ requireExactPositionals(parts, 4, "clipdone project upload <project_id> <file> --type footage|music|script|reference");
844
844
  if (!args.file) args.file = parts[3];
845
845
  return { key: "project-upload" };
846
846
  }
@@ -930,9 +930,9 @@ function parseLegacyCommand(args, parts) {
930
930
  }
931
931
  if (command === "upload") {
932
932
  if (typeof parts[1] !== "string") {
933
- throw commandUsageError("Missing file path.", "clipdone upload <file> --project <project_id> --type footage|music|script");
933
+ throw commandUsageError("Missing file path.", "clipdone upload <file> --project <project_id> --type footage|music|script|reference");
934
934
  }
935
- requireExactPositionals(parts, 2, "clipdone upload <file> --project <project_id> --type footage|music|script");
935
+ requireExactPositionals(parts, 2, "clipdone upload <file> --project <project_id> --type footage|music|script|reference");
936
936
  if (!args.file) args.file = parts[1];
937
937
  return { key: "project-upload" };
938
938
  }
@@ -980,9 +980,10 @@ function resolveUploadCategory(rawValue) {
980
980
  const value = String(rawValue ?? "footage").trim().toLowerCase();
981
981
  if (!value) return "footage";
982
982
  if (["footage", "video", "visual", "image", "photo", "picture", "broll", "b-roll"].includes(value)) return "footage";
983
+ if (["reference", "inspiration"].includes(value)) return "reference";
983
984
  if (["music", "audio", "song"].includes(value)) return "music";
984
985
  if (["script", "text"].includes(value)) return "script";
985
- throw new Error("Unsupported upload type. Use footage, music, or script.");
986
+ throw new Error("Unsupported upload type. Use footage, music, script, or reference.");
986
987
  }
987
988
  function summarizeUploadFailure(response, bodyText) {
988
989
  const compact = compactText(bodyText);
@@ -1010,17 +1011,20 @@ function printHelp() {
1010
1011
  writeLine(" revoke Revoke the current CLI login");
1011
1012
  writeLine(" Login options: --no-open --print-auth-url");
1012
1013
  writeLine(" projects List projects");
1013
- writeLine(" projects create [--name <name>] Create a project");
1014
+ writeLine(" projects create [--name <name>] [--workspace <id>] [--client <id>] Create a project");
1015
+ writeLine(" projects [list] [--workspace <id>] List your own projects or a workspace's projects");
1014
1016
  writeLine(" If omitted, ClipDone uses the same default name as the web app");
1015
1017
  writeLine(" projects <project_id> Show a project summary");
1016
- writeLine(" projects <project_id> update [--name <name>] [--description <text>] [--slug <slug>]");
1018
+ writeLine(" projects <project_id> update [--name <name>] [--description <text>] [--slug <slug>] [--workspace <id>|--clear-workspace] [--client <id>|--clear-client] [--use-client-style]");
1019
+ writeLine(" --use-client-style adopts the assigned client's current Brand Style");
1017
1020
  writeLine(" Optional: --settings-file <json> or --settings '<json>'");
1018
1021
  writeLine(" projects <project_id> delete Delete a project");
1019
- writeLine(" projects <project_id> upload <file> --type footage|music|script");
1022
+ writeLine(" projects <project_id> upload <file> --type footage|music|script|reference");
1020
1023
  writeLine(" Upload media or script files");
1021
1024
  writeLine(" projects <project_id> files List uploaded project files");
1022
1025
  writeLine(" projects <project_id> process Start the first edit pass");
1023
- writeLine(" projects <project_id> revise Create a revised version from feedback");
1026
+ writeLine(" projects <project_id> revise --source-output <id> [--feedback <text>]");
1027
+ writeLine(" Revise the exact completed output you reviewed");
1024
1028
  writeLine(" projects <project_id> status Show project and processing status");
1025
1029
  writeLine(" projects <project_id> outputs List exported versions");
1026
1030
  writeLine(" projects <project_id> runs List processing and revision runs");
@@ -1039,7 +1043,7 @@ function printHelp() {
1039
1043
  writeLine("Examples:");
1040
1044
  writeLine(" clipdone projects");
1041
1045
  writeLine(" clipdone projects create");
1042
- writeLine(' clipdone projects create --name "Project name"');
1046
+ writeLine(' clipdone projects create --name "Video name"');
1043
1047
  writeLine(" clipdone projects <id> upload ./IMG_825.mp4 --type footage");
1044
1048
  writeLine(' clipdone projects <id> upload "/path/with spaces/video (1).mp4" --type footage');
1045
1049
  writeLine(" clipdone projects <id> process");
@@ -1323,8 +1327,11 @@ async function download(args) {
1323
1327
  await pipeline(Readable.fromWeb(response.body), createWriteStream(args.out));
1324
1328
  output(buildDownloadView(result, args.out));
1325
1329
  }
1326
- function buildProcessingBody(args) {
1330
+ function buildProcessingBody(args, intent) {
1327
1331
  if (!args.project) throw new Error("--project is required");
1332
+ if (intent === "revision" && (typeof args["source-output"] !== "string" || !args["source-output"].trim())) {
1333
+ throw new Error("A revision must name the completed output it was reviewed against. Use --source-output <output_id> from the project outputs list.");
1334
+ }
1328
1335
  const feedbackNotes = [];
1329
1336
  if (typeof args.feedback === "string" && args.feedback.trim()) {
1330
1337
  feedbackNotes.push({ content: args.feedback.trim() });
@@ -1334,7 +1341,8 @@ function buildProcessingBody(args) {
1334
1341
  }
1335
1342
  const subtitles = typeof args["subtitles-file"] === "string" ? normalizeSubtitleEdits(readJsonFile(args["subtitles-file"])) : [];
1336
1343
  return {
1337
- skipRender: args["skip-render"] === true,
1344
+ intent,
1345
+ ...intent === "revision" ? { sourceOutputVersionId: args["source-output"].trim() } : {},
1338
1346
  processFeedback: args["process-feedback"] === true || feedbackNotes.length > 0,
1339
1347
  ...feedbackNotes.length > 0 ? { feedbackNotes } : {},
1340
1348
  ...subtitles.length > 0 ? { subtitles } : {}
@@ -1402,13 +1410,25 @@ async function main() {
1402
1410
  if (command === "project-create") {
1403
1411
  const result = await request("/projects", {
1404
1412
  method: "POST",
1405
- body: { name: args.name, description: args.description },
1413
+ body: { name: args.name, description: args.description, workspaceId: args.workspace, clientId: args.client },
1406
1414
  idempotencyKey: `cli-project-${Date.now()}-${Math.random().toString(36).slice(2)}`
1407
1415
  });
1408
1416
  return output({ message: `Created project${result?.project?.name ? ` "${result.project.name}"` : ""}.`, projectId: result?.project?.id, name: result?.project?.name });
1409
1417
  }
1410
1418
  if (command === "project-update") {
1411
1419
  if (!args.project) throw new Error("project_id or --project is required");
1420
+ if (args.workspace !== void 0 && args["clear-workspace"] === true) {
1421
+ throw new Error("Choose either --workspace or --clear-workspace.");
1422
+ }
1423
+ if (args.client !== void 0 && args["clear-client"] === true) {
1424
+ throw new Error("Choose either --client or --clear-client.");
1425
+ }
1426
+ if (args["use-client-style"] === true && (args["clear-client"] === true || args["clear-workspace"] === true)) {
1427
+ throw new Error("--use-client-style requires an assigned client; it cannot be combined with a clear flag.");
1428
+ }
1429
+ if (args["clear-workspace"] === true && typeof args.client === "string") {
1430
+ throw new Error("--client requires a workspace; use --workspace with the client ID.");
1431
+ }
1412
1432
  const settings = readSettingsInput(args);
1413
1433
  const result = await request(`/projects/${encodeURIComponent(args.project)}`, {
1414
1434
  method: "PATCH",
@@ -1416,6 +1436,11 @@ async function main() {
1416
1436
  ...typeof args.name === "string" ? { name: args.name } : {},
1417
1437
  ...typeof args.description === "string" ? { description: args.description } : {},
1418
1438
  ...typeof args.slug === "string" ? { slug: args.slug } : {},
1439
+ ...typeof args.workspace === "string" ? { workspaceId: args.workspace } : {},
1440
+ ...args["clear-workspace"] === true ? { workspaceId: null } : {},
1441
+ ...typeof args.client === "string" ? { clientId: args.client } : {},
1442
+ ...args["clear-client"] === true ? { clientId: null } : {},
1443
+ ...args["use-client-style"] === true || args.adoptClientDefault === true ? { adoptClientDefault: true } : {},
1419
1444
  ...settings ? { settings } : {}
1420
1445
  }
1421
1446
  });
@@ -1435,7 +1460,7 @@ async function main() {
1435
1460
  if (!args.project) throw new Error("project_id or --project is required");
1436
1461
  const result = await request(`/projects/${encodeURIComponent(args.project)}/runs`, {
1437
1462
  method: "POST",
1438
- body: buildProcessingBody(args),
1463
+ body: buildProcessingBody(args, command === "project-revise" ? "revision" : "new_run"),
1439
1464
  idempotencyKey: `cli-run-${Date.now()}-${Math.random().toString(36).slice(2)}`
1440
1465
  });
1441
1466
  return output(buildProcessView(result, args, command === "project-revise" ? "revise" : "process"));
@@ -1454,7 +1479,8 @@ async function main() {
1454
1479
  return output({ runs: await requestAll(`/projects/${encodeURIComponent(args.project)}/runs`, "runs") });
1455
1480
  }
1456
1481
  if (command === "projects-list") {
1457
- return output({ projects: await requestAll("/projects", "projects") });
1482
+ const query = typeof args.workspace === "string" ? `?workspaceId=${encodeURIComponent(args.workspace)}` : "";
1483
+ return output({ projects: await requestAll(`/projects${query}`, "projects") });
1458
1484
  }
1459
1485
  if (command === "file-update") {
1460
1486
  const fileId = args.file || args.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipdone/cli",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Command line access to ClipDone projects and exports",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",