@sanity/runtime-cli 13.4.1 → 14.0.1

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.
Files changed (40) hide show
  1. package/README.md +43 -35
  2. package/dist/actions/blueprints/config.d.ts +3 -7
  3. package/dist/actions/blueprints/config.js +1 -1
  4. package/dist/actions/blueprints/logs-streaming.d.ts +1 -0
  5. package/dist/actions/blueprints/logs-streaming.js +1 -0
  6. package/dist/actions/blueprints/stacks.d.ts +1 -0
  7. package/dist/actions/blueprints/stacks.js +11 -0
  8. package/dist/baseCommands.d.ts +2 -0
  9. package/dist/baseCommands.js +6 -1
  10. package/dist/commands/blueprints/config.d.ts +1 -1
  11. package/dist/commands/blueprints/config.js +5 -5
  12. package/dist/commands/blueprints/deploy.d.ts +1 -0
  13. package/dist/commands/blueprints/deploy.js +5 -2
  14. package/dist/commands/blueprints/destroy.d.ts +1 -1
  15. package/dist/commands/blueprints/destroy.js +6 -6
  16. package/dist/commands/blueprints/doctor.js +5 -1
  17. package/dist/commands/blueprints/info.d.ts +1 -1
  18. package/dist/commands/blueprints/info.js +4 -4
  19. package/dist/commands/blueprints/init.js +1 -1
  20. package/dist/commands/blueprints/logs.d.ts +1 -0
  21. package/dist/commands/blueprints/logs.js +2 -1
  22. package/dist/commands/blueprints/plan.d.ts +3 -0
  23. package/dist/commands/blueprints/plan.js +4 -1
  24. package/dist/commands/functions/logs.d.ts +1 -0
  25. package/dist/commands/functions/logs.js +2 -1
  26. package/dist/cores/blueprints/config.d.ts +1 -1
  27. package/dist/cores/blueprints/config.js +27 -6
  28. package/dist/cores/blueprints/deploy.js +36 -3
  29. package/dist/cores/blueprints/destroy.d.ts +1 -1
  30. package/dist/cores/blueprints/destroy.js +30 -15
  31. package/dist/cores/blueprints/doctor.js +184 -90
  32. package/dist/cores/blueprints/info.d.ts +1 -3
  33. package/dist/cores/blueprints/info.js +5 -20
  34. package/dist/cores/blueprints/init.js +1 -1
  35. package/dist/cores/blueprints/plan.d.ts +1 -0
  36. package/dist/cores/blueprints/plan.js +20 -15
  37. package/dist/cores/index.d.ts +1 -0
  38. package/dist/cores/index.js +12 -7
  39. package/oclif.manifest.json +81 -24
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g @sanity/runtime-cli
20
20
  $ sanity-run COMMAND
21
21
  running command...
22
22
  $ sanity-run (--version)
23
- @sanity/runtime-cli/13.4.1 linux-x64 node-v24.13.0
23
+ @sanity/runtime-cli/14.0.1 linux-x64 node-v24.13.0
24
24
  $ sanity-run --help [COMMAND]
25
25
  USAGE
26
26
  $ sanity-run COMMAND
@@ -98,7 +98,7 @@ EXAMPLES
98
98
  $ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
99
99
  ```
100
100
 
101
- _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/add.ts)_
101
+ _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/add.ts)_
102
102
 
103
103
  ## `sanity-run blueprints config`
104
104
 
@@ -106,12 +106,12 @@ View or edit the local Blueprint configuration
106
106
 
107
107
  ```
108
108
  USAGE
109
- $ sanity-run blueprints config [--project-id <value> -e] [--stack-id <value> ]
109
+ $ sanity-run blueprints config [--project-id <value> -e] [--stack <value> ]
110
110
 
111
111
  FLAGS
112
112
  -e, --edit Modify the configuration interactively, or directly when combined with ID flags.
113
113
  --project-id=<value> Directly set the project ID in the configuration. Requires --edit flag
114
- --stack-id=<value> Directly set the Stack ID in the configuration. Requires --edit flag
114
+ --stack=<value> Stack name or ID to set in the configuration. Requires --edit flag
115
115
 
116
116
  DESCRIPTION
117
117
  View or edit the local Blueprint configuration
