@nodaro/cli 1.4.0 → 1.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/README.md +2 -2
- package/dist/index.js +102 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ nodaro auth logout # delete the saved profile
|
|
|
69
69
|
Switch between staging / prod / local instances with `--profile`:
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
nodaro auth login --profile prod --base-url https://
|
|
72
|
+
nodaro auth login --profile prod --base-url https://app.nodaro.ai
|
|
73
73
|
nodaro auth login --profile staging --base-url https://next.nodaro.ai
|
|
74
74
|
nodaro auth login --profile local --base-url http://localhost:8000
|
|
75
75
|
|
|
@@ -230,7 +230,7 @@ npm install @nodaro/sdk
|
|
|
230
230
|
import { createClient, StaticTokenAuth } from "@nodaro/sdk"
|
|
231
231
|
|
|
232
232
|
const nodaro = createClient({
|
|
233
|
-
baseUrl: "https://
|
|
233
|
+
baseUrl: "https://app.nodaro.ai",
|
|
234
234
|
auth: new StaticTokenAuth(process.env.NODARO_TOKEN!),
|
|
235
235
|
})
|
|
236
236
|
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var require_package = __commonJS({
|
|
|
29
29
|
"package.json"(exports$1, module) {
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@nodaro/cli",
|
|
32
|
-
version: "1.
|
|
32
|
+
version: "1.6.0",
|
|
33
33
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
34
34
|
type: "module",
|
|
35
35
|
license: "Apache-2.0",
|
|
@@ -70,11 +70,11 @@ var require_package = __commonJS({
|
|
|
70
70
|
"@inquirer/confirm": "^6.0.12",
|
|
71
71
|
"@inquirer/input": "^5.0.12",
|
|
72
72
|
"@inquirer/select": "^5.1.4",
|
|
73
|
-
"@nodaro/sdk": "^1.
|
|
74
|
-
"@nodaro/shared": "^1.
|
|
73
|
+
"@nodaro/sdk": "^1.9.0",
|
|
74
|
+
"@nodaro/shared": "^1.16.0",
|
|
75
75
|
commander: "^12.1.0",
|
|
76
76
|
picocolors: "^1.1.1",
|
|
77
|
-
"@nodaro/prompts": "^1.0
|
|
77
|
+
"@nodaro/prompts": "^1.5.0"
|
|
78
78
|
},
|
|
79
79
|
devDependencies: {
|
|
80
80
|
tsup: "^8.5.0",
|
|
@@ -744,6 +744,52 @@ function jobsCommand() {
|
|
|
744
744
|
});
|
|
745
745
|
return cmd;
|
|
746
746
|
}
|
|
747
|
+
function videoProCommand() {
|
|
748
|
+
const cmd = new Command("video-pro").description(
|
|
749
|
+
"stop / continue generate-video-pro runs (segmented long-video engine)"
|
|
750
|
+
);
|
|
751
|
+
cmd.command("stop <jobId>").description(
|
|
752
|
+
"gracefully stop a running job: keep + deliver the completed segments as the final video, refund the rest (the in-flight segment is billed \u2014 the provider keeps rendering it)"
|
|
753
|
+
).option("--profile <name>").option("--json").action(async (jobId, opts) => {
|
|
754
|
+
try {
|
|
755
|
+
const client = buildClient(opts.profile);
|
|
756
|
+
const result = await client.videoPro.stop(jobId);
|
|
757
|
+
if (opts.json) {
|
|
758
|
+
emit(result, opts);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
if (result.stopping) {
|
|
762
|
+
success(`stop requested for ${jobId} \u2014 the engine finalizes the partial within seconds`);
|
|
763
|
+
dim(`follow: nodaro jobs get ${jobId}`);
|
|
764
|
+
} else {
|
|
765
|
+
success(`job ${jobId} had not started \u2014 cancelled with a full refund`);
|
|
766
|
+
}
|
|
767
|
+
} catch (err) {
|
|
768
|
+
handleError(err);
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
cmd.command("continue <jobId>").description(
|
|
772
|
+
"continue a stopped/failed/completed run as a NEW job \u2014 reuses the delivered segments, regenerates from --from-segment on (default: the first missing one); billed only for the regenerated segments"
|
|
773
|
+
).option("--from-segment <n>", "1-based segment to regenerate from (overrides everything from that point)", (v) => parseInt(v, 10)).option("--watch", "poll the new job until it finishes").option("--poll-interval <ms>", "poll interval with --watch", (v) => parseInt(v, 10)).option("--profile <name>").option("--json").action(
|
|
774
|
+
async (jobId, opts) => {
|
|
775
|
+
try {
|
|
776
|
+
const client = buildClient(opts.profile);
|
|
777
|
+
const result = await client.videoPro.continueRun(jobId, {
|
|
778
|
+
...opts.fromSegment !== void 0 ? { fromSegment: opts.fromSegment } : {}
|
|
779
|
+
});
|
|
780
|
+
await reportQueuedJob({ jobId: result.jobId }, () => client.jobs.getStatus(result.jobId), {
|
|
781
|
+
json: opts.json,
|
|
782
|
+
watch: opts.watch,
|
|
783
|
+
pollInterval: opts.pollInterval,
|
|
784
|
+
note: result.fromSegment !== void 0 ? `continues ${jobId} from segment ${result.fromSegment}` : `continues ${jobId}`
|
|
785
|
+
});
|
|
786
|
+
} catch (err) {
|
|
787
|
+
handleError(err);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
return cmd;
|
|
792
|
+
}
|
|
747
793
|
function executionsCommand() {
|
|
748
794
|
const cmd = new Command("executions").description("inspect and cancel workflow executions");
|
|
749
795
|
cmd.command("get <id>").description("show one execution by id (use --watch to follow until completion)").option("--profile <name>").option("--json").option("--watch", "poll until terminal status (completed/failed/cancelled)").action(async (id, opts) => {
|
|
@@ -2028,7 +2074,7 @@ function parseSection(raw) {
|
|
|
2028
2074
|
}
|
|
2029
2075
|
function mediaCommand() {
|
|
2030
2076
|
const cmd = new Command("media").description(
|
|
2031
|
-
"media ingestion \u2014 pull a social video into storage, trim video/audio, save a URL to storage, probe metadata"
|
|
2077
|
+
"media ingestion + compositing \u2014 pull a social video into storage, trim video/audio, collage images, save a URL to storage, probe metadata"
|
|
2032
2078
|
);
|
|
2033
2079
|
cmd.command("download <url>").description("download a social video (YouTube / TikTok / Instagram / X / Facebook) into your storage").option("--max-height <px>", "cap the resolution (e.g. 720); omit for best available", (v) => parseInt(v, 10)).option("--section <a-b>", 'fetch ONLY this time range in seconds (e.g. "30-90"); the cut lands on keyframes, so pad and trim after').option("--watch", "stream the download's live progress until it completes").option("--profile <name>").option("--json").addHelpText("after", `
|
|
2034
2080
|
Examples:
|
|
@@ -2152,6 +2198,56 @@ Example:
|
|
|
2152
2198
|
}
|
|
2153
2199
|
}
|
|
2154
2200
|
);
|
|
2201
|
+
cmd.command("collage <imageUrls...>").description("composite 2\u201330 images into ONE large 2K/4K collage (smart justified layout \u2014 no cropping \u2014 or uniform grid)").option(
|
|
2202
|
+
"--sizes <list>",
|
|
2203
|
+
"comma-separated per-image size hints aligned with the images: 0 auto (default), 1 big (~2\xD7 linear), 2 medium, 3 small (~\xBD). Relative \u2014 smart layout only"
|
|
2204
|
+
).option("--layout <layout>", "smart (default \u2014 justified rows, output height floats) or grid (uniform letterboxed cells)").option("--resolution <res>", "long-edge resolution: 2K or 4K (default 4K)").option("--aspect-ratio <W:H>", 'output canvas ratio, e.g. "4:3" (exact in grid; a target shape in smart)').option("--gap <px>", "gap between images + outer margin in px (default 24)", (v) => parseInt(v, 10)).option("--background-color <hex>", "background shown in the gaps, #RRGGBB").option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
2205
|
+
Examples:
|
|
2206
|
+
$ nodaro media collage https://x/a.png https://x/b.png https://x/c.png --watch
|
|
2207
|
+
$ nodaro media collage https://x/hero.png https://x/b.png https://x/c.png --sizes 1,3,3 --aspect-ratio 16:9 --watch
|
|
2208
|
+
|
|
2209
|
+
--sizes aligns by position: "1,3,3" renders the first image big and the other
|
|
2210
|
+
two small. Hints are relative \u2014 all-equal hints change nothing, and the grid
|
|
2211
|
+
layout ignores them.`).action(
|
|
2212
|
+
async (imageUrls, opts) => {
|
|
2213
|
+
try {
|
|
2214
|
+
if (imageUrls.length < 2) {
|
|
2215
|
+
warn(`Provide at least 2 image URLs (got ${imageUrls.length})`);
|
|
2216
|
+
process.exit(1);
|
|
2217
|
+
}
|
|
2218
|
+
if (opts.layout && !["smart", "grid"].includes(opts.layout)) {
|
|
2219
|
+
warn(`--layout must be smart or grid (got "${opts.layout}")`);
|
|
2220
|
+
process.exit(1);
|
|
2221
|
+
}
|
|
2222
|
+
if (opts.resolution && !["2K", "4K"].includes(opts.resolution)) {
|
|
2223
|
+
warn(`--resolution must be 2K or 4K (got "${opts.resolution}")`);
|
|
2224
|
+
process.exit(1);
|
|
2225
|
+
}
|
|
2226
|
+
let imageSizes;
|
|
2227
|
+
if (opts.sizes !== void 0) {
|
|
2228
|
+
const parsed = opts.sizes.split(",").map((s) => parseInt(s.trim(), 10));
|
|
2229
|
+
if (parsed.some((n) => !Number.isInteger(n) || n < 0 || n > 3) || parsed.length > imageUrls.length) {
|
|
2230
|
+
warn(`--sizes must be comma-separated 0\u20133 hints, at most one per image (got "${opts.sizes}")`);
|
|
2231
|
+
process.exit(1);
|
|
2232
|
+
}
|
|
2233
|
+
imageSizes = parsed;
|
|
2234
|
+
}
|
|
2235
|
+
const client = buildClient(opts.profile);
|
|
2236
|
+
const result = await client.media.imageCollage({
|
|
2237
|
+
imageUrls,
|
|
2238
|
+
...imageSizes ? { imageSizes } : {},
|
|
2239
|
+
...opts.layout ? { layout: opts.layout } : {},
|
|
2240
|
+
...opts.resolution ? { resolution: opts.resolution } : {},
|
|
2241
|
+
...opts.aspectRatio ? { aspectRatio: opts.aspectRatio } : {},
|
|
2242
|
+
...opts.gap !== void 0 ? { gap: opts.gap } : {},
|
|
2243
|
+
...opts.backgroundColor ? { backgroundColor: opts.backgroundColor } : {}
|
|
2244
|
+
});
|
|
2245
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "image collage" });
|
|
2246
|
+
} catch (err) {
|
|
2247
|
+
handleError(err);
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
);
|
|
2155
2251
|
cmd.command("save <url>").description("copy an external media URL into your Nodaro storage (server-side fetch)").option("--filename <name>", "filename to store it under").option("--type <type>", "media type hint: image, video, or audio").option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").action(
|
|
2156
2252
|
async (url, opts) => {
|
|
2157
2253
|
try {
|
|
@@ -3371,6 +3467,7 @@ program.addCommand(workflowsCommand());
|
|
|
3371
3467
|
program.addCommand(appsCommand());
|
|
3372
3468
|
program.addCommand(nodesCommand());
|
|
3373
3469
|
program.addCommand(jobsCommand());
|
|
3470
|
+
program.addCommand(videoProCommand());
|
|
3374
3471
|
program.addCommand(executionsCommand());
|
|
3375
3472
|
program.addCommand(charactersCommand());
|
|
3376
3473
|
program.addCommand(promptCommand());
|