@sanity/runtime-cli 17.1.0-next.gcfbd613 → 17.2.0-blueprinit.g62f8017
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 +84 -54
- package/SKILL.md +21 -0
- package/dist/actions/blueprinit/manifest.d.ts +13 -0
- package/dist/actions/blueprinit/manifest.js +57 -0
- package/dist/actions/blueprinit/studio.d.ts +6 -0
- package/dist/actions/blueprinit/studio.js +43 -0
- package/dist/actions/blueprinit/templates.d.ts +34 -0
- package/dist/actions/blueprinit/templates.js +83 -0
- package/dist/actions/blueprinit/workspace.d.ts +15 -0
- package/dist/actions/blueprinit/workspace.js +142 -0
- package/dist/actions/blueprints/assets.js +15 -24
- package/dist/actions/blueprints/pre-deploy.d.ts +29 -0
- package/dist/actions/blueprints/pre-deploy.js +164 -0
- package/dist/actions/sanity/datasets.d.ts +15 -0
- package/dist/actions/sanity/datasets.js +26 -0
- package/dist/baseCommands.d.ts +3 -0
- package/dist/baseCommands.js +17 -0
- package/dist/commands/blueprinit.d.ts +13 -0
- package/dist/commands/blueprinit.js +44 -0
- package/dist/commands/functions/env/add.d.ts +3 -0
- package/dist/commands/functions/env/add.js +6 -2
- package/dist/commands/functions/env/list.d.ts +3 -0
- package/dist/commands/functions/env/list.js +9 -3
- package/dist/commands/functions/env/remove.d.ts +3 -0
- package/dist/commands/functions/env/remove.js +9 -3
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/cores/blueprinit/adopt.d.ts +6 -0
- package/dist/cores/blueprinit/adopt.js +90 -0
- package/dist/cores/blueprinit/finish.d.ts +14 -0
- package/dist/cores/blueprinit/finish.js +36 -0
- package/dist/cores/blueprinit/fresh.d.ts +3 -0
- package/dist/cores/blueprinit/fresh.js +88 -0
- package/dist/cores/blueprinit/prompts.d.ts +4 -0
- package/dist/cores/blueprinit/prompts.js +14 -0
- package/dist/cores/blueprinit/selection.d.ts +15 -0
- package/dist/cores/blueprinit/selection.js +63 -0
- package/dist/cores/blueprinit/types.d.ts +13 -0
- package/dist/cores/blueprinit/types.js +1 -0
- package/dist/cores/blueprinit.d.ts +7 -0
- package/dist/cores/blueprinit.js +39 -0
- package/dist/cores/blueprints/deploy.js +16 -64
- package/dist/utils/command-skills.d.ts +2 -0
- package/dist/utils/command-skills.js +17 -0
- package/dist/utils/functions/child-process-wrapper.js +13 -171
- package/dist/utils/functions/child-runtime/console.d.ts +1 -0
- package/dist/utils/functions/child-runtime/console.js +50 -0
- package/dist/utils/functions/child-runtime/invoke.d.ts +4 -0
- package/dist/utils/functions/child-runtime/invoke.js +47 -0
- package/dist/utils/functions/child-runtime/resources.d.ts +4 -0
- package/dist/utils/functions/child-runtime/resources.js +59 -0
- package/dist/utils/studios/prepare-asset.d.ts +6 -0
- package/dist/utils/studios/prepare-asset.js +139 -0
- package/dist/utils/types.d.ts +4 -7
- package/dist/utils/types.js +2 -3
- package/oclif.manifest.json +293 -7
- package/package.json +12 -4
- package/skills/blueprinit.md +40 -0
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/17.
|
|
23
|
+
@sanity/runtime-cli/17.2.0-blueprinit.g62f8017 linux-x64 node-v24.18.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -56,7 +56,7 @@ USAGE
|
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
USAGE
|
|
59
|
-
$ sanity-run blueprints add TYPE [--json] [--example <value> | -n <value> | --fn-type
|
|
59
|
+
$ sanity-run blueprints add TYPE [--json] [--llms] [--example <value> | -n <value> | --fn-type
|
|
60
60
|
document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
|
|
61
61
|
te|media-library-asset-update|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
|
|
62
62
|
--fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
|
|
@@ -81,6 +81,7 @@ FLAGS
|
|
|
81
81
|
--json Format output as json
|
|
82
82
|
--language=<option> [default: ts] Language of the new function
|
|
83
83
|
<options: ts|js>
|
|
84
|
+
--llms Show agent-oriented guidance for this command
|
|
84
85
|
|
|
85
86
|
DESCRIPTION
|
|
86
87
|
[deprecated] Use "functions add" instead
|
|
@@ -103,7 +104,7 @@ EXAMPLES
|
|
|
103
104
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
104
105
|
```
|
|
105
106
|
|
|
106
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
107
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/add.ts)_
|
|
107
108
|
|
|
108
109
|
## `sanity-run blueprints config`
|
|
109
110
|
|
|
@@ -111,11 +112,13 @@ View or edit the local Blueprint configuration
|
|
|
111
112
|
|
|
112
113
|
```
|
|
113
114
|
USAGE
|
|
114
|
-
$ sanity-run blueprints config [--json] [--stack <value> -e] [--project-id <value> ] [--organization-id
|
|
115
|
+
$ sanity-run blueprints config [--json] [--llms] [--stack <value> -e] [--project-id <value> ] [--organization-id
|
|
116
|
+
<value> ]
|
|
115
117
|
|
|
116
118
|
FLAGS
|
|
117
119
|
-e, --edit Modify the configuration interactively, or directly when combined with ID flags.
|
|
118
120
|
--json Format output as json
|
|
121
|
+
--llms Show agent-oriented guidance for this command
|
|
119
122
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
120
123
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
121
124
|
--stack=<value> Stack name or ID to set in the configuration. Requires --edit flag
|
|
@@ -140,7 +143,7 @@ EXAMPLES
|
|
|
140
143
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
141
144
|
```
|
|
142
145
|
|
|
143
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
146
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/config.ts)_
|
|
144
147
|
|
|
145
148
|
## `sanity-run blueprints deploy`
|
|
146
149
|
|
|
@@ -148,12 +151,13 @@ Deploy the local Blueprint to the remote Stack
|
|
|
148
151
|
|
|
149
152
|
```
|
|
150
153
|
USAGE
|
|
151
|
-
$ sanity-run blueprints deploy [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
152
|
-
<value>] [--no-wait] [--new-stack-name <value>]
|
|
154
|
+
$ sanity-run blueprints deploy [--json] [--llms] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
155
|
+
[-m <value>] [--no-wait] [--new-stack-name <value>]
|
|
153
156
|
|
|
154
157
|
FLAGS
|
|
155
158
|
-m, --message=<value> Message describing the deployment (e.g. reason for change)
|
|
156
159
|
--json Format output as json
|
|
160
|
+
--llms Show agent-oriented guidance for this command
|
|
157
161
|
--new-stack-name=<value> Set a new name for the Stack
|
|
158
162
|
--no-wait Do not wait for Stack deployment to complete
|
|
159
163
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
@@ -194,7 +198,7 @@ EXAMPLES
|
|
|
194
198
|
$ sanity-run blueprints deploy --new-stack-name <new-name>
|
|
195
199
|
```
|
|
196
200
|
|
|
197
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
201
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/deploy.ts)_
|
|
198
202
|
|
|
199
203
|
## `sanity-run blueprints destroy`
|
|
200
204
|
|
|
@@ -202,12 +206,13 @@ Destroy a remote Stack deployment and its resources
|
|
|
202
206
|
|
|
203
207
|
```
|
|
204
208
|
USAGE
|
|
205
|
-
$ sanity-run blueprints destroy [--json] [--project-id <value> --stack <value> --force] [--organization-id
|
|
206
|
-
[--no-wait]
|
|
209
|
+
$ sanity-run blueprints destroy [--json] [--llms] [--project-id <value> --stack <value> --force] [--organization-id
|
|
210
|
+
<value> ] [--no-wait]
|
|
207
211
|
|
|
208
212
|
FLAGS
|
|
209
213
|
--force Force Stack destruction (skip confirmation)
|
|
210
214
|
--json Format output as json
|
|
215
|
+
--llms Show agent-oriented guidance for this command
|
|
211
216
|
--no-wait Do not wait for Stack destruction to complete
|
|
212
217
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
213
218
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
@@ -232,7 +237,7 @@ EXAMPLES
|
|
|
232
237
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
233
238
|
```
|
|
234
239
|
|
|
235
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
240
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/destroy.ts)_
|
|
236
241
|
|
|
237
242
|
## `sanity-run blueprints doctor`
|
|
238
243
|
|
|
@@ -240,12 +245,13 @@ Diagnose potential issues with local Blueprint and remote Stack configuration
|
|
|
240
245
|
|
|
241
246
|
```
|
|
242
247
|
USAGE
|
|
243
|
-
$ sanity-run blueprints doctor [--json] [-p <value>] [--fix]
|
|
248
|
+
$ sanity-run blueprints doctor [--json] [--llms] [-p <value>] [--fix]
|
|
244
249
|
|
|
245
250
|
FLAGS
|
|
246
251
|
-p, --path=<value> [env: SANITY_BLUEPRINT_PATH] Path to a Blueprint file or directory containing one
|
|
247
252
|
--fix Interactively fix configuration issues
|
|
248
253
|
--json Format output as json
|
|
254
|
+
--llms Show agent-oriented guidance for this command
|
|
249
255
|
|
|
250
256
|
DESCRIPTION
|
|
251
257
|
Diagnose potential issues with local Blueprint and remote Stack configuration
|
|
@@ -264,7 +270,7 @@ EXAMPLES
|
|
|
264
270
|
$ sanity-run blueprints doctor --fix
|
|
265
271
|
```
|
|
266
272
|
|
|
267
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
273
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/doctor.ts)_
|
|
268
274
|
|
|
269
275
|
## `sanity-run blueprints info`
|
|
270
276
|
|
|
@@ -272,10 +278,11 @@ Display the status and resources of the remote Stack deployment
|
|
|
272
278
|
|
|
273
279
|
```
|
|
274
280
|
USAGE
|
|
275
|
-
$ sanity-run blueprints info [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
281
|
+
$ sanity-run blueprints info [--json] [--llms] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
276
282
|
|
|
277
283
|
FLAGS
|
|
278
284
|
--json Format output as json
|
|
285
|
+
--llms Show agent-oriented guidance for this command
|
|
279
286
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
280
287
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
281
288
|
--stack=<value> Stack name or ID
|
|
@@ -301,7 +308,7 @@ EXAMPLES
|
|
|
301
308
|
$ sanity-run blueprints info --organization-id <orgId> --stack <name-or-id>
|
|
302
309
|
```
|
|
303
310
|
|
|
304
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
311
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/info.ts)_
|
|
305
312
|
|
|
306
313
|
## `sanity-run blueprints init [DIR]`
|
|
307
314
|
|
|
@@ -309,8 +316,8 @@ Initialize a Blueprint and create a remote Stack
|
|
|
309
316
|
|
|
310
317
|
```
|
|
311
318
|
USAGE
|
|
312
|
-
$ sanity-run blueprints init [DIR] [--json] [--dir <value>] [--example <value> | --blueprint-type
|
|
313
|
-
--stack-id <value> | --stack-name <value>] [--project-id <value> | --organization-id <value>]
|
|
319
|
+
$ sanity-run blueprints init [DIR] [--json] [--llms] [--dir <value>] [--example <value> | --blueprint-type
|
|
320
|
+
json|js|ts | --stack-id <value> | --stack-name <value>] [--project-id <value> | --organization-id <value>]
|
|
314
321
|
|
|
315
322
|
ARGUMENTS
|
|
316
323
|
[DIR] Directory to create the local Blueprint in (defaults to the current directory)
|
|
@@ -321,6 +328,7 @@ FLAGS
|
|
|
321
328
|
--dir=<value> Directory to create the local Blueprint in
|
|
322
329
|
--example=<value> Example to use for the local Blueprint
|
|
323
330
|
--json Format output as json
|
|
331
|
+
--llms Show agent-oriented guidance for this command
|
|
324
332
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
325
333
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
326
334
|
--stack-id=<value> Existing Stack ID used to scope local Blueprint
|
|
@@ -365,7 +373,7 @@ EXAMPLES
|
|
|
365
373
|
$ sanity-run blueprints init old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>
|
|
366
374
|
```
|
|
367
375
|
|
|
368
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
376
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/init.ts)_
|
|
369
377
|
|
|
370
378
|
## `sanity-run blueprints logs`
|
|
371
379
|
|
|
@@ -373,14 +381,15 @@ Display logs for the current Blueprint's Stack deployment
|
|
|
373
381
|
|
|
374
382
|
```
|
|
375
383
|
USAGE
|
|
376
|
-
$ sanity-run blueprints logs [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
377
|
-
<value> | -w] [--since <value> | ] [--before <value> | ]
|
|
384
|
+
$ sanity-run blueprints logs [--json] [--llms] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
385
|
+
[-l <value> | -w] [--since <value> | ] [--before <value> | ]
|
|
378
386
|
|
|
379
387
|
FLAGS
|
|
380
388
|
-l, --limit=<value> Maximum number of log entries to retrieve (1-500)
|
|
381
389
|
-w, --watch Watch for new Stack logs
|
|
382
390
|
--before=<value> Only show logs before this ISO 8601 timestamp
|
|
383
391
|
--json Format output as json
|
|
392
|
+
--llms Show agent-oriented guidance for this command
|
|
384
393
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
385
394
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
386
395
|
--since=<value> Only show logs after this ISO 8601 timestamp
|
|
@@ -411,7 +420,7 @@ EXAMPLES
|
|
|
411
420
|
$ sanity-run blueprints logs --before 2026-05-01T00:00:00Z
|
|
412
421
|
```
|
|
413
422
|
|
|
414
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
423
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/logs.ts)_
|
|
415
424
|
|
|
416
425
|
## `sanity-run blueprints mint-deploy-token`
|
|
417
426
|
|
|
@@ -419,13 +428,14 @@ Create a robot API token for deploying Blueprints from CI/CD
|
|
|
419
428
|
|
|
420
429
|
```
|
|
421
430
|
USAGE
|
|
422
|
-
$ sanity-run blueprints mint-deploy-token [--project-id <value> | --organization-id <value>] [--label <value>] [-P |
|
|
423
|
-
|
|
431
|
+
$ sanity-run blueprints mint-deploy-token [--llms] [--project-id <value> | --organization-id <value>] [--label <value>] [-P |
|
|
432
|
+
--json]
|
|
424
433
|
|
|
425
434
|
FLAGS
|
|
426
435
|
-P, --print Print only the raw token to stdout (suitable for shell substitution)
|
|
427
436
|
--json Format output as json
|
|
428
437
|
--label=<value> Human-readable label for the robot. Defaults to a generated value.
|
|
438
|
+
--llms Show agent-oriented guidance for this command
|
|
429
439
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
430
440
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
431
441
|
|
|
@@ -456,7 +466,7 @@ EXAMPLES
|
|
|
456
466
|
$ sanity-run blueprints mint-deploy-token --organization-id <orgId>
|
|
457
467
|
```
|
|
458
468
|
|
|
459
|
-
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
469
|
+
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/mint-deploy-token.ts)_
|
|
460
470
|
|
|
461
471
|
## `sanity-run blueprints plan`
|
|
462
472
|
|
|
@@ -464,10 +474,11 @@ Preview changes that will be applied to the remote Stack
|
|
|
464
474
|
|
|
465
475
|
```
|
|
466
476
|
USAGE
|
|
467
|
-
$ sanity-run blueprints plan [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
477
|
+
$ sanity-run blueprints plan [--json] [--llms] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
468
478
|
|
|
469
479
|
FLAGS
|
|
470
480
|
--json Format output as json
|
|
481
|
+
--llms Show agent-oriented guidance for this command
|
|
471
482
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
472
483
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
473
484
|
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
@@ -489,7 +500,7 @@ EXAMPLES
|
|
|
489
500
|
$ sanity-run blueprints plan --organization-id <orgId> --stack <name-or-id>
|
|
490
501
|
```
|
|
491
502
|
|
|
492
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
503
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/plan.ts)_
|
|
493
504
|
|
|
494
505
|
## `sanity-run blueprints promote`
|
|
495
506
|
|
|
@@ -497,12 +508,13 @@ Promote a Stack from project scope to organization scope
|
|
|
497
508
|
|
|
498
509
|
```
|
|
499
510
|
USAGE
|
|
500
|
-
$ sanity-run blueprints promote [--json] [--stack <value>] [--project-id <value> | ] [--force]
|
|
501
|
-
<value>]
|
|
511
|
+
$ sanity-run blueprints promote [--json] [--llms] [--stack <value>] [--project-id <value> | ] [--force]
|
|
512
|
+
[--new-stack-name <value>]
|
|
502
513
|
|
|
503
514
|
FLAGS
|
|
504
515
|
--force Skip confirmation prompt
|
|
505
516
|
--json Format output as json
|
|
517
|
+
--llms Show agent-oriented guidance for this command
|
|
506
518
|
--new-stack-name=<value> Set a new name for the Stack while promoting
|
|
507
519
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
508
520
|
--stack=<value> Stack name or ID to promote
|
|
@@ -525,7 +537,7 @@ EXAMPLES
|
|
|
525
537
|
$ sanity-run blueprints promote --new-stack-name <new-name>
|
|
526
538
|
```
|
|
527
539
|
|
|
528
|
-
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
540
|
+
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/promote.ts)_
|
|
529
541
|
|
|
530
542
|
## `sanity-run blueprints stacks`
|
|
531
543
|
|
|
@@ -533,11 +545,13 @@ List remote Stack deployments for your project or organization
|
|
|
533
545
|
|
|
534
546
|
```
|
|
535
547
|
USAGE
|
|
536
|
-
$ sanity-run blueprints stacks [--json] [--project-id <value> | --organization-id <value> |
|
|
548
|
+
$ sanity-run blueprints stacks [--json] [--llms] [--project-id <value> | --organization-id <value> |
|
|
549
|
+
--include-projects]
|
|
537
550
|
|
|
538
551
|
FLAGS
|
|
539
552
|
--include-projects Include Stacks from all projects within the organization. Requires --organization-id.
|
|
540
553
|
--json Format output as json
|
|
554
|
+
--llms Show agent-oriented guidance for this command
|
|
541
555
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
542
556
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
543
557
|
|
|
@@ -561,7 +575,7 @@ EXAMPLES
|
|
|
561
575
|
$ sanity-run blueprints stacks --organization-id <organizationId> --include-projects
|
|
562
576
|
```
|
|
563
577
|
|
|
564
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
578
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/blueprints/stacks.ts)_
|
|
565
579
|
|
|
566
580
|
## `sanity-run functions add`
|
|
567
581
|
|
|
@@ -569,9 +583,9 @@ Add a Function to your Blueprint
|
|
|
569
583
|
|
|
570
584
|
```
|
|
571
585
|
USAGE
|
|
572
|
-
$ sanity-run functions add [--json] [--example <value> | -n <value> | | --language ts|js | --javascript
|
|
573
|
-
[--type document-publish|document-create|document-delete|document-update|media-library-asset-create|media-
|
|
574
|
-
|
|
586
|
+
$ sanity-run functions add [--json] [--llms] [--example <value> | -n <value> | | --language ts|js | --javascript
|
|
587
|
+
| | ] [--type document-publish|document-create|document-delete|document-update|media-library-asset-create|media-lib
|
|
588
|
+
rary-asset-delete|media-library-asset-update|scheduled-function|sync-tag-invalidate... ] [--helpers] [--installer
|
|
575
589
|
skip|npm|pnpm|yarn] [-i | ]
|
|
576
590
|
|
|
577
591
|
FLAGS
|
|
@@ -585,6 +599,7 @@ FLAGS
|
|
|
585
599
|
--json Format output as json
|
|
586
600
|
--language=<option> [default: ts] Language of the new Function
|
|
587
601
|
<options: ts|js>
|
|
602
|
+
--llms Show agent-oriented guidance for this command
|
|
588
603
|
--type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
|
|
589
604
|
by specifying this flag multiple times
|
|
590
605
|
<options: document-publish|document-create|document-delete|document-update|media-library-ass
|
|
@@ -613,7 +628,7 @@ EXAMPLES
|
|
|
613
628
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
614
629
|
```
|
|
615
630
|
|
|
616
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
631
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/add.ts)_
|
|
617
632
|
|
|
618
633
|
## `sanity-run functions dev`
|
|
619
634
|
|
|
@@ -621,7 +636,7 @@ Start the Sanity Function emulator
|
|
|
621
636
|
|
|
622
637
|
```
|
|
623
638
|
USAGE
|
|
624
|
-
$ sanity-run functions dev [--json] [-h <value>] [-p <value>] [-t <value>]
|
|
639
|
+
$ sanity-run functions dev [--json] [--llms] [-h <value>] [-p <value>] [-t <value>]
|
|
625
640
|
|
|
626
641
|
FLAGS
|
|
627
642
|
-h, --host=<value> The local network interface at which to listen. [default: "localhost"]
|
|
@@ -629,6 +644,7 @@ FLAGS
|
|
|
629
644
|
-t, --timeout=<value> Maximum execution time for all functions, in seconds. Takes precedence over function-specific
|
|
630
645
|
`timeout`
|
|
631
646
|
--json Format output as json
|
|
647
|
+
--llms Show agent-oriented guidance for this command
|
|
632
648
|
|
|
633
649
|
DESCRIPTION
|
|
634
650
|
Start the Sanity Function emulator
|
|
@@ -648,7 +664,7 @@ EXAMPLES
|
|
|
648
664
|
$ sanity-run functions dev --timeout 60
|
|
649
665
|
```
|
|
650
666
|
|
|
651
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
667
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/dev.ts)_
|
|
652
668
|
|
|
653
669
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
654
670
|
|
|
@@ -656,7 +672,7 @@ Add or set an environment variable for a deployed function
|
|
|
656
672
|
|
|
657
673
|
```
|
|
658
674
|
USAGE
|
|
659
|
-
$ sanity-run functions env add NAME KEY VALUE [--json]
|
|
675
|
+
$ sanity-run functions env add NAME KEY VALUE [--json] [--llms] [--stack <value>]
|
|
660
676
|
|
|
661
677
|
ARGUMENTS
|
|
662
678
|
NAME The name of the Sanity Function
|
|
@@ -664,7 +680,9 @@ ARGUMENTS
|
|
|
664
680
|
VALUE The value of the environment variable
|
|
665
681
|
|
|
666
682
|
FLAGS
|
|
667
|
-
--json
|
|
683
|
+
--json Format output as json
|
|
684
|
+
--llms Show agent-oriented guidance for this command
|
|
685
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
668
686
|
|
|
669
687
|
DESCRIPTION
|
|
670
688
|
Add or set an environment variable for a deployed function
|
|
@@ -676,9 +694,11 @@ DESCRIPTION
|
|
|
676
694
|
|
|
677
695
|
EXAMPLES
|
|
678
696
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
697
|
+
|
|
698
|
+
$ sanity-run functions env add --stack <name-or-id> MyFunction API_URL https://api.example.com/
|
|
679
699
|
```
|
|
680
700
|
|
|
681
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
701
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/env/add.ts)_
|
|
682
702
|
|
|
683
703
|
## `sanity-run functions env list NAME`
|
|
684
704
|
|
|
@@ -686,13 +706,15 @@ List environment variables for a deployed function
|
|
|
686
706
|
|
|
687
707
|
```
|
|
688
708
|
USAGE
|
|
689
|
-
$ sanity-run functions env list NAME [--json]
|
|
709
|
+
$ sanity-run functions env list NAME [--json] [--llms] [--stack <value>]
|
|
690
710
|
|
|
691
711
|
ARGUMENTS
|
|
692
712
|
NAME The name of the Sanity Function
|
|
693
713
|
|
|
694
714
|
FLAGS
|
|
695
|
-
--json
|
|
715
|
+
--json Format output as json
|
|
716
|
+
--llms Show agent-oriented guidance for this command
|
|
717
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
696
718
|
|
|
697
719
|
DESCRIPTION
|
|
698
720
|
List environment variables for a deployed function
|
|
@@ -703,9 +725,11 @@ DESCRIPTION
|
|
|
703
725
|
|
|
704
726
|
EXAMPLES
|
|
705
727
|
$ sanity-run functions env list MyFunction
|
|
728
|
+
|
|
729
|
+
$ sanity-run functions env list --stack <name-or-id> MyFunction
|
|
706
730
|
```
|
|
707
731
|
|
|
708
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
732
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/env/list.ts)_
|
|
709
733
|
|
|
710
734
|
## `sanity-run functions env remove NAME KEY`
|
|
711
735
|
|
|
@@ -713,14 +737,16 @@ Remove an environment variable from a deployed function
|
|
|
713
737
|
|
|
714
738
|
```
|
|
715
739
|
USAGE
|
|
716
|
-
$ sanity-run functions env remove NAME KEY [--json]
|
|
740
|
+
$ sanity-run functions env remove NAME KEY [--json] [--llms] [--stack <value>]
|
|
717
741
|
|
|
718
742
|
ARGUMENTS
|
|
719
743
|
NAME The name of the Sanity Function
|
|
720
744
|
KEY The name of the environment variable
|
|
721
745
|
|
|
722
746
|
FLAGS
|
|
723
|
-
--json
|
|
747
|
+
--json Format output as json
|
|
748
|
+
--llms Show agent-oriented guidance for this command
|
|
749
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
724
750
|
|
|
725
751
|
DESCRIPTION
|
|
726
752
|
Remove an environment variable from a deployed function
|
|
@@ -732,9 +758,11 @@ DESCRIPTION
|
|
|
732
758
|
|
|
733
759
|
EXAMPLES
|
|
734
760
|
$ sanity-run functions env remove MyFunction API_URL
|
|
761
|
+
|
|
762
|
+
$ sanity-run functions env remove --stack <name-or-id> MyFunction API_URL
|
|
735
763
|
```
|
|
736
764
|
|
|
737
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
765
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/env/remove.ts)_
|
|
738
766
|
|
|
739
767
|
## `sanity-run functions logs [NAME]`
|
|
740
768
|
|
|
@@ -742,7 +770,7 @@ Retrieve or delete logs for a Sanity Function
|
|
|
742
770
|
|
|
743
771
|
```
|
|
744
772
|
USAGE
|
|
745
|
-
$ sanity-run functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
|
|
773
|
+
$ sanity-run functions logs [NAME] [--llms] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
|
|
746
774
|
|
|
747
775
|
ARGUMENTS
|
|
748
776
|
[NAME] The name of the Sanity Function
|
|
@@ -754,6 +782,7 @@ FLAGS
|
|
|
754
782
|
-u, --utc Show dates in UTC time zone
|
|
755
783
|
-w, --watch Watch for new logs (streaming mode)
|
|
756
784
|
--json Format output as json
|
|
785
|
+
--llms Show agent-oriented guidance for this command
|
|
757
786
|
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
758
787
|
|
|
759
788
|
DESCRIPTION
|
|
@@ -774,7 +803,7 @@ EXAMPLES
|
|
|
774
803
|
$ sanity-run functions logs <name> --delete
|
|
775
804
|
```
|
|
776
805
|
|
|
777
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
806
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/logs.ts)_
|
|
778
807
|
|
|
779
808
|
## `sanity-run functions test [NAME]`
|
|
780
809
|
|
|
@@ -782,11 +811,11 @@ Invoke a local Sanity Function
|
|
|
782
811
|
|
|
783
812
|
```
|
|
784
813
|
USAGE
|
|
785
|
-
$ sanity-run functions test [NAME] [--json] [--data-before <value> | [-d <value> | -f <value> |
|
|
786
|
-
<value>] | | | --file-before <value> | --file-after <value> | --document-id-before <value> |
|
|
787
|
-
<value>] [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a
|
|
788
|
-
[--with-user-token] [--media-library-id <value> | [--project-id <value> | --organization-id <value>] |
|
|
789
|
-
<value>]
|
|
814
|
+
$ sanity-run functions test [NAME] [--json] [--llms] [--data-before <value> | [-d <value> | -f <value> |
|
|
815
|
+
--document-id <value>] | | | --file-before <value> | --file-after <value> | --document-id-before <value> |
|
|
816
|
+
--document-id-after <value>] [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a
|
|
817
|
+
<value>] [--with-user-token] [--media-library-id <value> | [--project-id <value> | --organization-id <value>] |
|
|
818
|
+
--dataset <value>]
|
|
790
819
|
|
|
791
820
|
ARGUMENTS
|
|
792
821
|
[NAME] The name of the Sanity Function
|
|
@@ -807,6 +836,7 @@ FLAGS
|
|
|
807
836
|
--file-after=<value> Current document
|
|
808
837
|
--file-before=<value> Original document
|
|
809
838
|
--json Format output as json
|
|
839
|
+
--llms Show agent-oriented guidance for this command
|
|
810
840
|
--media-library-id=<value> Sanity Media Library ID to use
|
|
811
841
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
812
842
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
@@ -831,7 +861,7 @@ EXAMPLES
|
|
|
831
861
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
832
862
|
```
|
|
833
863
|
|
|
834
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
864
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.2.0-blueprinit.g62f8017/src/commands/functions/test.ts)_
|
|
835
865
|
|
|
836
866
|
## `sanity-run help [COMMAND]`
|
|
837
867
|
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: runtime-cli
|
|
3
|
+
description: Use the Sanity Runtime CLI for Blueprints and Functions workflows. Use when an agent needs to run or explain sanity-run commands, especially unattended command flows, local Blueprint management, Stack operations, Function development, or the experimental blueprinit command.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sanity Runtime CLI
|
|
7
|
+
|
|
8
|
+
Use `sanity-run <command> --help` for flags and arguments. Use
|
|
9
|
+
`sanity-run <command> --llms` (or `--skill`) for the agent-oriented workflow and examples for that
|
|
10
|
+
command.
|
|
11
|
+
|
|
12
|
+
Read only the command skill relevant to the task:
|
|
13
|
+
|
|
14
|
+
- `blueprinit` → `skills/blueprinit.md`
|
|
15
|
+
- `blueprints deploy` → `skills/blueprints-deploy.md`
|
|
16
|
+
- `functions test` → `skills/functions-test.md`
|
|
17
|
+
|
|
18
|
+
Derive other filenames by joining the command words with hyphens.
|
|
19
|
+
|
|
20
|
+
Command skills are added incrementally. If one is absent, inspect the command's `--help` output and
|
|
21
|
+
the repository implementation before acting.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const STARTER_DOCUMENT_TYPE = "post";
|
|
2
|
+
export declare const STARTER_FUNCTION_NAME = "set-slug";
|
|
3
|
+
export interface BlueprintManifestOptions {
|
|
4
|
+
projectName: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
datasetName: string;
|
|
8
|
+
studioName: string;
|
|
9
|
+
studioSrc: string;
|
|
10
|
+
withFunction: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function renderBlueprint(options: BlueprintManifestOptions): string;
|
|
13
|
+
export declare function slugify(value: string): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const quote = (value) => `'${value.replaceAll('\\', '\\\\').replaceAll("'", "\\'")}'`;
|
|
2
|
+
export const STARTER_DOCUMENT_TYPE = 'post';
|
|
3
|
+
export const STARTER_FUNCTION_NAME = 'set-slug';
|
|
4
|
+
export function renderBlueprint(options) {
|
|
5
|
+
const { projectName, displayName, projectId, datasetName, studioName, studioSrc, withFunction } = options;
|
|
6
|
+
const definers = ['defineBlueprint', 'defineDataset', 'defineProject', 'defineStudio'];
|
|
7
|
+
if (withFunction)
|
|
8
|
+
definers.splice(2, 0, 'defineDocumentFunction');
|
|
9
|
+
const functionResource = withFunction
|
|
10
|
+
? ` defineDocumentFunction({
|
|
11
|
+
name: ${quote(STARTER_FUNCTION_NAME)},
|
|
12
|
+
project: ${quote(projectId)},
|
|
13
|
+
event: {
|
|
14
|
+
on: ['create', 'update'],
|
|
15
|
+
filter: "_type == '${STARTER_DOCUMENT_TYPE}' && !defined(slug.current)",
|
|
16
|
+
projection: '{_id, title, slug}',
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
`
|
|
20
|
+
: '';
|
|
21
|
+
// Project references stay literal until the deploy API can resolve resource references here.
|
|
22
|
+
return `import {${definers.join(', ')}} from '@sanity/blueprints'
|
|
23
|
+
|
|
24
|
+
export default defineBlueprint({
|
|
25
|
+
resources: [
|
|
26
|
+
defineProject({
|
|
27
|
+
name: ${quote(projectName)},
|
|
28
|
+
displayName: ${quote(displayName)},
|
|
29
|
+
lifecycle: {
|
|
30
|
+
deletionPolicy: 'retain',
|
|
31
|
+
ownershipAction: {type: 'attach', id: ${quote(projectId)}},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
defineDataset({
|
|
35
|
+
name: ${quote(datasetName)},
|
|
36
|
+
project: ${quote(projectId)},
|
|
37
|
+
lifecycle: {
|
|
38
|
+
deletionPolicy: 'retain',
|
|
39
|
+
ownershipAction: {type: 'attach', id: ${quote(datasetName)}, projectId: ${quote(projectId)}},
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
defineStudio({
|
|
43
|
+
name: ${quote(studioName)},
|
|
44
|
+
src: ${quote(studioSrc)},
|
|
45
|
+
autoUpdates: {enabled: true},
|
|
46
|
+
project: ${quote(projectId)},
|
|
47
|
+
}),
|
|
48
|
+
${functionResource} ],
|
|
49
|
+
})
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
export function slugify(value) {
|
|
53
|
+
return value
|
|
54
|
+
.toLowerCase()
|
|
55
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
56
|
+
.replace(/^-+|-+$/g, '');
|
|
57
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const STUDIO_CONFIG_PATTERN = /^sanity\.config\.[cm]?[jt]sx?$/;
|
|
4
|
+
const STUDIO_CLI_PATTERN = /^sanity\.cli\.[cm]?[jt]sx?$/;
|
|
5
|
+
export function detectStudio(dir) {
|
|
6
|
+
let entries;
|
|
7
|
+
try {
|
|
8
|
+
entries = readdirSync(dir, { withFileTypes: true })
|
|
9
|
+
.filter((entry) => entry.isFile())
|
|
10
|
+
.map((entry) => entry.name);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const configFile = entries.find((name) => STUDIO_CONFIG_PATTERN.test(name));
|
|
16
|
+
if (!configFile)
|
|
17
|
+
return undefined;
|
|
18
|
+
const detected = { configFile };
|
|
19
|
+
const cliFile = entries.find((name) => STUDIO_CLI_PATTERN.test(name));
|
|
20
|
+
for (const file of [configFile, cliFile]) {
|
|
21
|
+
if (!file)
|
|
22
|
+
continue;
|
|
23
|
+
const source = readSource(join(dir, file));
|
|
24
|
+
if (!source)
|
|
25
|
+
continue;
|
|
26
|
+
detected.projectId ??= extractLiteral(source, 'projectId');
|
|
27
|
+
detected.dataset ??= extractLiteral(source, 'dataset');
|
|
28
|
+
if (detected.projectId && detected.dataset)
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
return detected;
|
|
32
|
+
}
|
|
33
|
+
function readSource(filePath) {
|
|
34
|
+
try {
|
|
35
|
+
return readFileSync(filePath, 'utf8');
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function extractLiteral(source, key) {
|
|
42
|
+
return source.match(new RegExp(`\\b${key}\\s*:\\s*(['"\`])([^'"\`\\\\]+)\\1`))?.[2];
|
|
43
|
+
}
|