@@ -121,7 +121,7 @@ DESCRIPTION
121
121
  Without flags, displays the current configuration. Use --edit to interactively modify settings, or combine --edit with
122
122
  ID flags to update values directly (useful for scripting and automation).
123
123
 
124
- If you need to switch your Blueprint to a different Stack, use --edit --stack-id.
124
+ If you need to switch your Blueprint to a different Stack, use --edit --stack.
125
125
 
126
126
  EXAMPLES
127
127
  $ sanity-run blueprints config
@@ -130,10 +130,10 @@ EXAMPLES
130
130
 
131
131
  $ sanity-run blueprints config --edit --project-id <projectId>
132
132
 
133
- $ sanity-run blueprints config --edit --project-id <projectId> --stack-id <stackId>
133
+ $ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
134
134
  ```
135
135
 
136
- _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/config.ts)_
136
+ _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/config.ts)_
137
137
 
138
138
  ## `sanity-run blueprints deploy`
139
139
 
@@ -141,10 +141,11 @@ Deploy the local Blueprint to the remote Stack
141
141
 
142
142
  ```
143
143
  USAGE
144
- $ sanity-run blueprints deploy [--no-wait]
144
+ $ sanity-run blueprints deploy [--stack <value>] [--no-wait]
145
145
 
146
146
  FLAGS
147
- --no-wait Do not wait for Stack deployment to complete
147
+ --no-wait Do not wait for Stack deployment to complete
148
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
148
149
 
149
150
  DESCRIPTION
150
151
  Deploy the local Blueprint to the remote Stack
@@ -157,13 +158,15 @@ DESCRIPTION
157
158
 
158
159
  Use --no-wait to queue the deployment and return immediately without waiting for completion.
159
160
 
161
+ Set SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.
162
+
160
163
  EXAMPLES
161
164
  $ sanity-run blueprints deploy
162
165
 
163
166
  $ sanity-run blueprints deploy --no-wait
164
167
  ```
165
168
 
166
- _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/deploy.ts)_
169
+ _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/deploy.ts)_
167
170
 
168
171
  ## `sanity-run blueprints destroy`
169
172
 
@@ -171,13 +174,13 @@ Destroy the remote Stack deployment and its resources (will not delete local fil
171
174
 
172
175
  ```
173
176
  USAGE
174
- $ sanity-run blueprints destroy [--project-id <value> --stack-id <value> --force] [--no-wait]
177
+ $ sanity-run blueprints destroy [--project-id <value> --stack <value> --force] [--no-wait]
175
178
 
176
179
  FLAGS
177
180
  --force Force Stack destruction (skip confirmation)
178
181
  --no-wait Do not wait for Stack destruction to complete
179
182
  --project-id=<value> Project associated with the Stack
180
- --stack-id=<value> Stack ID to destroy (defaults to current Stack)
183
+ --stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
181
184
 
182
185
  DESCRIPTION
183
186
  Destroy the remote Stack deployment and its resources (will not delete local files)
@@ -192,10 +195,10 @@ DESCRIPTION
192
195
  EXAMPLES
193
196
  $ sanity-run blueprints destroy
194
197
 
195
- $ sanity-run blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
198
+ $ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
196
199
  ```
197
200
 
198
- _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/destroy.ts)_
201
+ _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/destroy.ts)_
199
202
 
200
203
  ## `sanity-run blueprints doctor`
201
204
 
@@ -209,7 +212,7 @@ FLAGS
209
212
  -p, --path=<value> [env: SANITY_BLUEPRINT_PATH] Path to a Blueprint file or directory containing one
210
213
  --fix Interactively fix configuration issues
211
214
  --json Format output as json.
212
- --verbose Verbose output
215
+ --[no-]verbose Verbose output; defaults to true
213
216
 
214
217
  DESCRIPTION
215
218
  Diagnose potential issues with local Blueprint and remote Stack configuration
@@ -221,7 +224,7 @@ DESCRIPTION
221
224
  issues.
222
225
  ```
223
226
 
224
- _See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/doctor.ts)_
227
+ _See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/doctor.ts)_
225
228
 
226
229
  ## `sanity-run blueprints info`
227
230
 
@@ -229,10 +232,10 @@ Show information about the local Blueprint's remote Stack deployment
229
232
 
