@nodaro/cli 1.5.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 +55 -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.
|
|
77
|
+
"@nodaro/prompts": "^1.5.0"
|
|
78
78
|
},
|
|
79
79
|
devDependencies: {
|
|
80
80
|
tsup: "^8.5.0",
|
|
@@ -2074,7 +2074,7 @@ function parseSection(raw) {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
function mediaCommand() {
|
|
2076
2076
|
const cmd = new Command("media").description(
|
|
2077
|
-
"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"
|
|
2078
2078
|
);
|
|
2079
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", `
|
|
2080
2080
|
Examples:
|
|
@@ -2198,6 +2198,56 @@ Example:
|
|
|
2198
2198
|
}
|
|
2199
2199
|
}
|
|
2200
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
|
+
);
|
|
2201
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(
|
|
2202
2252
|
async (url, opts) => {
|
|
2203
2253
|
try {
|