@stav-ai/cli 0.1.6 → 0.1.7
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 +4 -2
- package/dist/adapters/index.js +37 -16
- package/dist/cli.js +4 -2
- package/dist/launch.js +9 -7
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ is not ours.
|
|
|
26
26
|
| `stav whoami` | Who you are, and which workspace |
|
|
27
27
|
| `stav workspace [<slug>]` | Show your workspaces, or choose one |
|
|
28
28
|
| `stav apps` | The apps this CLI can launch |
|
|
29
|
-
| `stav launch <app> [--model <id>] [--workspace <slug>] [--yes] [-- <app arguments>]` | Start an app on Stav |
|
|
29
|
+
| `stav launch <app> [--model <id>] [--workspace <slug>] [--yes] [--verbose] [-- <app arguments>]` | Start an app on Stav |
|
|
30
30
|
|
|
31
31
|
It launches **Claude Code** (`claude`), **Codex** (`codex`),
|
|
32
32
|
**DeepSeek Harness** (`dsh`), **Kilo Code** (`kilo`), the
|
|
@@ -39,7 +39,9 @@ nothing and prints the command instead.
|
|
|
39
39
|
## What `stav launch` does
|
|
40
40
|
|
|
41
41
|
1. Checks the app can be launched, and that your workspace has credits.
|
|
42
|
-
2. Shows what it will do, and asks once
|
|
42
|
+
2. Shows what it will do, and asks once: the workspace, the key, the model
|
|
43
|
+
and any warning about the app. `--verbose` shows every setting it gives
|
|
44
|
+
the app.
|
|
43
45
|
3. Makes an API key for the app, or uses the one it saved last time:
|
|
44
46
|
- a personal key, under your workspace's key policy; if that policy
|
|
45
47
|
refuses it and you are an owner or admin, a workspace key instead;
|
package/dist/adapters/index.js
CHANGED
|
@@ -79,6 +79,7 @@ const claudeCode = {
|
|
|
79
79
|
: contextWindow === undefined && claudeNeedsWindow(model)
|
|
80
80
|
? ["CLAUDE_CODE_MAX_CONTEXT_TOKENS=<the model's largest context window in your workspace, read from Stav; a long chat then sends more tokens per turn before it is compacted>"]
|
|
81
81
|
: [];
|
|
82
|
+
const modelLine = model ? `model ${model}` : "Claude Code's own default model";
|
|
82
83
|
return {
|
|
83
84
|
program: 'claude',
|
|
84
85
|
args: [],
|
|
@@ -93,9 +94,10 @@ const claudeCode = {
|
|
|
93
94
|
describe: [
|
|
94
95
|
`ANTHROPIC_BASE_URL=${gatewayUrl}`,
|
|
95
96
|
'ANTHROPIC_AUTH_TOKEN=<the key, in the environment only>',
|
|
96
|
-
|
|
97
|
+
modelLine,
|
|
97
98
|
...describeWindow,
|
|
98
99
|
],
|
|
100
|
+
brief: [modelLine],
|
|
99
101
|
};
|
|
100
102
|
},
|
|
101
103
|
async conflicts(home = os.homedir(), cwd = process.cwd()) {
|
|
@@ -148,6 +150,7 @@ const codex = {
|
|
|
148
150
|
];
|
|
149
151
|
if (model)
|
|
150
152
|
args.push('-m', model);
|
|
153
|
+
const modelLine = model ? `model ${model}` : "Codex's own default model";
|
|
151
154
|
return {
|
|
152
155
|
program: 'codex',
|
|
153
156
|
args,
|
|
@@ -156,8 +159,9 @@ const codex = {
|
|
|
156
159
|
describe: [
|
|
157
160
|
`a "stav" model provider at ${base}, for this run only (your ~/.codex/config.toml is not changed)`,
|
|
158
161
|
'STAV_API_KEY=<the key, in the environment only>',
|
|
159
|
-
|
|
162
|
+
modelLine,
|
|
160
163
|
],
|
|
164
|
+
brief: [modelLine],
|
|
161
165
|
};
|
|
162
166
|
},
|
|
163
167
|
};
|
|
@@ -199,6 +203,9 @@ const deepseekHarness = {
|
|
|
199
203
|
: contextWindow === undefined && namedModel(model)
|
|
200
204
|
? "the model's largest context window in your workspace, read from Stav"
|
|
201
205
|
: `dsh's own context window guess (${DSH_DEFAULT_CONTEXT_WINDOW} tokens)`;
|
|
206
|
+
const modelLine = model ? `model ${model}` : 'model auto (your workspace\'s default Router)';
|
|
207
|
+
const noteLine = "note: dsh runs the commands the model writes without asking; DeepSeek's own SAFETY.md says to run it in a container or VM";
|
|
208
|
+
const taskLine = 'give the task after --, for example: stav launch deepseek-harness -- "run the tests"';
|
|
202
209
|
return {
|
|
203
210
|
program: 'dsh',
|
|
204
211
|
args: ['--profile', 'headless', '--patch', DSH_PATCH_FILE],
|
|
@@ -215,13 +222,14 @@ const deepseekHarness = {
|
|
|
215
222
|
describe: [
|
|
216
223
|
`the one-shot command dsh --profile headless, with a "stav-cli" model provider at ${base} for this run only (your ~/.dsh is not changed)`,
|
|
217
224
|
'STAV_DSH_API_KEY=<the key, in the environment only>',
|
|
218
|
-
|
|
225
|
+
modelLine,
|
|
219
226
|
describeWindow,
|
|
220
227
|
`at most ${DSH_MAX_TOKENS} output tokens per call`,
|
|
221
228
|
'DSH_TELEMETRY_MODE=DISABLED (no feedback uploads to DeepSeek)',
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
noteLine,
|
|
230
|
+
taskLine,
|
|
224
231
|
],
|
|
232
|
+
brief: [modelLine, noteLine, taskLine],
|
|
225
233
|
};
|
|
226
234
|
},
|
|
227
235
|
};
|
|
@@ -341,6 +349,9 @@ const kiloCode = {
|
|
|
341
349
|
: contextWindow === undefined && namedModel(model)
|
|
342
350
|
? "the model's largest context window in your workspace, read from Stav"
|
|
343
351
|
: `a context window of ${KILO_DEFAULT_CONTEXT} tokens (Kilo Code compacts the chat by it)`;
|
|
352
|
+
const modelLine = model ? `model ${model}` : "model auto (your workspace's default Router)";
|
|
353
|
+
const agentLine = 'an agent in your Kilo config with a model of its own stops with "Model not found" for this run: Stav is the only provider';
|
|
354
|
+
const noteLine = 'note: Kilo Code runs commands and edits files. It asks before most shell commands, unless your Kilo config allows them (Kilo writes bash: allow into a config file that existed before its first start)';
|
|
344
355
|
return {
|
|
345
356
|
program: 'kilo',
|
|
346
357
|
args: [],
|
|
@@ -356,15 +367,16 @@ const kiloCode = {
|
|
|
356
367
|
describe: [
|
|
357
368
|
`Kilo Code with a "${KILO_PROVIDER}" provider at ${base} as its only provider, for this run only (your ~/.config/kilo is not changed)`,
|
|
358
369
|
'STAV_KILO_API_KEY=<the key, in the environment only>',
|
|
359
|
-
|
|
370
|
+
modelLine,
|
|
360
371
|
describeWindow,
|
|
361
372
|
describePicker(picker.models, picker.dropped, ctx, '/models'),
|
|
362
373
|
`at most ${KILO_MAX_OUTPUT} output tokens per call`,
|
|
363
374
|
'KILO_TELEMETRY_LEVEL=off, KILO_DISABLE_SESSION_INGEST=1, KILO_DISABLE_SHARE=1 (no usage data or session uploads to Kilo)',
|
|
364
|
-
|
|
365
|
-
|
|
375
|
+
noteLine,
|
|
376
|
+
agentLine,
|
|
366
377
|
'run one task without the chat screen after --, for example: stav launch kilo-code -- run "fix the failing test". kilo run refuses the shell commands it would ask about; add --auto after run to allow them without asking',
|
|
367
378
|
],
|
|
379
|
+
brief: [modelLine, noteLine, agentLine],
|
|
368
380
|
};
|
|
369
381
|
},
|
|
370
382
|
};
|
|
@@ -403,6 +415,10 @@ const githubCopilot = {
|
|
|
403
415
|
};
|
|
404
416
|
if (routed)
|
|
405
417
|
env.COPILOT_PROVIDER_WIRE_MODEL = id;
|
|
418
|
+
const modelLine = routed
|
|
419
|
+
? `model ${id}${model ? '' : " (your workspace's default Router)"}, given to the CLI as ${COPILOT_ROUTER_MODEL}`
|
|
420
|
+
: `model ${id}`;
|
|
421
|
+
const noteLine = 'note: the Copilot CLI runs commands and edits files. It asks first unless you pass --allow-all-tools (COPILOT_ALLOW_ALL from your shell is removed for this run)';
|
|
406
422
|
return {
|
|
407
423
|
program: 'copilot',
|
|
408
424
|
args: [],
|
|
@@ -429,13 +445,12 @@ const githubCopilot = {
|
|
|
429
445
|
describe: [
|
|
430
446
|
`the Copilot CLI with Stav at ${base} as its model provider, for this run only (no provider settings are written to ~/.copilot)`,
|
|
431
447
|
'COPILOT_PROVIDER_API_KEY=<the key, in the environment only>',
|
|
432
|
-
|
|
433
|
-
? `model ${id}${model ? '' : " (your workspace's default Router)"}, given to the CLI as ${COPILOT_ROUTER_MODEL}`
|
|
434
|
-
: `model ${id}`,
|
|
448
|
+
modelLine,
|
|
435
449
|
'COPILOT_OFFLINE=true (no GitHub sign-in, telemetry, web tools, GitHub MCP server or auto-update)',
|
|
436
|
-
|
|
450
|
+
noteLine,
|
|
437
451
|
'run one task without the chat screen after --, for example: stav launch github-copilot -- -p "fix the failing test". -p cannot ask, so it refuses edits and commands; add --allow-tool or --allow-all-tools after the task to allow them without asking',
|
|
438
452
|
],
|
|
453
|
+
brief: [modelLine, noteLine],
|
|
439
454
|
};
|
|
440
455
|
},
|
|
441
456
|
};
|
|
@@ -475,6 +490,8 @@ const pi = {
|
|
|
475
490
|
: contextWindow === undefined && namedModel(model)
|
|
476
491
|
? "the model's largest context window in your workspace, read from Stav"
|
|
477
492
|
: `a context window of ${PI_DEFAULT_CONTEXT} tokens (pi compacts the chat by it)`;
|
|
493
|
+
const modelLine = model ? `model ${model}` : "model auto (your workspace's default Router)";
|
|
494
|
+
const noteLine = 'note: pi runs the commands the model writes without asking, and those commands can read STAV_PI_API_KEY from their environment; run it in a folder or container where that is safe';
|
|
478
495
|
return {
|
|
479
496
|
program: 'pi',
|
|
480
497
|
args: ['--extension', PI_EXTENSION_FILE, '--provider', PI_PROVIDER, '--model', id],
|
|
@@ -492,14 +509,15 @@ const pi = {
|
|
|
492
509
|
describe: [
|
|
493
510
|
`pi with a "${PI_PROVIDER}" provider at ${base}, loaded from a file that ships with the Stav CLI, for this run only (no provider settings are written to ~/.pi/agent)`,
|
|
494
511
|
'STAV_PI_API_KEY=<the key, in the environment only>',
|
|
495
|
-
|
|
512
|
+
modelLine,
|
|
496
513
|
describeWindow,
|
|
497
514
|
describePicker(picker.models, picker.dropped, ctx, '/model'),
|
|
498
515
|
`at most ${PI_MAX_TOKENS} output tokens per call`,
|
|
499
516
|
'PI_OFFLINE=1 (no model catalogue refresh or update check at pi.dev)',
|
|
500
|
-
|
|
517
|
+
noteLine,
|
|
501
518
|
'run one task without the chat screen after --, for example: stav launch pi -- -p "fix the failing test"',
|
|
502
519
|
],
|
|
520
|
+
brief: [modelLine, noteLine],
|
|
503
521
|
};
|
|
504
522
|
},
|
|
505
523
|
async conflicts(home = os.homedir(), cwd = process.cwd(), env = process.env, appArgs = []) {
|
|
@@ -592,6 +610,8 @@ const hermesAgent = {
|
|
|
592
610
|
const base = `${gatewayUrl}/v1`;
|
|
593
611
|
const id = model ?? 'auto';
|
|
594
612
|
const home = hermesHome(key);
|
|
613
|
+
const modelLine = model ? `model ${model}` : "model auto (your workspace's default Router)";
|
|
614
|
+
const noteLine = 'note: Hermes runs the commands the model writes. Commands it does not judge dangerous run without asking, and with -z every command runs without asking. Those commands can read STAV_HERMES_API_KEY from their environment; run it in a folder or container where that is safe';
|
|
595
615
|
return {
|
|
596
616
|
program: 'hermes',
|
|
597
617
|
args: ['--provider', `custom:${HERMES_PROVIDER}`, '-m', id],
|
|
@@ -607,12 +627,13 @@ const hermesAgent = {
|
|
|
607
627
|
`Hermes Agent with a "${HERMES_PROVIDER}" provider at ${base}, set by a file that ships with the Stav CLI, for this run only`,
|
|
608
628
|
`a Hermes home of its own in ${hermesHomes()}, one folder per API key (a new key starts an empty one): sessions, memory and skills there are kept apart from your own Hermes, and ~/.hermes is not read or changed`,
|
|
609
629
|
'STAV_HERMES_API_KEY=<the key, in the environment only>',
|
|
610
|
-
|
|
630
|
+
modelLine,
|
|
611
631
|
"Hermes reads each model's context window from Stav",
|
|
612
632
|
'no update check at GitHub and no free third-party web search fallback (both would go around Stav)',
|
|
613
|
-
|
|
633
|
+
noteLine,
|
|
614
634
|
'run one task without the chat screen after --, for example: stav launch hermes-agent -- -z "fix the failing test"',
|
|
615
635
|
],
|
|
636
|
+
brief: [modelLine, noteLine],
|
|
616
637
|
};
|
|
617
638
|
},
|
|
618
639
|
};
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* stav login | logout | whoami
|
|
6
6
|
* stav workspace [<slug>]
|
|
7
7
|
* stav apps
|
|
8
|
-
* stav launch <app> [--model <id>] [--workspace <slug>] [--yes] [-- <app arguments>]
|
|
8
|
+
* stav launch <app> [--model <id>] [--workspace <slug>] [--yes] [--verbose] [-- <app arguments>]
|
|
9
9
|
*
|
|
10
10
|
* No telemetry (spec B.9).
|
|
11
11
|
*/
|
|
@@ -35,6 +35,7 @@ Launch options:
|
|
|
35
35
|
--model <id> The model, e.g. zai-org/glm-5-2 (default: the app's Stav default)
|
|
36
36
|
--workspace <slug> The workspace to use for this run
|
|
37
37
|
--yes Do not ask before making the key
|
|
38
|
+
--verbose Show every setting before starting the app
|
|
38
39
|
|
|
39
40
|
Environment:
|
|
40
41
|
STAV_API_KEY Use this key; no sign-in and no key is made
|
|
@@ -62,6 +63,7 @@ async function main(argv) {
|
|
|
62
63
|
model: { type: 'string' },
|
|
63
64
|
workspace: { type: 'string' },
|
|
64
65
|
yes: { type: 'boolean', short: 'y' },
|
|
66
|
+
verbose: { type: 'boolean' },
|
|
65
67
|
'forget-keys': { type: 'boolean' },
|
|
66
68
|
help: { type: 'boolean', short: 'h' },
|
|
67
69
|
version: { type: 'boolean', short: 'v' },
|
|
@@ -192,7 +194,7 @@ async function main(argv) {
|
|
|
192
194
|
platform: process.platform,
|
|
193
195
|
cwd: process.cwd(),
|
|
194
196
|
};
|
|
195
|
-
return launch({ app, model: values.model, workspace: values.workspace, yes: values.yes, appArgs }, deps);
|
|
197
|
+
return launch({ app, model: values.model, workspace: values.workspace, yes: values.yes, verbose: values.verbose, appArgs }, deps);
|
|
196
198
|
}
|
|
197
199
|
default:
|
|
198
200
|
err(`Unknown command "${command}".\n`);
|
package/dist/launch.js
CHANGED
|
@@ -217,35 +217,37 @@ export async function settleKey(plan, d) {
|
|
|
217
217
|
}
|
|
218
218
|
return made.full_key;
|
|
219
219
|
}
|
|
220
|
-
export function describePlan(plan, launch, appArgs, storeKind = 'keychain') {
|
|
220
|
+
export function describePlan(plan, launch, appArgs, storeKind = 'keychain', verbose = false) {
|
|
221
221
|
const lines = [];
|
|
222
222
|
if (plan.workspace)
|
|
223
223
|
lines.push(`Workspace: ${plan.workspace.name}`);
|
|
224
|
+
const keep = storeKind === 'keychain'
|
|
225
|
+
? 'keep it in your keychain (never in this folder)'
|
|
226
|
+
: 'keep it in a file only you can read (no keychain here; never in this folder)';
|
|
224
227
|
if ('create' in plan.key) {
|
|
225
228
|
// A Stav that does not yet limit personal keys makes this key with
|
|
226
229
|
// full access, so this is said before the question, not after.
|
|
227
|
-
lines.push(`Make a personal API key "${plan.key.name}"
|
|
230
|
+
lines.push(`Make a personal API key "${plan.key.name}" with access to ${plan.adapter.scopes.join(', ')} only, and ${keep} for next time. If Stav cannot limit personal keys yet, the key has full access to your workspace.`);
|
|
228
231
|
if (plan.key.orWorkspaceKey) {
|
|
229
232
|
lines.push(`If ${plan.workspace.name} does not allow personal keys, make a workspace API key with the same name and access instead.`);
|
|
230
233
|
}
|
|
231
|
-
lines.push(storeKind === 'keychain'
|
|
232
|
-
? 'Keep it in your keychain (never in this folder), and use it next time.'
|
|
233
|
-
: 'Keep it in a file only you can read (no keychain here; never in this folder), and use it next time.');
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
236
236
|
lines.push(plan.key.source === 'env' ? 'Use the key in STAV_API_KEY.' : `Use your saved ${plan.adapter.displayName} key.`);
|
|
237
237
|
}
|
|
238
238
|
lines.push(`Start ${plan.adapter.displayName} (${plan.programPath}) with:`);
|
|
239
|
-
for (const l of launch.describe)
|
|
239
|
+
for (const l of verbose ? launch.describe : launch.brief)
|
|
240
240
|
lines.push(` ${l}`);
|
|
241
241
|
if (appArgs.length)
|
|
242
242
|
lines.push(` your arguments: ${appArgs.join(' ')}`);
|
|
243
|
+
if (!verbose)
|
|
244
|
+
lines.push('Add --verbose to see every setting.');
|
|
243
245
|
return lines;
|
|
244
246
|
}
|
|
245
247
|
export async function launch(opts, d) {
|
|
246
248
|
const plan = await planLaunch(opts, d);
|
|
247
249
|
const preview = plan.adapter.plan({ gatewayUrl: d.cfg.gatewayUrl, key: '<key>', model: plan.model });
|
|
248
|
-
for (const line of describePlan(plan, preview, opts.appArgs, d.store.kind))
|
|
250
|
+
for (const line of describePlan(plan, preview, opts.appArgs, d.store.kind, opts.verbose))
|
|
249
251
|
d.log(line);
|
|
250
252
|
const changes = 'create' in plan.key;
|
|
251
253
|
if (!opts.yes) {
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The CLI's own version. Kept equal to package.json by units.test.ts ("VERSION matches package.json"). */
|
|
2
|
-
export const VERSION = '0.1.
|
|
2
|
+
export const VERSION = '0.1.7';
|