diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 23adc1deda..eefb677622 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -145,6 +145,7 @@ const subCommands = { validate: () => import("./commands/validate.js").then((m) => m.default), snapshot: () => import("./commands/snapshot.js").then((m) => m.default), capture: () => import("./commands/capture.js").then((m) => m.default), + "capture-video": () => import("./commands/capture-video.js").then((m) => m.default), lambda: () => import("./commands/lambda.js").then((m) => m.default), cloudrun: () => import("./commands/cloudrun.js").then((m) => m.default), cloud: () => import("./commands/cloud.js").then((m) => m.default), diff --git a/packages/cli/src/commands/capture-video.ts b/packages/cli/src/commands/capture-video.ts new file mode 100644 index 0000000000..bc39a8f909 --- /dev/null +++ b/packages/cli/src/commands/capture-video.ts @@ -0,0 +1,176 @@ +import { defineCommand } from "citty"; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; +import { resolve, join, basename } from "node:path"; +import { c } from "../ui/colors.js"; +import type { Example } from "./_examples.js"; + +export const examples: Example[] = [ + ["Download the hero video (index 0) from a captured project's manifest", "capture-video ./my-project --index 0"], + ["Download a specific video by exact URL", "capture-video ./my-project --url https://cdn.example.com/hero.mp4"], + ["List entries in the manifest without downloading", "capture-video ./my-project --list"], +]; + +/** + * The capture pipeline writes capture/extracted/video-manifest.json listing + * every