@getstackrun/cli 2.0.2 → 2.1.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/LICENSE +202 -0
- package/README.md +332 -42
- package/dist/agent.js +11 -11
- package/dist/agent.js.map +1 -1
- package/dist/auth.d.ts +1 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +19 -16
- package/dist/auth.js.map +1 -1
- package/dist/commands.d.ts +49 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +681 -0
- package/dist/commands.js.map +1 -0
- package/dist/evidence-packs.js +1 -1
- package/dist/evidence-packs.js.map +1 -1
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +1 -0
- package/dist/format.js.map +1 -1
- package/dist/help.d.ts +17 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +137 -0
- package/dist/help.js.map +1 -0
- package/dist/identity.js +2 -2
- package/dist/identity.js.map +1 -1
- package/dist/inbound-webhooks.d.ts.map +1 -1
- package/dist/inbound-webhooks.js +4 -3
- package/dist/inbound-webhooks.js.map +1 -1
- package/dist/index.js +8 -226
- package/dist/index.js.map +1 -1
- package/dist/intents.d.ts.map +1 -1
- package/dist/intents.js +1 -2
- package/dist/intents.js.map +1 -1
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +9 -8
- package/dist/llm.js.map +1 -1
- package/dist/me.js +1 -1
- package/dist/me.js.map +1 -1
- package/dist/missions.d.ts.map +1 -1
- package/dist/missions.js +1 -2
- package/dist/missions.js.map +1 -1
- package/dist/partner.d.ts.map +1 -1
- package/dist/partner.js +6 -5
- package/dist/partner.js.map +1 -1
- package/dist/proxy-serve.js +2 -2
- package/dist/proxy-serve.js.map +1 -1
- package/dist/quickstart.js +1 -1
- package/dist/quickstart.js.map +1 -1
- package/dist/services.js +3 -3
- package/dist/services.js.map +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +1 -0
- package/dist/usage.js.map +1 -1
- package/package.json +3 -2
package/dist/commands.js
ADDED
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
// The single registry of CLI commands. `--help` (help.ts) and the command
|
|
2
|
+
// reference in README.md are both rendered from this data, and
|
|
3
|
+
// commands.test.ts fails when the router in index.ts, the README block or a
|
|
4
|
+
// usage string in any module drifts from it.
|
|
5
|
+
//
|
|
6
|
+
// Entries are plain data with no colour and no program name: the renderers add
|
|
7
|
+
// those. Inline `code` spans in summaries and notes render as highlighted
|
|
8
|
+
// text in `--help` and as code in the README.
|
|
9
|
+
export const COMMAND_GROUPS = [
|
|
10
|
+
{
|
|
11
|
+
title: 'Get started',
|
|
12
|
+
entries: [
|
|
13
|
+
{
|
|
14
|
+
usage: 'quickstart',
|
|
15
|
+
summary: 'Guided setup: register a safe bot, issue a passport, make one governed LLM call, print the audit row',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
usage: 'proxy serve --agent <name|id>',
|
|
19
|
+
summary: "Run a localhost LLM gateway. Point any tool's baseURL at it (dummy key ok); STACK injects the real key. No key on the box.",
|
|
20
|
+
notes: ['[--port 8788] [--provider anthropic|openai|openrouter] [--mission-ttl 3600]'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
usage: 'setup [--clients claude,codex,cursor]',
|
|
24
|
+
summary: 'Add STACK to one or several installed MCP clients',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
usage: 'register',
|
|
28
|
+
summary: 'Print signup and MCP install instructions',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: 'Account',
|
|
34
|
+
entries: [
|
|
35
|
+
{ usage: 'auth login', summary: 'Sign in via browser (Device flow, RFC 8628)' },
|
|
36
|
+
{ usage: 'auth status', summary: 'Show current sign-in state' },
|
|
37
|
+
{ usage: 'auth logout', summary: 'Revoke session and clear local credentials' },
|
|
38
|
+
{ usage: 'me', summary: 'Print your operator profile' },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: 'Usage & billing',
|
|
43
|
+
entries: [
|
|
44
|
+
{ usage: 'usage', summary: 'Consumption vs plan + spend + earnings (billing period)' },
|
|
45
|
+
{
|
|
46
|
+
usage: 'usage --period <p>',
|
|
47
|
+
summary: 'Scope to a window: today | yesterday | 7d | 30d | month | last-month | billing (default)',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
usage: 'usage --since <iso> --until <iso>',
|
|
51
|
+
summary: 'Arbitrary range (ISO-8601 or unix-ms)',
|
|
52
|
+
notes: ['`scan usage` and `llm usage` drill into those meters'],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
title: 'Agents',
|
|
58
|
+
entries: [
|
|
59
|
+
{ usage: 'agent list', summary: 'List all your agents' },
|
|
60
|
+
{ usage: 'agent show <name|id>', summary: 'Detail on one agent' },
|
|
61
|
+
{
|
|
62
|
+
usage: 'agent register <name>',
|
|
63
|
+
summary: 'Register a new agent',
|
|
64
|
+
notes: [
|
|
65
|
+
'[--profile proxied-llm-bot] <- safe default for a bot that just runs',
|
|
66
|
+
'[--key-mode stack_managed|customer_managed|co_signed]',
|
|
67
|
+
'[--llm-inject-system-prompt true|false] [--llm-redact-pii true|false]',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
usage: 'agent update <name|id>',
|
|
72
|
+
summary: 'Update LLM-gateway toggles (both default true / fail-closed)',
|
|
73
|
+
notes: [
|
|
74
|
+
'[--llm-inject-system-prompt true|false]',
|
|
75
|
+
'[--llm-redact-pii true|false] <- false sends user PII to the provider unredacted',
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
usage: 'agent enroll <name|id>',
|
|
80
|
+
summary: "Enroll a customer-managed keypair (advanced; stack_managed agents and 'proxy serve' auto-enroll, no manual step)",
|
|
81
|
+
},
|
|
82
|
+
{ usage: 'agent rotate <name|id>', summary: 'Rotate keypair (admin only)' },
|
|
83
|
+
{
|
|
84
|
+
usage: 'agent sign-claim <name|id>',
|
|
85
|
+
summary: 'Sign a claim envelope locally (customer_managed mode)',
|
|
86
|
+
notes: ['--envelope <file.json> [--out <file>]'],
|
|
87
|
+
},
|
|
88
|
+
{ usage: 'agent suspend <name|id>', summary: 'Suspend an agent' },
|
|
89
|
+
{ usage: 'agent unsuspend <name|id>', summary: 'Re-activate a suspended agent' },
|
|
90
|
+
{
|
|
91
|
+
usage: 'agent unblock <name|id>',
|
|
92
|
+
summary: 'Clear an auto-blocked agent so it can issue new passports',
|
|
93
|
+
},
|
|
94
|
+
{ usage: 'agent delete <name|id>', summary: 'Delete an agent' },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: 'Passports',
|
|
99
|
+
entries: [
|
|
100
|
+
{ usage: 'passport list', summary: 'List active passports' },
|
|
101
|
+
{
|
|
102
|
+
usage: 'passport issue --agent <name|id> --mission <ms_id> --intent "<summary>"',
|
|
103
|
+
summary: 'Issue a passport for an agent under a Mission',
|
|
104
|
+
notes: ['[--services slack,stripe] [--ttl <seconds>]', 'or: --from-file issue.json [--mission <ms_id>]'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
usage: 'passport delegate --agent <child>',
|
|
108
|
+
summary: 'Delegate a passport to a child agent (reads the parent token securely)',
|
|
109
|
+
notes: ['[--services a,b] [--ttl 900]'],
|
|
110
|
+
},
|
|
111
|
+
{ usage: 'passport verify', summary: 'Verify a passport JWT from stdin' },
|
|
112
|
+
{ usage: 'passport refresh <jti>', summary: 'Refresh a passport JWT from stdin' },
|
|
113
|
+
{ usage: 'passport revoke <jti>', summary: 'Revoke one passport' },
|
|
114
|
+
{ usage: 'passport revoke-agent <id>', summary: 'Revoke all passports for an agent' },
|
|
115
|
+
{ usage: 'passport revoke-session <id>', summary: 'Revoke all passports for a session' },
|
|
116
|
+
{ usage: 'passport revoke-all --yes', summary: 'Revoke every active passport' },
|
|
117
|
+
{ usage: 'passport report <jti>', summary: 'Show the report for one passport' },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: 'Missions',
|
|
122
|
+
entries: [
|
|
123
|
+
{
|
|
124
|
+
usage: 'mission start --agent <name|id> --intent-summary "..."',
|
|
125
|
+
summary: 'Open a Mission for an agent and issue its Passport',
|
|
126
|
+
notes: ['[--services a,b] [--expires-in N] [--ttl N]'],
|
|
127
|
+
},
|
|
128
|
+
{ usage: 'mission start --file <path>', summary: 'Start a Mission under a fleet policy' },
|
|
129
|
+
{
|
|
130
|
+
usage: 'mission open --intent-summary "..."',
|
|
131
|
+
summary: 'Open a Mission before issuing its Passport',
|
|
132
|
+
notes: ['[--agent <name|id>] [--services a,b] [--expires-in N]'],
|
|
133
|
+
},
|
|
134
|
+
{ usage: 'mission open --file <path>', summary: 'Open a Mission from a request file' },
|
|
135
|
+
{ usage: 'mission renew <id>', summary: 'Renew the Passport for an existing Mission' },
|
|
136
|
+
{ usage: 'mission list', summary: 'List Missions' },
|
|
137
|
+
{ usage: 'mission get <id>', summary: 'Show one Mission' },
|
|
138
|
+
{
|
|
139
|
+
usage: 'mission complete <id>',
|
|
140
|
+
summary: 'Complete a Mission',
|
|
141
|
+
notes: ['[--output-json <path>]'],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
usage: 'mission revoke <id> --reason <r>',
|
|
145
|
+
summary: 'Revoke a Mission with reason adversarial or operator_initiated_clean',
|
|
146
|
+
notes: ['[--notes "..."]'],
|
|
147
|
+
},
|
|
148
|
+
{ usage: 'mission replay <id>', summary: 'Replay a Mission' },
|
|
149
|
+
{ usage: 'mission dossiers <id>', summary: "List a Mission's dossiers" },
|
|
150
|
+
{
|
|
151
|
+
usage: 'mission dossier <id> --narrative "..."',
|
|
152
|
+
summary: 'Write a dossier for a Mission',
|
|
153
|
+
notes: ['[--lessons "..."] [--classification false_positive|true_positive_handled|true_positive_escalated|inconclusive]'],
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
title: 'Fleets',
|
|
159
|
+
entries: [
|
|
160
|
+
{ usage: 'fleet list [--page <number>] [--limit <number>]', summary: 'List fleet policies' },
|
|
161
|
+
{ usage: 'fleet get <id>', summary: 'Read one fleet policy and its shared usage' },
|
|
162
|
+
{ usage: 'fleet membership <agent>', summary: 'Read the fleet policy an agent belongs to' },
|
|
163
|
+
{
|
|
164
|
+
usage: 'fleet activate --file <path> --idempotency-key <key>',
|
|
165
|
+
summary: 'Request approval for a fleet policy',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
usage: 'fleet revise <id> --file <path> --expected-revision <number> --idempotency-key <key>',
|
|
169
|
+
summary: 'Request approval for a policy change',
|
|
170
|
+
},
|
|
171
|
+
{ usage: 'fleet revoke <id>', summary: 'Revoke a fleet policy' },
|
|
172
|
+
{
|
|
173
|
+
usage: 'fleet members <id> [--page <number>] [--limit <number>]',
|
|
174
|
+
summary: 'List the agents in a fleet policy',
|
|
175
|
+
},
|
|
176
|
+
{ usage: 'fleet revoke-member <id> <agent>', summary: "Revoke one agent's fleet membership" },
|
|
177
|
+
{ usage: 'fleet enrollment-challenge <id>', summary: 'Request an enrollment challenge' },
|
|
178
|
+
{
|
|
179
|
+
usage: 'fleet enroll <id> --file <path>',
|
|
180
|
+
summary: 'Enroll with a public key and signed challenge',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
usage: 'fleet enroll-local <id> --name <name> --idempotency-key <key>',
|
|
184
|
+
summary: 'Create and store an agent key on this machine, then enroll it',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
usage: 'fleet enroll-workload-local <id> --name <name> --idempotency-key <key>',
|
|
188
|
+
summary: 'Enroll using a trusted workload token from STACK_WORKLOAD_TOKEN',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
usage: 'fleet session [--fleet-policy-id <id>]',
|
|
192
|
+
summary: 'Create a short-lived MCP session',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
title: 'Intents',
|
|
198
|
+
entries: [
|
|
199
|
+
{ usage: 'intents simulate --intent-json <path>', summary: 'Dry-run an Intent' },
|
|
200
|
+
{ usage: 'intents submit --intent-json <path>', summary: 'Submit for approval' },
|
|
201
|
+
{
|
|
202
|
+
usage: 'intents submit-and-wait --intent-json <path>',
|
|
203
|
+
summary: 'Submit for approval and wait for the decision',
|
|
204
|
+
notes: ['[--timeout 60] [--interval 1] [--expires 900] [--skip-simulation]'],
|
|
205
|
+
},
|
|
206
|
+
{ usage: 'intents pending', summary: 'List pending approvals' },
|
|
207
|
+
{ usage: 'intents get <approval-id>', summary: 'Show one approval row (any status)' },
|
|
208
|
+
{ usage: 'intents approve <approval-id> [--notes "..."]', summary: 'Approve an Intent' },
|
|
209
|
+
{
|
|
210
|
+
usage: 'intents reject <approval-id> [--notes "..."] [--block-future]',
|
|
211
|
+
summary: 'Reject an Intent',
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
title: 'Authority',
|
|
217
|
+
entries: [
|
|
218
|
+
{
|
|
219
|
+
usage: 'authority request --file <request.json> --idempotency-key <key>',
|
|
220
|
+
summary: 'Submit an authority request for approval',
|
|
221
|
+
},
|
|
222
|
+
{ usage: 'authority status <request-id>', summary: 'Show an authority request and its decision' },
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
title: 'Evidence packs',
|
|
227
|
+
entries: [
|
|
228
|
+
{
|
|
229
|
+
usage: 'evidence-pack export --scope <kind>:<ref>',
|
|
230
|
+
summary: 'Export a signed evidence pack for a mission, session, incident or period',
|
|
231
|
+
notes: ['[--supersedes pck_*] [--output pack.json] [--air-gap]'],
|
|
232
|
+
},
|
|
233
|
+
{ usage: 'evidence-pack list [--scope <kind>:<ref>]', summary: 'List evidence packs' },
|
|
234
|
+
{ usage: 'evidence-pack get <pack-id>', summary: 'Show one evidence pack' },
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
title: 'Services',
|
|
239
|
+
entries: [
|
|
240
|
+
{ usage: 'service catalog', summary: 'Browse available service catalog' },
|
|
241
|
+
{ usage: 'service templates', summary: 'List credential templates' },
|
|
242
|
+
{ usage: 'service connections', summary: 'List your connected services' },
|
|
243
|
+
{ usage: 'service show <connection-id>', summary: 'Detail on one connection' },
|
|
244
|
+
{ usage: 'service verify <connection-id>', summary: 'Re-test connection health' },
|
|
245
|
+
{ usage: 'service disconnect <id>', summary: 'Disconnect a service' },
|
|
246
|
+
{ usage: 'service credential <provider>', summary: 'Retrieve raw credential (operator only)' },
|
|
247
|
+
{
|
|
248
|
+
usage: 'service connect-custom --stdin --name <name>',
|
|
249
|
+
summary: 'Connect a custom service; the secret is read from stdin',
|
|
250
|
+
notes: ['[--scopes a,b] or: --from-file <config.json>'],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
usage: 'service grant --agent <id> --connection <id> --scopes <a,b>',
|
|
254
|
+
summary: 'Grant an agent scoped access to a connection',
|
|
255
|
+
notes: ['[--allow-data-from <service,...>] Omit for no cross-service flow'],
|
|
256
|
+
},
|
|
257
|
+
{ usage: 'service revoke-agent <agent-id>', summary: "Revoke an agent's service grants" },
|
|
258
|
+
{ usage: 'service permissions <agent-id>', summary: "Show an agent's service permissions" },
|
|
259
|
+
],
|
|
260
|
+
footnote: 'When a governance change needs human approval, the CLI prints and opens the dashboard\n' +
|
|
261
|
+
'request, waits for that decision, and retries the exact command once if approved.',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
title: 'Drop-offs',
|
|
265
|
+
entries: [
|
|
266
|
+
{ usage: 'dropoff list', summary: 'List your drop-offs' },
|
|
267
|
+
{ usage: 'dropoff show <id>', summary: 'Detail on one drop-off' },
|
|
268
|
+
{
|
|
269
|
+
usage: 'dropoff create --from <a> --to <b> --schema <f>',
|
|
270
|
+
summary: 'Create a drop-off between two agents',
|
|
271
|
+
notes: ['[--ttl <seconds>] [--on-expire notify|retry|fail]'],
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
usage: 'dropoff deposit <id> --agent <a> --payload <f>',
|
|
275
|
+
summary: 'Deposit a payload into a drop-off',
|
|
276
|
+
notes: ['[--passport-jti <jti>] [--mission <id>]'],
|
|
277
|
+
},
|
|
278
|
+
{ usage: 'dropoff collect <id> --agent <a>', summary: 'Collect a payload from a drop-off' },
|
|
279
|
+
{ usage: 'dropoff expire <id>', summary: 'Force-expire a drop-off' },
|
|
280
|
+
],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
title: 'Skills',
|
|
284
|
+
entries: [
|
|
285
|
+
{ usage: 'skill list [--q "..."]', summary: 'Browse the skills marketplace' },
|
|
286
|
+
{ usage: 'skill mine', summary: 'List your own published skills' },
|
|
287
|
+
{ usage: 'skill show <id>', summary: 'Detail on one skill' },
|
|
288
|
+
{ usage: 'skill publish --file <skill.json>', summary: 'Publish a skill from a JSON spec' },
|
|
289
|
+
{ usage: "skill invoke <id> --agent <a> --input '{...}'", summary: 'Invoke a skill' },
|
|
290
|
+
{ usage: 'skill suspend <id>', summary: 'Suspend a published skill' },
|
|
291
|
+
{ usage: 'skill activate <id>', summary: 'Re-activate a suspended skill' },
|
|
292
|
+
{ usage: 'skill allow <id> --agent <a>', summary: 'Allow an agent to use a skill' },
|
|
293
|
+
{ usage: 'skill disallow <id> --agent <a>', summary: 'Stop an agent from using a skill' },
|
|
294
|
+
{ usage: 'skill favorites', summary: 'List your favourite skills' },
|
|
295
|
+
{ usage: 'skill invocations', summary: 'List pending skill invocations' },
|
|
296
|
+
{ usage: 'skill check-invocation <id>', summary: 'Show one skill invocation' },
|
|
297
|
+
{
|
|
298
|
+
usage: 'skill complete <id> --output-file <result.json>',
|
|
299
|
+
summary: 'Complete a skill invocation with its output',
|
|
300
|
+
},
|
|
301
|
+
{ usage: 'skill check-trust <skill-id>', summary: 'Check the trust level of a skill' },
|
|
302
|
+
{ usage: 'skill requests', summary: 'List skill requests' },
|
|
303
|
+
{ usage: 'skill post-request "<desc>"', summary: 'Post a new skill request' },
|
|
304
|
+
{
|
|
305
|
+
usage: 'skill matches <request-id>',
|
|
306
|
+
summary: 'Find skills matching a request',
|
|
307
|
+
notes: ['or: --description "<what you want to do>"'],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
usage: 'skill suggest <request-id>',
|
|
311
|
+
summary: 'Suggest a skill composition for a request',
|
|
312
|
+
notes: ['or: --description "<what you want to do>"'],
|
|
313
|
+
},
|
|
314
|
+
{ usage: 'skill pending-reviews', summary: 'List skills awaiting review (platform staff)' },
|
|
315
|
+
{ usage: 'skill approve <skill-id>', summary: 'Approve a skill (platform staff)' },
|
|
316
|
+
{ usage: 'skill reject <skill-id> [--reason "..."]', summary: 'Reject a skill (platform staff)' },
|
|
317
|
+
],
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
title: 'Scan',
|
|
321
|
+
entries: [
|
|
322
|
+
{
|
|
323
|
+
usage: 'scan "<content>" | --file <path>',
|
|
324
|
+
summary: 'Scan content for prompt injection',
|
|
325
|
+
},
|
|
326
|
+
{ usage: 'scan usage', summary: "This month's scan usage vs tier" },
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
title: 'LLM',
|
|
331
|
+
entries: [
|
|
332
|
+
{
|
|
333
|
+
usage: 'llm usage list',
|
|
334
|
+
summary: 'List per-call LLM usage records (cursor-paginated)',
|
|
335
|
+
notes: ['[--limit] [--cursor] [--provider] [--passport-jti] [--mission-id] [--agent-id] [--since] [--until]'],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
usage: 'llm usage summary',
|
|
339
|
+
summary: 'Group-by aggregate (provider [+ model] + day)',
|
|
340
|
+
notes: ["same filters as 'list', plus [--no-group-by-model]"],
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
usage: "llm anthropic messages '<body-json>' [--stream]",
|
|
344
|
+
summary: 'Governed Anthropic call; reads the passport token from stdin or a hidden prompt',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
usage: "llm openai chat-completions '<body-json>' [--stream]",
|
|
348
|
+
summary: 'Governed OpenAI call; reads the passport token from stdin or a hidden prompt',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
usage: "llm openrouter chat-completions '<body-json>' [--stream]",
|
|
352
|
+
summary: 'Governed OpenRouter call; reads the passport token from stdin or a hidden prompt',
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
title: 'Identity',
|
|
358
|
+
entries: [
|
|
359
|
+
{ usage: 'identity settings', summary: 'Get operator identity settings' },
|
|
360
|
+
{
|
|
361
|
+
usage: 'identity update-settings',
|
|
362
|
+
summary: 'Update operator identity settings',
|
|
363
|
+
notes: ['[--inheritance auto|opt_in] [--ttl 30d|90d|180d|1y] [--auto-revoke true|false]'],
|
|
364
|
+
},
|
|
365
|
+
{ usage: 'identity providers', summary: 'List identity-verification providers' },
|
|
366
|
+
{ usage: 'identity claims', summary: 'List your verified identity claims' },
|
|
367
|
+
{ usage: 'identity revoke-claim <id>', summary: 'Revoke an identity claim' },
|
|
368
|
+
{
|
|
369
|
+
usage: 'identity oidc <status|create|update|test|delete>',
|
|
370
|
+
summary: 'Manage the operator OIDC identity configuration',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
usage: 'identity spiffe <list|get|create|update|delete>',
|
|
374
|
+
summary: 'Manage SPIFFE trust domains',
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
usage: 'identity wimse <list|get|create|update|delete>',
|
|
378
|
+
summary: 'Manage WIMSE issuers',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
usage: 'identity requirements <list|create|replace|clear|delete> <service-id>',
|
|
382
|
+
summary: 'Manage the identity requirements of a service',
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
title: 'Audit',
|
|
388
|
+
entries: [
|
|
389
|
+
{ usage: 'audit list [--limit N] [--agent <id>]', summary: 'List audit entries' },
|
|
390
|
+
{
|
|
391
|
+
usage: 'audit export',
|
|
392
|
+
summary: 'Export the audit log',
|
|
393
|
+
notes: ['[--format json|ndjson|csv] [--from ...] [--to ...] [--out <file>]'],
|
|
394
|
+
},
|
|
395
|
+
{ usage: 'audit chain-head', summary: 'Current audit-chain head hash' },
|
|
396
|
+
{ usage: 'audit verify-chain', summary: 'Verify your audit chain integrity' },
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
title: 'PII redaction',
|
|
401
|
+
entries: [
|
|
402
|
+
{ usage: 'pii show', summary: 'Threshold + country scope in force' },
|
|
403
|
+
{ usage: 'pii set --countries SE,NO,DK', summary: "Only run these countries' schemes" },
|
|
404
|
+
{
|
|
405
|
+
usage: 'pii set --threshold 0.2',
|
|
406
|
+
summary: 'Confidence to redact (higher redacts less)',
|
|
407
|
+
},
|
|
408
|
+
{ usage: 'pii reset', summary: 'Back to built-in defaults' },
|
|
409
|
+
],
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
title: 'Detectors',
|
|
413
|
+
entries: [
|
|
414
|
+
{ usage: 'detector list', summary: 'List detectors and their configuration' },
|
|
415
|
+
{ usage: 'detector show <detector-key>', summary: 'Show one detector configuration' },
|
|
416
|
+
{ usage: 'detector enable <detector-key>', summary: 'Enable a detector' },
|
|
417
|
+
{ usage: 'detector disable <detector-key>', summary: 'Disable a detector' },
|
|
418
|
+
{
|
|
419
|
+
usage: 'detector configure <detector-key> --from-file <config.json>',
|
|
420
|
+
summary: 'Replace a detector configuration',
|
|
421
|
+
},
|
|
422
|
+
{ usage: 'detector reset <detector-key>', summary: 'Back to the built-in defaults' },
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
title: 'Security events',
|
|
427
|
+
entries: [
|
|
428
|
+
{ usage: 'event list [--agent <id>]', summary: 'List security events' },
|
|
429
|
+
{ usage: 'event show <id>', summary: 'Detail on one security event' },
|
|
430
|
+
{ usage: 'event resolve <id>', summary: 'Mark a security event resolved' },
|
|
431
|
+
],
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
title: 'Notifications',
|
|
435
|
+
entries: [
|
|
436
|
+
{ usage: 'notifications methods list', summary: 'List delivery methods' },
|
|
437
|
+
{
|
|
438
|
+
usage: 'notifications methods add --kind <k> --destination <addr>',
|
|
439
|
+
summary: 'Add a delivery method (kind: email, sms or webhook)',
|
|
440
|
+
},
|
|
441
|
+
{ usage: 'notifications methods test <id>', summary: 'Send a test notification' },
|
|
442
|
+
{ usage: 'notifications methods send-code <id>', summary: 'Send a verification code' },
|
|
443
|
+
{
|
|
444
|
+
usage: 'notifications methods verify <id> --code <code>',
|
|
445
|
+
summary: 'Verify a delivery method with its code',
|
|
446
|
+
},
|
|
447
|
+
{ usage: 'notifications methods delete <id>', summary: 'Delete a delivery method' },
|
|
448
|
+
{ usage: 'notifications rules list', summary: 'List notification rules' },
|
|
449
|
+
{
|
|
450
|
+
usage: 'notifications rules create --method <id> --events <e1,e2>',
|
|
451
|
+
summary: 'Create a notification rule',
|
|
452
|
+
notes: ['or: --methods <id1,id2> [--min-severity info|warning|critical]'],
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
usage: 'notifications rules update <id>',
|
|
456
|
+
summary: 'Update a notification rule',
|
|
457
|
+
notes: ['[--events e1,e2] [--min-severity info|warning|critical] [--methods id1,id2]'],
|
|
458
|
+
},
|
|
459
|
+
{ usage: 'notifications rules delete <id>', summary: 'Delete a notification rule' },
|
|
460
|
+
],
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
title: 'Inbound webhooks',
|
|
464
|
+
entries: [
|
|
465
|
+
{
|
|
466
|
+
usage: 'inbound-webhook create --provider <agentmail|generic> --agent <agt_*>',
|
|
467
|
+
summary: 'Create an inbound webhook (returns the URL and the plaintext secret)',
|
|
468
|
+
notes: ['[--forward-url <https://...>] log-only if omitted'],
|
|
469
|
+
},
|
|
470
|
+
{ usage: 'inbound-webhook list', summary: 'List all inbound webhooks' },
|
|
471
|
+
{ usage: 'inbound-webhook get --id <iwh_*>', summary: 'Show one inbound webhook' },
|
|
472
|
+
{ usage: 'inbound-webhook revoke --id <iwh_*>', summary: 'Revoke an inbound webhook' },
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
title: 'Partners',
|
|
477
|
+
entries: [
|
|
478
|
+
{
|
|
479
|
+
usage: 'partner connect --email <email>',
|
|
480
|
+
summary: 'Create or request a user-owned partner grant',
|
|
481
|
+
notes: ['[--external-customer-id <id>] [--scopes a,b] [--providers a,b]'],
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
usage: 'partner connections <list|get|revoke|rotate> [<grant-id>]',
|
|
485
|
+
summary: 'List, get, revoke or rotate partner-held grants',
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
usage: 'partner grants <list|revoke> [<grant-id>]',
|
|
489
|
+
summary: 'List or revoke grants held on your own account',
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
usage: 'partner tenant create',
|
|
493
|
+
summary: 'Create a white-label tenant (draws from your allowance)',
|
|
494
|
+
notes: ['[--external-customer-id <id>]'],
|
|
495
|
+
},
|
|
496
|
+
{ usage: 'partner tenant list', summary: 'List your tenants with month-to-date usage' },
|
|
497
|
+
{ usage: 'partner tenant get <id>', summary: 'Show one tenant' },
|
|
498
|
+
{
|
|
499
|
+
usage: 'partner tenant revoke <id>',
|
|
500
|
+
summary: 'Revoke a tenant, its webhooks and its passports',
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
usage: 'partner tenant webhook --tenant <op_*> --provider <p> --agent <agt_*>',
|
|
504
|
+
summary: 'Provision an inbound webhook under a tenant',
|
|
505
|
+
notes: ['[--forward-url <https://...>]'],
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
usage: 'partner tenant issue-passport --tenant <op_*> --agent <agt_*> --mission <ms_*>',
|
|
509
|
+
summary: 'Issue a passport for an agent under a tenant',
|
|
510
|
+
notes: ['[--intent "<summary>"] [--services a,b] [--ttl 900]'],
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
title: 'Team',
|
|
516
|
+
entries: [
|
|
517
|
+
{ usage: 'team list', summary: 'List team members' },
|
|
518
|
+
{
|
|
519
|
+
usage: 'team invite <email> --name "<full name>"',
|
|
520
|
+
summary: 'Invite a team member',
|
|
521
|
+
notes: ['[--role admin|standard|readonly] [--allowed-connections id1,id2]'],
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
usage: 'team update <id>',
|
|
525
|
+
summary: 'Change a team member',
|
|
526
|
+
notes: ['[--role admin|standard|readonly] [--allowed-connections id1,id2] [--status ...]'],
|
|
527
|
+
},
|
|
528
|
+
{ usage: 'team revoke <id>', summary: 'Remove a team member' },
|
|
529
|
+
],
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
title: 'Monitor',
|
|
533
|
+
entries: [
|
|
534
|
+
{ usage: 'monitor', summary: 'Replay a scripted run (same as --demo)' },
|
|
535
|
+
{ usage: 'monitor --demo [--loop]', summary: 'Replay a real-shape mission (no auth needed)' },
|
|
536
|
+
{ usage: 'monitor --follow', summary: 'Tail your own audit log' },
|
|
537
|
+
{ usage: 'monitor --sandbox', summary: 'Tail the public sandbox feed' },
|
|
538
|
+
{ usage: 'monitor --challenge', summary: 'Tail the public email agent feed' },
|
|
539
|
+
],
|
|
540
|
+
},
|
|
541
|
+
];
|
|
542
|
+
/**
|
|
543
|
+
* Router aliases per top-level verb. index.ts dispatches on the verb and on
|
|
544
|
+
* every alias listed here; commands.test.ts keeps the two in step.
|
|
545
|
+
*/
|
|
546
|
+
export const COMMAND_ALIASES = {
|
|
547
|
+
agent: ['agents'],
|
|
548
|
+
passport: ['passports'],
|
|
549
|
+
intents: ['intent'],
|
|
550
|
+
mission: ['missions'],
|
|
551
|
+
fleet: ['fleets'],
|
|
552
|
+
'evidence-pack': ['evidence-packs'],
|
|
553
|
+
'inbound-webhook': ['inbound-webhooks'],
|
|
554
|
+
quickstart: ['init'],
|
|
555
|
+
service: ['services'],
|
|
556
|
+
dropoff: ['dropoffs'],
|
|
557
|
+
skill: ['skills'],
|
|
558
|
+
event: ['events', 'security-event', 'security-events'],
|
|
559
|
+
team: ['members', 'member'],
|
|
560
|
+
me: ['whoami'],
|
|
561
|
+
notifications: ['notification', 'notify'],
|
|
562
|
+
detector: ['detectors'],
|
|
563
|
+
};
|
|
564
|
+
export const OPTION_SECTIONS = [
|
|
565
|
+
{
|
|
566
|
+
title: 'Global flags',
|
|
567
|
+
entries: [{ name: '--json', description: 'Emit raw JSON instead of formatted tables.' }],
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
title: 'Environment',
|
|
571
|
+
entries: [
|
|
572
|
+
{
|
|
573
|
+
name: 'STACK_OAUTH_SCOPE',
|
|
574
|
+
description: 'Override the OAuth scope requested at `auth login`. Default covers routine runtime and inspection flows; account, secret, billing and security administration remain explicit opt-ins. Set an exact subset (e.g. "passports:read agents:read services:read audit:read") for monitoring-only sign-ins.',
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: 'STACK_API_KEY',
|
|
578
|
+
description: 'Legacy sk_live_… key. Bypasses `auth login`; for CI and headless environments without a browser.',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: 'STACK_API_URL',
|
|
582
|
+
description: 'Point the CLI at a non-prod API (self-host / dev). Defaults to https://api.getstack.run.',
|
|
583
|
+
},
|
|
584
|
+
],
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
title: 'monitor flags',
|
|
588
|
+
entries: [
|
|
589
|
+
{
|
|
590
|
+
name: '--demo',
|
|
591
|
+
description: 'Replay a real-shape mission (no auth needed). Same row format as --follow, just scripted.',
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: '--follow',
|
|
595
|
+
description: "Tail your operator's actual audit_log. Polls every 2s. Uses your `auth login` session (or STACK_API_KEY).",
|
|
596
|
+
},
|
|
597
|
+
{ name: '--loop', description: 'Loop the demo until Ctrl-C (default is one run).' },
|
|
598
|
+
{ name: '--agent <agent_id>', description: '(--follow) Only show entries for this agent.' },
|
|
599
|
+
{ name: '--jti <passport_jti>', description: '(--follow) Only show entries for this passport.' },
|
|
600
|
+
{
|
|
601
|
+
name: '--sandbox',
|
|
602
|
+
description: 'Tail the public sandbox feed at {apiUrl}/v1/public/events. No API key needed; implies a live tail (no --follow required). Same stream visitors see on getstack.run.',
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: '--challenge',
|
|
606
|
+
description: 'Tail the public email agent at agent@getstack.run ({apiUrl}/v1/public/events?feed=challenge). No API key needed; implies a live tail. Same stream the board on getstack.run/attack renders.',
|
|
607
|
+
},
|
|
608
|
+
],
|
|
609
|
+
},
|
|
610
|
+
];
|
|
611
|
+
/** Worked examples printed by `--help`. `cli` steps get the invocation prefix. */
|
|
612
|
+
export const HELP_EXAMPLES = [
|
|
613
|
+
{
|
|
614
|
+
comment: ['enroll a freshly-registered agent so the SDK skips the dance'],
|
|
615
|
+
steps: [{ cli: 'agent enroll research-pipeline' }],
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
comment: ['replay a credential-exfiltration-caught-by-scope_drift mission'],
|
|
619
|
+
steps: [{ cli: 'monitor --demo --loop' }],
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
comment: ['tail the public sandbox (no signup, no key)'],
|
|
623
|
+
steps: [{ cli: 'monitor --sandbox' }],
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
comment: ['watch strangers attack our public email agent, live'],
|
|
627
|
+
steps: [{ cli: 'monitor --challenge' }],
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
comment: ['sign in once, then tail your real audit log (everything)'],
|
|
631
|
+
steps: [{ cli: 'auth login' }, { cli: 'monitor --follow' }],
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
comment: ['tail just one agent'],
|
|
635
|
+
steps: [{ cli: 'monitor --follow --agent abc123' }],
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
comment: [
|
|
639
|
+
'in CI (no interactive login): export the key, never inline it on the',
|
|
640
|
+
'command line — an inlined key lands in shell history in plaintext.',
|
|
641
|
+
],
|
|
642
|
+
steps: [{ shell: 'export STACK_API_KEY=sk_live_…' }, { cli: 'monitor --follow' }],
|
|
643
|
+
},
|
|
644
|
+
];
|
|
645
|
+
const ARGUMENT_START = /^[<[("'-]/;
|
|
646
|
+
/** The words of a usage string that name the command, before any argument. */
|
|
647
|
+
export function commandPath(usage) {
|
|
648
|
+
const words = usage.split(' ');
|
|
649
|
+
const path = [];
|
|
650
|
+
for (const word of words) {
|
|
651
|
+
if (ARGUMENT_START.test(word))
|
|
652
|
+
break;
|
|
653
|
+
path.push(word);
|
|
654
|
+
}
|
|
655
|
+
return path.join(' ');
|
|
656
|
+
}
|
|
657
|
+
/** The top-level verb of a usage string. */
|
|
658
|
+
export function commandVerb(usage) {
|
|
659
|
+
return commandPath(usage).split(' ')[0] ?? '';
|
|
660
|
+
}
|
|
661
|
+
/** Every top-level verb the registry documents, in registry order. */
|
|
662
|
+
export function registeredVerbs() {
|
|
663
|
+
const verbs = [];
|
|
664
|
+
for (const group of COMMAND_GROUPS) {
|
|
665
|
+
for (const entry of group.entries) {
|
|
666
|
+
const verb = commandVerb(entry.usage);
|
|
667
|
+
if (!verbs.includes(verb))
|
|
668
|
+
verbs.push(verb);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return verbs;
|
|
672
|
+
}
|
|
673
|
+
/** Every verb the router must accept: registry verbs plus their aliases. */
|
|
674
|
+
export function routedVerbs() {
|
|
675
|
+
const verbs = new Set(registeredVerbs());
|
|
676
|
+
for (const aliases of Object.values(COMMAND_ALIASES))
|
|
677
|
+
for (const alias of aliases)
|
|
678
|
+
verbs.add(alias);
|
|
679
|
+
return [...verbs];
|
|
680
|
+
}
|
|
681
|
+
//# sourceMappingURL=commands.js.map
|