230
233
  ```
231
234
  USAGE
232
- $ sanity-run blueprints info [--id <value>]
235
+ $ sanity-run blueprints info [--stack <value>]
233
236
 
234
237
  FLAGS
235
- --id=<value> Stack ID to show info for (defaults to the current Stack)
238
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
236
239
 
237
240
  DESCRIPTION
238
241
  Show information about the local Blueprint's remote Stack deployment
@@ -248,10 +251,10 @@ DESCRIPTION
248
251
  EXAMPLES
249
252
  $ sanity-run blueprints info
250
253
 
251
- $ sanity-run blueprints info --id <stackId>
254
+ $ sanity-run blueprints info --stack <name-or-id>
252
255
  ```
253
256
 
254
- _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/info.ts)_
257
+ _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/info.ts)_
255
258
 
256
259
  ## `sanity-run blueprints init [DIR]`
257
260
 
@@ -301,7 +304,7 @@ EXAMPLES
301
304
  $ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
302
305
  ```
303
306
 
304
- _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/init.ts)_
307
+ _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/init.ts)_
305
308
 
306
309
  ## `sanity-run blueprints logs`
307
310
 
@@ -309,10 +312,11 @@ Display logs for the current Blueprint's Stack deployment
309
312
 
310
313
  ```
311
314
  USAGE
312
- $ sanity-run blueprints logs [-w]
315
+ $ sanity-run blueprints logs [--stack <value>] [-w]
313
316
 
314
317
  FLAGS
315
- -w, --watch Watch for new Stack logs (streaming mode)
318
+ -w, --watch Watch for new Stack logs (streaming mode)
319
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
316
320
 
317
321
  DESCRIPTION
318
322
  Display logs for the current Blueprint's Stack deployment
@@ -329,7 +333,7 @@ EXAMPLES
329
333
  $ sanity-run blueprints logs --watch
330
334
  ```
331
335
 
332
- _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/logs.ts)_
336
+ _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/logs.ts)_
333
337
 
334
338
  ## `sanity-run blueprints plan`
335
339
 
@@ -337,7 +341,10 @@ Enumerate resources to be deployed to the remote Stack - will not modify any res
337
341
 
338
342
  ```
339
343
  USAGE
340
- $ sanity-run blueprints plan
344
+ $ sanity-run blueprints plan [--stack <value>]
345
+
346
+ FLAGS
347
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
341
348
 
342
349
  DESCRIPTION
343
350
  Enumerate resources to be deployed to the remote Stack - will not modify any resources
@@ -352,7 +359,7 @@ EXAMPLES
352
359
  $ sanity-run blueprints plan
353
360
  ```
354
361
 
355
- _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/plan.ts)_
362
+ _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/plan.ts)_
356
363
 
357
364
  ## `sanity-run blueprints stacks`
358
365
 
@@ -381,7 +388,7 @@ EXAMPLES
381
388
  $ sanity-run blueprints stacks --organization-id <organizationId>
382
389
  ```
383
390
 
384
- _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/blueprints/stacks.ts)_
391
+ _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/blueprints/stacks.ts)_
385
392
 
386
393
  ## `sanity-run functions add`
387
394
 
@@ -430,7 +437,7 @@ EXAMPLES
430
437
  $ sanity-run functions add --name my-function --type document-create --type document-update --lang js
431
438
  ```
432
439
 
433
- _See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/add.ts)_
440
+ _See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/add.ts)_
434
441
 
435
442
  ## `sanity-run functions dev`
436
443
 
@@ -464,7 +471,7 @@ EXAMPLES
464
471
  $ sanity-run functions dev --timeout 60
465
472
  ```
466
473
 
467
- _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/dev.ts)_
474
+ _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/dev.ts)_
468
475
 
469
476
  ## `sanity-run functions env add NAME KEY VALUE`
470
477
 
@@ -491,7 +498,7 @@ EXAMPLES
491
498
  $ sanity-run functions env add MyFunction API_URL https://api.example.com/
492
499
  ```
493
500
 
494
- _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/env/add.ts)_
501
+ _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/env/add.ts)_
495
502
 
496
503
  ## `sanity-run functions env list NAME`
497
504
 
@@ -515,7 +522,7 @@ EXAMPLES
515
522
  $ sanity-run functions env list MyFunction
516
523
  ```
