@neta-art/cohub-cli 1.17.5 → 1.18.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/commands/spaces.js +18 -0
- package/package.json +2 -2
package/dist/commands/spaces.js
CHANGED
|
@@ -26,6 +26,21 @@ function parseInteger(value, name, options = {}) {
|
|
|
26
26
|
function collectOption(value, previous = []) {
|
|
27
27
|
return [...previous, value];
|
|
28
28
|
}
|
|
29
|
+
function parseEnvOptions(values) {
|
|
30
|
+
if (!values?.length)
|
|
31
|
+
return undefined;
|
|
32
|
+
const env = {};
|
|
33
|
+
for (const value of values) {
|
|
34
|
+
const index = value.indexOf("=");
|
|
35
|
+
if (index <= 0)
|
|
36
|
+
return error("Invalid env", "Use --env KEY=value");
|
|
37
|
+
const name = value.slice(0, index).trim();
|
|
38
|
+
if (!name)
|
|
39
|
+
return error("Invalid env", "Env name is required");
|
|
40
|
+
env[name] = value.slice(index + 1);
|
|
41
|
+
}
|
|
42
|
+
return env;
|
|
43
|
+
}
|
|
29
44
|
function parseChoice(value, name, choices) {
|
|
30
45
|
if (choices.includes(value))
|
|
31
46
|
return value;
|
|
@@ -218,6 +233,7 @@ async function sendPrompt(command, words, opts) {
|
|
|
218
233
|
provider: opts.provider,
|
|
219
234
|
accessMode: opts.readOnly ? "read_only" : "full_access",
|
|
220
235
|
intent: opts.steer ? "steer" : undefined,
|
|
236
|
+
env: parseEnvOptions(opts.env),
|
|
221
237
|
schedule,
|
|
222
238
|
labelRefs: opts.label?.length ? opts.label : undefined,
|
|
223
239
|
});
|
|
@@ -249,6 +265,7 @@ export function registerPrompt(program) {
|
|
|
249
265
|
.option("--cron <expression>", "Repeat using a 5-field cron expression")
|
|
250
266
|
.option("--timezone <tz>", "IANA timezone for --cron, e.g. Asia/Shanghai")
|
|
251
267
|
.option("--label <ref>", "Attach a label, e.g. Bug or Area/Frontend", collectOption, [])
|
|
268
|
+
.option("--env <key=value>", "Set an environment variable for this turn", collectOption, [])
|
|
252
269
|
.option("--image <path>", "Attach an image", collectOption, [])
|
|
253
270
|
.option("--json", "Output as JSON")
|
|
254
271
|
.action((words, opts) => sendPrompt(program, words, opts));
|
|
@@ -410,6 +427,7 @@ export function registerSpaces(program) {
|
|
|
410
427
|
.option("--cron <expression>", "Repeat using a 5-field cron expression")
|
|
411
428
|
.option("--timezone <tz>", "IANA timezone for --cron, e.g. Asia/Shanghai")
|
|
412
429
|
.option("--label <ref>", "Attach a label, e.g. Bug or Area/Frontend", collectOption, [])
|
|
430
|
+
.option("--env <key=value>", "Set an environment variable for this turn", collectOption, [])
|
|
413
431
|
.option("--image <path>", "Attach an image", collectOption, [])
|
|
414
432
|
.option("--json", "Output as JSON")
|
|
415
433
|
.action((words, opts) => sendPrompt(spacesCmd, words, opts));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@neta-art/generation": "^0.1.5",
|
|
17
17
|
"commander": "^14.0.3",
|
|
18
18
|
"sharp": "^0.34.5",
|
|
19
|
-
"@neta-art/cohub": "1.
|
|
19
|
+
"@neta-art/cohub": "1.29.0"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|