@nodaro/cli 1.14.0 → 1.15.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 +31 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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.15.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": "^2.
|
|
73
|
+
"@nodaro/sdk": "^1.23.0",
|
|
74
|
+
"@nodaro/shared": "^2.13.0",
|
|
75
75
|
commander: "^12.1.0",
|
|
76
76
|
picocolors: "^1.1.1",
|
|
77
|
-
"@nodaro/prompts": "^1.
|
|
77
|
+
"@nodaro/prompts": "^1.9.0"
|
|
78
78
|
},
|
|
79
79
|
devDependencies: {
|
|
80
80
|
tsup: "^8.5.0",
|
|
@@ -398,7 +398,7 @@ function saveWorkspace(profileName, workspaceId) {
|
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
// src/client.ts
|
|
401
|
-
var CLI_VERSION = "1.
|
|
401
|
+
var CLI_VERSION = "1.15.0" ;
|
|
402
402
|
function buildClient(profileName) {
|
|
403
403
|
const { name, profile } = getProfile(profileName);
|
|
404
404
|
if (!profile) {
|
|
@@ -1097,6 +1097,25 @@ function rejectPositionalInputs(extras, slug) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
process.exit(1);
|
|
1099
1099
|
}
|
|
1100
|
+
function parseOverridePairs(pairs) {
|
|
1101
|
+
if (!pairs?.length) return void 0;
|
|
1102
|
+
const out = {};
|
|
1103
|
+
for (const pair of pairs) {
|
|
1104
|
+
const eq = pair.indexOf("=");
|
|
1105
|
+
const dot = pair.indexOf(".");
|
|
1106
|
+
if (eq === -1 || dot === -1 || dot > eq) throw new Error(`--override expects nodeId.field=value, got "${pair}"`);
|
|
1107
|
+
const nodeId = pair.slice(0, dot);
|
|
1108
|
+
const field = pair.slice(dot + 1, eq);
|
|
1109
|
+
const raw = pair.slice(eq + 1);
|
|
1110
|
+
let value = raw;
|
|
1111
|
+
try {
|
|
1112
|
+
value = JSON.parse(raw);
|
|
1113
|
+
} catch {
|
|
1114
|
+
}
|
|
1115
|
+
out[nodeId] = { ...out[nodeId] ?? {}, [field]: value };
|
|
1116
|
+
}
|
|
1117
|
+
return out;
|
|
1118
|
+
}
|
|
1100
1119
|
function appsCommand() {
|
|
1101
1120
|
const cmd = new Command("apps").description("browse and run published apps (workflows wrapped in a curated UI)");
|
|
1102
1121
|
cmd.command("list").description("browse published apps (paginated)").option("--search <query>", "substring match on name/description").option("--limit <n>", "page size (max 50)", (v) => parseInt(v, 10)).option("--cursor <token>", "pagination cursor from a previous page").option("--category <slug>", "filter to a single category").option("--profile <name>").option("--json").action(async (opts) => {
|
|
@@ -1136,9 +1155,10 @@ function appsCommand() {
|
|
|
1136
1155
|
handleError(err);
|
|
1137
1156
|
}
|
|
1138
1157
|
});
|
|
1139
|
-
cmd.command("run [slug] [extras...]").description("trigger an app run. Inputs go through --input k=v (repeat) or --params-file inputs.json. Omit <slug> for an interactive picker.").option("--input <pairs...>", `input value, repeat or space-separate; JSON arrays/objects supported (e.g. --input prompt="hi" --input 'tags=["a","b"]')`, collectVariadic).option("--params-file <path>", "JSON file with the full inputs object (--input flags override matching keys)").option("--watch", "follow the resulting execution until completion").option("--profile <name>").option("--json").addHelpText("after", `
|
|
1158
|
+
cmd.command("run [slug] [extras...]").description("trigger an app run. Inputs go through --input k=v (repeat) or --params-file inputs.json. Omit <slug> for an interactive picker.").option("--input <pairs...>", `input value, repeat or space-separate; JSON arrays/objects supported (e.g. --input prompt="hi" --input 'tags=["a","b"]')`, collectVariadic).option("--params-file <path>", "JSON file with the full inputs object (--input flags override matching keys)").option("--override <pairs...>", 'advanced: raw node-data override nodeId.field=value (repeat); reaches fields not exposed as inputs, e.g. --override n1.promptPrefix="Cinematic still of"', collectVariadic).option("--watch", "follow the resulting execution until completion").option("--profile <name>").option("--json").addHelpText("after", `
|
|
1140
1159
|
Examples:
|
|
1141
1160
|
$ nodaro apps run hair-styler-dd3erw --input prompt="curly red hair" --watch
|
|
1161
|
+
$ nodaro apps run hair-styler-dd3erw --input prompt="curly red hair" --override n1.promptPrefix="Studio portrait of"
|
|
1142
1162
|
$ echo '{"prompt":"hi","duration":8}' > inputs.json
|
|
1143
1163
|
$ nodaro apps run hair-styler-dd3erw --params-file inputs.json --watch
|
|
1144
1164
|
|
|
@@ -1148,7 +1168,9 @@ Tip: \`nodaro apps get <slug>\` shows the input schema for that app.`).action(as
|
|
|
1148
1168
|
const client = buildClient(opts.profile);
|
|
1149
1169
|
const resolvedSlug = slug ?? await pickAppInteractively(client);
|
|
1150
1170
|
const inputs = resolveParams(opts.input, opts.paramsFile);
|
|
1151
|
-
const result = await client.apps.run(resolvedSlug, inputs
|
|
1171
|
+
const result = await client.apps.run(resolvedSlug, inputs, {
|
|
1172
|
+
inputOverrides: parseOverridePairs(opts.override)
|
|
1173
|
+
});
|
|
1152
1174
|
if (opts.json && !opts.watch) {
|
|
1153
1175
|
emit(result, opts);
|
|
1154
1176
|
return;
|
|
@@ -3033,8 +3055,8 @@ function buildCatalogSnapshot(projected, sidecars) {
|
|
|
3033
3055
|
const push = (opts) => {
|
|
3034
3056
|
for (const o of opts ?? []) if (!seen.has(o.id)) seen.set(o.id, o);
|
|
3035
3057
|
};
|
|
3036
|
-
|
|
3037
|
-
|
|
3058
|
+
push(projected.options);
|
|
3059
|
+
for (const d of projected.dimensions ?? []) push(d.options);
|
|
3038
3060
|
const entries = [...seen.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
3039
3061
|
return { catalogId: projected.catalogId, kind: projected.kind, entries, sidecars };
|
|
3040
3062
|
}
|