517
524
 
518
- _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/env/list.ts)_
525
+ _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/env/list.ts)_
519
526
 
520
527
  ## `sanity-run functions env remove NAME KEY`
521
528
 
@@ -541,7 +548,7 @@ EXAMPLES
541
548
  $ sanity-run functions env remove MyFunction API_URL
542
549
  ```
543
550
 
544
- _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/env/remove.ts)_
551
+ _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/env/remove.ts)_
545
552
 
546
553
  ## `sanity-run functions logs [NAME]`
547
554
 
@@ -549,7 +556,7 @@ Retrieve or delete logs for a Sanity Function
549
556
 
550
557
  ```
551
558
  USAGE
552
- $ sanity-run functions logs [NAME] [-u] [-f [-d | -l <value> | -j]] [-w]
559
+ $ sanity-run functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | -j]] [-w]
553
560
 
554
561
  ARGUMENTS
555
562
  [NAME] The name of the Sanity Function
@@ -561,6 +568,7 @@ FLAGS
561
568
  -l, --limit=<value> [default: 50] Total number of log entries to retrieve
562
569
  -u, --utc Show dates in UTC time zone
563
570
  -w, --watch Watch for new logs (streaming mode)
571
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
564
572
 
565
573
  DESCRIPTION
566
574
  Retrieve or delete logs for a Sanity Function
@@ -580,7 +588,7 @@ EXAMPLES
580
588
  $ sanity-run functions logs <name> --delete
581
589
  ```
582
590
 
583
- _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/logs.ts)_
591
+ _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/logs.ts)_
584
592
 
585
593
  ## `sanity-run functions test [NAME]`
586
594
 
@@ -634,7 +642,7 @@ EXAMPLES
634
642
  $ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
635
643
  ```
636
644
 
637
- _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v13.4.1/src/commands/functions/test.ts)_
645
+ _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.0.1/src/commands/functions/test.ts)_
638
646
 
639
647
  ## `sanity-run help [COMMAND]`
640
648
 
@@ -16,7 +16,7 @@ export interface LocatedBlueprintsConfig extends BlueprintsConfig {
16
16
  export declare function readConfigFile(blueprintFilePath?: string): LocatedBlueprintsConfig | null;
17
17
  /**
18
18
  * Create or update the config file to disk.
19
- * One of organizationId or projectId must be provided. Not both.
19
+ * One of organizationId or projectId must be provided.
20
20
  * Blueprint config version and updatedAt timestamp are set automatically.
21
21
  * @param options - the options to write the config file
22
22
  * @param options.blueprintFilePath - the path to the blueprint file
@@ -26,13 +26,9 @@ export declare function readConfigFile(blueprintFilePath?: string): LocatedBluep
26
26
  */
27
27
  export declare function writeConfigFile(blueprintFilePath: string, options: {
28
28
  stackId?: string;
29
- } & ({
30
- organizationId: string;
31
- projectId?: string;
32
- } | {
33
- projectId: string;
34
29
  organizationId?: string;
35
- })): BlueprintsConfig;
30
+ projectId?: string;
31
+ }): BlueprintsConfig;
36
32
  /**
37
33
  * Update the config file with the given properties.
38
34
  * Config file must already exist.
@@ -20,7 +20,7 @@ export function readConfigFile(blueprintFilePath) {
20
20
  }
21
21
  /**
22
22
  * Create or update the config file to disk.
23
- * One of organizationId or projectId must be provided. Not both.
23
+ * One of organizationId or projectId must be provided.
24
24
  * Blueprint config version and updatedAt timestamp are set automatically.
25
25
  * @param options - the options to write the config file
26
26
  * @param options.blueprintFilePath - the path to the blueprint file
@@ -7,6 +7,7 @@ export interface LogStreamingConfig {
7
7
  showBanner?: boolean;
8
8
  verbose?: boolean;
9
9
  log: ReturnType<typeof Logger>;
10
+ onActivity?: () => void;
10
11
  }
11
12
  export interface StreamLogsOptions {
12
13
  stackId: string;
@@ -79,6 +79,7 @@ export async function setupLogStreaming(config) {
79
79
  if (!isNewerLog(logEntry, newestTimestamp))
80
80
  return;
81
81
  newestTimestamp = new Date(logEntry.timestamp).getTime();
82
+ config.onActivity?.();
82
83
  log(formatLogEntry(logEntry, verbose, previousLog));
83
84
  previousLog = logEntry;
84
85
  };
@@ -55,6 +55,7 @@ interface DestroyStackResponse {
55
55
  error: string | null;
56
56
  stack: Stack;
57
57
  }
58
+ export declare function resolveStackIdByNameOrId(value: string, auth: AuthParams, logger: ReturnType<typeof Logger>): Promise<string>;
58
59
  export declare function destroyStack({ stackId, auth, logger, }: {
59
60
  stackId: string;
60
61
  auth: AuthParams;
@@ -75,6 +75,17 @@ export async function updateStack({ stackId, stackMutation, auth, logger, }) {
75
75
  stack: data,
76
76
  };
77
77
  }
78
+ export async function resolveStackIdByNameOrId(value, auth, logger) {
79
+ if (value.startsWith('ST-') && value.length === 13)
80
+ return value;
81
+ const result = await listStacks(auth, logger);
82
+ if (!result.ok)
83
+ throw new Error(result.error || 'Failed to list stacks');
84
+ const match = result.stacks.find((s) => s.name === value);
85
+ if (!match)
86
+ throw new Error(`No stack found with name "${value}"`);
87
+ return match.id;
88
+ }
78
89
  export async function destroyStack({ stackId, auth, logger, }) {
79
90
  const fetchFn = createTracedFetch(logger);
80
91
  const response = await fetchFn(`${stacksUrl}/${stackId}`, {
@@ -11,6 +11,7 @@ export declare const baseFlags: {
11
11
  'validate-resources': Interfaces.BooleanFlag<boolean>;
12
12
  verbose: Interfaces.BooleanFlag<boolean>;
13
13
  };
14
+ export declare const stackFlag: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
14
15
  /**
15
16
  * @description Unhides a flag by setting its hidden property to false
16
17
  * Also makes oclif's types happy when destructuring the flag
@@ -75,6 +76,7 @@ export declare abstract class DeployedStackCommand<T extends typeof Command> ext
75
76
  protected scopeId: string;
76
77
  protected stackId: string;
77
78
  static baseFlags: {
79
+ stack: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
78
80
  json: Interfaces.BooleanFlag<boolean>;
79
81
  path: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
80
82
  trace: Interfaces.BooleanFlag<boolean>;
@@ -33,6 +33,10 @@ export const baseFlags = {
33
33
  hidden,
34
34
  }),
35
35
  };
36
+ export const stackFlag = OclifFlags.string({
37
+ description: 'Stack name or ID to use instead of the locally configured Stack',
38
+ hidden: true,
39
+ });
36
40
  /**
37
41
  * @description Unhides a flag by setting its hidden property to false
38
42
  * Also makes oclif's types happy when destructuring the flag
@@ -150,7 +154,7 @@ export class DeployedStackCommand extends LocalBlueprintCommand {
150
154
  scopeType;
151
155
  scopeId;
152
156
  stackId;
153
- static baseFlags = baseFlags;
157
+ static baseFlags = { ...baseFlags, stack: stackFlag };
154
158
  async init() {
155
159
  await super.init();
156
160
  const result = await initDeployedBlueprintConfig({
@@ -160,6 +164,7 @@ export class DeployedStackCommand extends LocalBlueprintCommand {
160
164
  token: this.sanityToken,
161
165
  validateToken: false,
162
166
  validateResources: this.flags['validate-resources'],
167
+ stackOverride: this.flags.stack,
163
168
  });
164
169
  if (!result.ok) {
165
170
  this.error(result.error);
@@ -7,7 +7,7 @@ export default class ConfigCommand extends LocalBlueprintCommand<typeof ConfigCo
7
7
  edit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
8
  'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  'organization-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- 'stack-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  };
12
12
  run(): Promise<void>;
13
13
  }
@@ -8,12 +8,12 @@ export default class ConfigCommand extends LocalBlueprintCommand {
8
8
 
9
9
  Without flags, displays the current configuration. Use --edit to interactively modify settings, or combine --edit with ID flags to update values directly (useful for scripting and automation).
10
10
 
11
- If you need to switch your Blueprint to a different Stack, use --edit --stack-id.`;
11
+ If you need to switch your Blueprint to a different Stack, use --edit --stack.`;
12
12
  static examples = [
13
13
  '<%= config.bin %> <%= command.id %>',
14
14
  '<%= config.bin %> <%= command.id %> --edit',
15
15
  '<%= config.bin %> <%= command.id %> --edit --project-id <projectId>',
16
- '<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack-id <stackId>',
16
+ '<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>',
17
17
  ];
18
18
  static flags = {
19
19
  edit: Flags.boolean({
@@ -32,9 +32,9 @@ If you need to switch your Blueprint to a different Stack, use --edit --stack-id
32
32
  dependsOn: ['edit'],
33
33
  hidden: true,
34
34
  }),
35
- 'stack-id': Flags.string({
36
- description: 'Directly set the Stack ID in the configuration. Requires --edit flag',
37
- aliases: ['stack', 'stackId'],
35
+ stack: Flags.string({
36
+ description: 'Stack name or ID to set in the configuration. Requires --edit flag',
37
+ aliases: ['stack-id', 'stackId'],
38
38
  dependsOn: ['edit'],
39
39
  }),
40
40
  };
@@ -4,6 +4,7 @@ export default class DeployCommand extends DeployedStackCommand<typeof DeployCom
4
4
  static description: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
9
  'new-stack-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  };
@@ -1,5 +1,5 @@
1
1
  import { Flags } from '@oclif/core';
2
- import { DeployedStackCommand } from '../../baseCommands.js';
2
+ import { DeployedStackCommand, stackFlag, unhide } from '../../baseCommands.js';
3
3
  import { blueprintDeployCore } from '../../cores/blueprints/deploy.js';
4
4
  import { Logger } from '../../utils/logger.js';
5
5
  export default class DeployCommand extends DeployedStackCommand {
@@ -8,12 +8,15 @@ export default class DeployCommand extends DeployedStackCommand {
8
8
 
9
9
  Before deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.
10
10
 
11
- Use --no-wait to queue the deployment and return immediately without waiting for completion.`;
11
+ Use --no-wait to queue the deployment and return immediately without waiting for completion.
12
+
13
+ Set SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.`;
12
14
  static examples = [
13
15
  '<%= config.bin %> <%= command.id %>',
14
16
  '<%= config.bin %> <%= command.id %> --no-wait',
15
17
  ];
16
18
  static flags = {
19
+ stack: unhide(stackFlag),
17
20
  'no-wait': Flags.boolean({
18
21
  description: 'Do not wait for Stack deployment to complete',
19
22
  default: false,
@@ -7,7 +7,7 @@ export default class DestroyCommand extends LocalBlueprintCommand<typeof Destroy
7
7
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
8
  'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  'organization-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- 'stack-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
12
  };
13
13
  run(): Promise<void>;
@@ -11,7 +11,7 @@ This is a destructive operation. You will be prompted to confirm unless --force
11
11
  Use this to clean up test environments or decommission a Stack you no longer need.`;
12
12
  static examples = [
13
13
  '<%= config.bin %> <%= command.id %>',
14
- '<%= config.bin %> <%= command.id %> --stack-id <stackId> --project-id <projectId> --force --no-wait',
14
+ '<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait',
15
15
  ];
16
16
  static flags = {
17
17
  force: Flags.boolean({
@@ -22,19 +22,19 @@ Use this to clean up test environments or decommission a Stack you no longer nee
22
22
  'project-id': Flags.string({
23
23
  description: 'Project associated with the Stack',
24
24
  aliases: ['projectId', 'project'],
25
- dependsOn: ['stack-id', 'force'],
25
+ dependsOn: ['stack', 'force'],
26
26
  exclusive: ['organization-id'],
27
27
  }),
28
28
  'organization-id': Flags.string({
29
29
  description: 'Organization associated with the Stack',
30
30
  aliases: ['organizationId', 'organization', 'org'],
31
- dependsOn: ['stack-id', 'force'],
31
+ dependsOn: ['stack', 'force'],
32
32
  exclusive: ['project-id'],
33
33
  hidden: true,
34
34
  }),
35
- 'stack-id': Flags.string({
36
- description: 'Stack ID to destroy (defaults to current Stack)',
37
- aliases: ['stackId', 'stack'],
35
+ stack: Flags.string({
36
+ description: 'Stack name or ID to destroy (defaults to the locally configured Stack)',
37
+ aliases: ['stack-id', 'stackId'],
38
38
  }),
39
39
  'no-wait': Flags.boolean({
40
40
  description: 'Do not wait for Stack destruction to complete',
@@ -17,7 +17,11 @@ Run this command when encountering errors with other Blueprint commands. Use --f
17
17
  default: false,
18
18
  }),
19
19
  json: unhide(baseFlags.json),
20
- verbose: unhide(baseFlags.verbose),
20
+ verbose: Flags.boolean({
21
+ description: 'Verbose output; defaults to true',
22
+ default: true,
23
+ allowNo: true,
24
+ }),
21
25
  };
22
26
  async run() {
23
27
  const { token } = config;
@@ -4,7 +4,7 @@ export default class InfoCommand extends DeployedStackCommand<typeof InfoCommand
4
4
  static description: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
- id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  };
9
9
  run(): Promise<void>;
10
10
  }
@@ -11,18 +11,18 @@ Use this command to verify a deployment succeeded, check what resources are live
11
11
  Run 'blueprints stacks' to see all available Stacks in your project or organization.`;
12
12
  static examples = [
13
13
  '<%= config.bin %> <%= command.id %>',
14
- '<%= config.bin %> <%= command.id %> --id <stackId>',
14
+ '<%= config.bin %> <%= command.id %> --stack <name-or-id>',
15
15
  ];
16
16
  static flags = {
17
- id: Flags.string({
18
- description: 'Stack ID to show info for (defaults to the current Stack)',
17
+ stack: Flags.string({
18
+ description: 'Stack name or ID to use instead of the locally configured Stack',
19
+ aliases: ['id'],
19
20
  }),
20
21
  };
21
22
  async run() {
22
23
  const { success, error } = await blueprintInfoCore({
23
24
  bin: this.config.bin,
24
25
  log: Logger(this.log.bind(this), this.flags),
25
- auth: this.auth,
26
26
  stackId: this.stackId,
27
27
  deployedStack: this.deployedStack,
28
28
  validateResources: this.flags['validate-resources'],
@@ -49,7 +49,7 @@ After initialization, use 'blueprints plan' to preview changes, then 'blueprints
49
49
  }),
50
50
  'stack-id': Flags.string({
51
51
  description: 'Existing Stack ID used to scope local Blueprint',
52
- aliases: ['stack', 'stackId'],
52
+ aliases: ['stackId'],
53
53
  dependsOn: ['project-id'],
54
54
  exclusive: ['stack-name'],
55
55
  }),
@@ -4,6 +4,7 @@ export default class LogsCommand extends DeployedStackCommand<typeof LogsCommand
4
4
  static description: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  watch: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
9
  };
9
10
  run(): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { Flags } from '@oclif/core';
2
- import { DeployedStackCommand } from '../../baseCommands.js';
2
+ import { DeployedStackCommand, stackFlag, unhide } from '../../baseCommands.js';
3
3
  import { blueprintLogsCore } from '../../cores/blueprints/logs.js';
4
4
  import { Logger } from '../../utils/logger.js';
5
5
  export default class LogsCommand extends DeployedStackCommand {
@@ -14,6 +14,7 @@ If you're not seeing expected logs, verify your Stack is deployed with 'blueprin
14
14
  '<%= config.bin %> <%= command.id %> --watch',
15
15
  ];
16
16
  static flags = {
17
+ stack: unhide(stackFlag),
17
18
  watch: Flags.boolean({
18
19
  char: 'w',
19
20
  description: 'Watch for new Stack logs (streaming mode)',
@@ -3,5 +3,8 @@ export default class PlanCommand extends LocalBlueprintCommand<typeof PlanComman
3
3
  static summary: string;
4
4
  static description: string;
5
5
  static examples: string[];
6
+ static flags: {
7
+ stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
6
9
  run(): Promise<void>;
7
10
  }