@sanity/cli 8.5.0 → 8.7.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/README.md +522 -40
- package/dist/actions/auth/login/login.js +0 -1
- package/dist/actions/auth/login/login.js.map +1 -1
- package/dist/actions/deploy/deployApp.js +1 -0
- package/dist/actions/deploy/deployApp.js.map +1 -1
- package/dist/actions/deploy/deployStudioSchemasAndManifests.js.map +1 -1
- package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js +2 -113
- package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js.map +1 -1
- package/dist/actions/deploy/deployStudioSchemasAndManifestsWorker.js +52 -0
- package/dist/actions/deploy/deployStudioSchemasAndManifestsWorker.js.map +1 -0
- package/dist/actions/deploy/types.js.map +1 -1
- package/dist/commands/backups/list.js +1 -1
- package/dist/commands/backups/list.js.map +1 -1
- package/dist/commands/datasets/copy.js +1 -1
- package/dist/commands/datasets/copy.js.map +1 -1
- package/dist/generated/apiRoutes.js +14 -0
- package/dist/generated/apiRoutes.js.map +1 -1
- package/dist/util/extractDocumentsFromNdjsonOrTarball.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +19 -19
- package/dist/util/dates.js +0 -125
- package/dist/util/dates.js.map +0 -1
package/README.md
CHANGED
|
@@ -126,6 +126,21 @@ Code for sanity cli
|
|
|
126
126
|
- [`sanity users invite [EMAIL]`](#sanity-users-invite-email)
|
|
127
127
|
- [`sanity users list`](#sanity-users-list)
|
|
128
128
|
- [`sanity versions`](#sanity-versions)
|
|
129
|
+
- [`sanity workflows abort INSTANCEID`](#sanity-workflows-abort-instanceid)
|
|
130
|
+
- [`sanity workflows definition delete NAME`](#sanity-workflows-definition-delete-name)
|
|
131
|
+
- [`sanity workflows definition diff NAME`](#sanity-workflows-definition-diff-name)
|
|
132
|
+
- [`sanity workflows definition list`](#sanity-workflows-definition-list)
|
|
133
|
+
- [`sanity workflows definition show NAME`](#sanity-workflows-definition-show-name)
|
|
134
|
+
- [`sanity workflows deploy`](#sanity-workflows-deploy)
|
|
135
|
+
- [`sanity workflows diagnose INSTANCEID`](#sanity-workflows-diagnose-instanceid)
|
|
136
|
+
- [`sanity workflows fire-action INSTANCEID`](#sanity-workflows-fire-action-instanceid)
|
|
137
|
+
- [`sanity workflows list`](#sanity-workflows-list)
|
|
138
|
+
- [`sanity workflows nuke`](#sanity-workflows-nuke)
|
|
139
|
+
- [`sanity workflows reset-activity INSTANCEID ACTIVITY`](#sanity-workflows-reset-activity-instanceid-activity)
|
|
140
|
+
- [`sanity workflows set-stage INSTANCEID`](#sanity-workflows-set-stage-instanceid)
|
|
141
|
+
- [`sanity workflows show INSTANCEID`](#sanity-workflows-show-instanceid)
|
|
142
|
+
- [`sanity workflows start NAME`](#sanity-workflows-start-name)
|
|
143
|
+
- [`sanity workflows tail INSTANCEID`](#sanity-workflows-tail-instanceid)
|
|
129
144
|
|
|
130
145
|
## `sanity api ENDPOINT`
|
|
131
146
|
|
|
@@ -392,7 +407,7 @@ EXAMPLES
|
|
|
392
407
|
USAGE
|
|
393
408
|
$ sanity blueprints add TYPE [--json] [--example <value> | -n <value> | --fn-type
|
|
394
409
|
document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
|
|
395
|
-
te|media-library-asset-update|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
|
|
410
|
+
te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
|
|
396
411
|
--fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
|
|
397
412
|
|
|
398
413
|
ARGUMENTS
|
|
@@ -409,8 +424,8 @@ FLAGS
|
|
|
409
424
|
--fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
|
|
410
425
|
events by specifying this flag multiple times
|
|
411
426
|
<options: document-publish|document-create|document-delete|document-update|media-library-
|
|
412
|
-
asset-create|media-library-asset-delete|media-library-asset-update|scheduled-
|
|
413
|
-
|
|
427
|
+
asset-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-func
|
|
428
|
+
tion|sync-tag-invalidate>
|
|
414
429
|
--javascript Use JavaScript instead of TypeScript
|
|
415
430
|
--json Format output as json
|
|
416
431
|
--language=<option> [default: ts] Language of the new function
|
|
@@ -503,7 +518,9 @@ DESCRIPTION
|
|
|
503
518
|
|
|
504
519
|
Use --fn-installer to force which package manager to use when deploying functions.
|
|
505
520
|
|
|
506
|
-
Set SANITY_ASSET_TIMEOUT (seconds) to override the
|
|
521
|
+
Set SANITY_ASSET_TIMEOUT (seconds) to override the 180-second timeout for processing resource assets.
|
|
522
|
+
|
|
523
|
+
Set SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).
|
|
507
524
|
|
|
508
525
|
Exit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun
|
|
509
526
|
'blueprints info' to check).
|
|
@@ -530,16 +547,16 @@ Destroy a remote Stack deployment and its resources
|
|
|
530
547
|
|
|
531
548
|
```
|
|
532
549
|
USAGE
|
|
533
|
-
$ sanity blueprints destroy [--json] [--project-id <value> --stack <value>
|
|
550
|
+
$ sanity blueprints destroy [--json] [--project-id <value> --stack <value> -f] [--organization-id <value> ]
|
|
534
551
|
[--no-wait]
|
|
535
552
|
|
|
536
553
|
FLAGS
|
|
537
|
-
--force Force Stack destruction (skip confirmation)
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
554
|
+
-f, --force Force Stack destruction (skip confirmation)
|
|
555
|
+
--json Format output as json
|
|
556
|
+
--no-wait Do not wait for Stack destruction to complete
|
|
557
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
558
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
559
|
+
--stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
|
|
543
560
|
|
|
544
561
|
DESCRIPTION
|
|
545
562
|
Destroy a remote Stack deployment and its resources
|
|
@@ -596,13 +613,14 @@ Display the status and resources of the remote Stack deployment
|
|
|
596
613
|
|
|
597
614
|
```
|
|
598
615
|
USAGE
|
|
599
|
-
$ sanity blueprints info [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
616
|
+
$ sanity blueprints info [--json] [-v] [--stack <value>] [--project-id <value> | --organization-id <value>]
|
|
600
617
|
|
|
601
618
|
FLAGS
|
|
602
|
-
--
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
619
|
+
-v, --verbose Show resource and external IDs
|
|
620
|
+
--json Format output as json
|
|
621
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
622
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
623
|
+
--stack=<value> Stack name or ID
|
|
606
624
|
|
|
607
625
|
DESCRIPTION
|
|
608
626
|
Display the status and resources of the remote Stack deployment
|
|
@@ -653,12 +671,12 @@ DESCRIPTION
|
|
|
653
671
|
|
|
654
672
|
A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions,
|
|
655
673
|
etc.). A Stack is the remote deployment target where your Blueprint is applied.
|
|
656
|
-
[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]
|
|
657
674
|
|
|
658
675
|
This is typically the first command you run in a new project. It creates a local Blueprint manifest file
|
|
659
676
|
(sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.
|
|
660
|
-
Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs.
|
|
661
|
-
.
|
|
677
|
+
Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. A .gitignore
|
|
678
|
+
covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not
|
|
679
|
+
ignored.
|
|
662
680
|
|
|
663
681
|
After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
|
|
664
682
|
|
|
@@ -693,8 +711,8 @@ Display logs for the current Blueprint's Stack deployment
|
|
|
693
711
|
|
|
694
712
|
```
|
|
695
713
|
USAGE
|
|
696
|
-
$ sanity blueprints logs [--
|
|
697
|
-
|
|
714
|
+
$ sanity blueprints logs [--stack <value>] [--project-id <value> | --organization-id <value>] [-l <value> | [-w |
|
|
715
|
+
--json]] [--since <value> | ] [--before <value> | ]
|
|
698
716
|
|
|
699
717
|
FLAGS
|
|
700
718
|
-l, --limit=<value> Maximum number of log entries to retrieve (1-500)
|
|
@@ -844,9 +862,10 @@ List remote Stack deployments for your project or organization
|
|
|
844
862
|
|
|
845
863
|
```
|
|
846
864
|
USAGE
|
|
847
|
-
$ sanity blueprints stacks [--json] [--project-id <value> | --organization-id <value> | --include-projects]
|
|
865
|
+
$ sanity blueprints stacks [--json] [--project-id <value> | --organization-id <value> | --include-projects | --all]
|
|
848
866
|
|
|
849
867
|
FLAGS
|
|
868
|
+
--all List Stacks from every organization and project you have access to
|
|
850
869
|
--include-projects Include Stacks from all projects within the organization. Requires --organization-id.
|
|
851
870
|
--json Format output as json
|
|
852
871
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
@@ -860,11 +879,14 @@ DESCRIPTION
|
|
|
860
879
|
Use this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to
|
|
861
880
|
audit what's deployed across your project.
|
|
862
881
|
|
|
863
|
-
|
|
882
|
+
Without a scope, prompts for an organization or project. Use --all to list Stacks across every organization and
|
|
883
|
+
project you can access, or --include-projects with --organization-id for one organization and its projects.
|
|
864
884
|
|
|
865
885
|
EXAMPLES
|
|
866
886
|
$ sanity blueprints stacks
|
|
867
887
|
|
|
888
|
+
$ sanity blueprints stacks --all
|
|
889
|
+
|
|
868
890
|
$ sanity blueprints stacks --project-id <projectId>
|
|
869
891
|
|
|
870
892
|
$ sanity blueprints stacks --organization-id <organizationId>
|
|
@@ -2027,13 +2049,13 @@ Add a Function to your Blueprint
|
|
|
2027
2049
|
|
|
2028
2050
|
```
|
|
2029
2051
|
USAGE
|
|
2030
|
-
$ sanity functions add [--json] [--example <value> | -n <value> |
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
skip|npm|pnpm|yarn
|
|
2052
|
+
$ sanity functions add [--json] [--example <value> | -n <value> | --type
|
|
2053
|
+
document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
|
|
2054
|
+
te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
|
|
2055
|
+
--helpers | --installer skip|npm|pnpm|yarn | -i]
|
|
2034
2056
|
|
|
2035
2057
|
FLAGS
|
|
2036
|
-
-i, --install Shortcut for --
|
|
2058
|
+
-i, --install Shortcut for --installer npm
|
|
2037
2059
|
-n, --name=<value> Name of the Function to add
|
|
2038
2060
|
--example=<value> Example to use for the Function
|
|
2039
2061
|
--[no-]helpers Add helpers to the new Function
|
|
@@ -2046,8 +2068,8 @@ FLAGS
|
|
|
2046
2068
|
--type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
|
|
2047
2069
|
by specifying this flag multiple times
|
|
2048
2070
|
<options: document-publish|document-create|document-delete|document-update|media-library-ass
|
|
2049
|
-
et-create|media-library-asset-delete|media-library-asset-update|scheduled-function|
|
|
2050
|
-
invalidate>
|
|
2071
|
+
et-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-function|s
|
|
2072
|
+
ync-tag-invalidate>
|
|
2051
2073
|
|
|
2052
2074
|
DESCRIPTION
|
|
2053
2075
|
Add a Function to your Blueprint
|
|
@@ -2093,13 +2115,13 @@ DESCRIPTION
|
|
|
2093
2115
|
|
|
2094
2116
|
Open the emulator in your browser to interactively test your functions with the payload editor.
|
|
2095
2117
|
|
|
2096
|
-
Optionally, set the host and port with the --host and --port flags.
|
|
2097
|
-
--timeout flag.
|
|
2118
|
+
Optionally, set the host and port with the --host and --port flags. Port 8974 is reserved for the emulator's
|
|
2119
|
+
live-reload WebSocket server. Function timeout can be configured with the --timeout flag.
|
|
2098
2120
|
|
|
2099
2121
|
To invoke a function with the CLI, use 'functions test'.
|
|
2100
2122
|
|
|
2101
2123
|
EXAMPLES
|
|
2102
|
-
$ sanity functions dev --host 127.0.0.1 --port
|
|
2124
|
+
$ sanity functions dev --host 127.0.0.1 --port 3333
|
|
2103
2125
|
|
|
2104
2126
|
$ sanity functions dev --timeout 60
|
|
2105
2127
|
```
|
|
@@ -2199,7 +2221,7 @@ Retrieve or delete logs for a Sanity Function
|
|
|
2199
2221
|
|
|
2200
2222
|
```
|
|
2201
2223
|
USAGE
|
|
2202
|
-
$ sanity functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
|
|
2224
|
+
$ sanity functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w | ]
|
|
2203
2225
|
|
|
2204
2226
|
ARGUMENTS
|
|
2205
2227
|
[NAME] The name of the Sanity Function
|
|
@@ -2240,7 +2262,7 @@ USAGE
|
|
|
2240
2262
|
$ sanity functions test [NAME] [--json] [--data-before <value> | [-d <value> | -f <value> | --document-id <value>]
|
|
2241
2263
|
| | | --file-before <value> | --file-after <value> | --document-id-before <value> | --document-id-after <value>]
|
|
2242
2264
|
[--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a <value>] [--with-user-token]
|
|
2243
|
-
[--media-library-id <value> | [--project-id <value> | --organization-id <value>] | --dataset <value>]
|
|
2265
|
+
[--media-library-id <value> | [--project-id <value> | --organization-id <value>] | --dataset <value>] [--no-wait]
|
|
2244
2266
|
|
|
2245
2267
|
ARGUMENTS
|
|
2246
2268
|
[NAME] The name of the Sanity Function
|
|
@@ -2262,6 +2284,7 @@ FLAGS
|
|
|
2262
2284
|
--file-before=<value> Original document
|
|
2263
2285
|
--json Format output as json
|
|
2264
2286
|
--media-library-id=<value> Sanity Media Library ID to use
|
|
2287
|
+
--no-wait Skip durable wait delays instead of sleeping
|
|
2265
2288
|
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
2266
2289
|
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
2267
2290
|
--with-user-token Prime access token from CLI config
|
|
@@ -2793,14 +2816,14 @@ Delete an aspect definition
|
|
|
2793
2816
|
|
|
2794
2817
|
```
|
|
2795
2818
|
USAGE
|
|
2796
|
-
$ sanity media delete-aspect ASPECTNAME [-p <id>] [--media-library-id <value>] [
|
|
2819
|
+
$ sanity media delete-aspect ASPECTNAME [-p <id>] [--media-library-id <value>] [-y]
|
|
2797
2820
|
|
|
2798
2821
|
ARGUMENTS
|
|
2799
2822
|
ASPECTNAME Name of the aspect to delete
|
|
2800
2823
|
|
|
2801
2824
|
FLAGS
|
|
2802
|
-
|
|
2803
|
-
|
|
2825
|
+
-y, --yes Run without prompts and confirm deletion
|
|
2826
|
+
--media-library-id=<value> The id of the target media library
|
|
2804
2827
|
|
|
2805
2828
|
OVERRIDE FLAGS
|
|
2806
2829
|
-p, --project-id=<id> Project ID to delete media aspect from (overrides CLI configuration)
|
|
@@ -3686,13 +3709,13 @@ Delete an API token from the project
|
|
|
3686
3709
|
|
|
3687
3710
|
```
|
|
3688
3711
|
USAGE
|
|
3689
|
-
$ sanity tokens delete [TOKENID] [-p <id>] [
|
|
3712
|
+
$ sanity tokens delete [TOKENID] [-p <id>] [-y]
|
|
3690
3713
|
|
|
3691
3714
|
ARGUMENTS
|
|
3692
3715
|
[TOKENID] Token ID to delete (will prompt if not provided)
|
|
3693
3716
|
|
|
3694
3717
|
FLAGS
|
|
3695
|
-
--yes Skip confirmation prompt (unattended mode)
|
|
3718
|
+
-y, --yes Skip confirmation prompt (unattended mode)
|
|
3696
3719
|
|
|
3697
3720
|
OVERRIDE FLAGS
|
|
3698
3721
|
-p, --project-id=<id> Project ID to delete token from (overrides CLI configuration)
|
|
@@ -3945,4 +3968,463 @@ EXAMPLES
|
|
|
3945
3968
|
$ sanity versions
|
|
3946
3969
|
```
|
|
3947
3970
|
|
|
3971
|
+
## `sanity workflows abort INSTANCEID`
|
|
3972
|
+
|
|
3973
|
+
Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards removed, and the instance is marked terminal where it stands.
|
|
3974
|
+
|
|
3975
|
+
```
|
|
3976
|
+
USAGE
|
|
3977
|
+
$ sanity workflows abort INSTANCEID [--deployment <value> | --tag <value>] [--reason <value>]
|
|
3978
|
+
|
|
3979
|
+
ARGUMENTS
|
|
3980
|
+
INSTANCEID Workflow instance id.
|
|
3981
|
+
|
|
3982
|
+
FLAGS
|
|
3983
|
+
--deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
|
|
3984
|
+
partition still comes from the loaded instance.
|
|
3985
|
+
--reason=<value> Reason for aborting (recorded in history).
|
|
3986
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
3987
|
+
resources are searched; omit to span them all.
|
|
3988
|
+
|
|
3989
|
+
DESCRIPTION
|
|
3990
|
+
Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards removed, and the
|
|
3991
|
+
instance is marked terminal where it stands.
|
|
3992
|
+
|
|
3993
|
+
EXAMPLES
|
|
3994
|
+
$ sanity workflows abort wf-instance.abc123
|
|
3995
|
+
|
|
3996
|
+
$ sanity workflows abort wf-instance.abc123 --reason 'superseded by relaunch'
|
|
3997
|
+
```
|
|
3998
|
+
|
|
3999
|
+
## `sanity workflows definition delete NAME`
|
|
4000
|
+
|
|
4001
|
+
Delete a deployed workflow definition (every version, or one via --version). Refuses while non-terminal instances exist unless --cascade aborts them first — instances are aborted in place, never deleted.
|
|
4002
|
+
|
|
4003
|
+
```
|
|
4004
|
+
USAGE
|
|
4005
|
+
$ sanity workflows definition delete NAME [--deployment <value> | --tag <value>] [--version <value>] [--cascade] [--reason
|
|
4006
|
+
<value>]
|
|
4007
|
+
|
|
4008
|
+
ARGUMENTS
|
|
4009
|
+
NAME Workflow definition name.
|
|
4010
|
+
|
|
4011
|
+
FLAGS
|
|
4012
|
+
--cascade Abort every non-terminal instance pinned to the targeted versions, then delete.
|
|
4013
|
+
--deployment=<value> Deployment name — the unique identity of one deployment in the config.
|
|
4014
|
+
--reason=<value> Free-text reason — recorded on each cascade-abort history entry.
|
|
4015
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
|
|
4016
|
+
names exactly one; pass --deployment when it spans several.
|
|
4017
|
+
--version=<value> Delete only this deployed version (default: every version).
|
|
4018
|
+
|
|
4019
|
+
DESCRIPTION
|
|
4020
|
+
Delete a deployed workflow definition (every version, or one via --version). Refuses while non-terminal instances
|
|
4021
|
+
exist unless --cascade aborts them first — instances are aborted in place, never deleted.
|
|
4022
|
+
|
|
4023
|
+
EXAMPLES
|
|
4024
|
+
$ sanity workflows definition delete my-workflow
|
|
4025
|
+
|
|
4026
|
+
$ sanity workflows definition delete my-workflow --version 2
|
|
4027
|
+
|
|
4028
|
+
$ sanity workflows definition delete my-workflow --cascade --reason 'workflow retired'
|
|
4029
|
+
```
|
|
4030
|
+
|
|
4031
|
+
## `sanity workflows definition diff NAME`
|
|
4032
|
+
|
|
4033
|
+
Diff an in-code definition against the deployed version (latest by default).
|
|
4034
|
+
|
|
4035
|
+
```
|
|
4036
|
+
USAGE
|
|
4037
|
+
$ sanity workflows definition diff NAME [--deployment <value> | --tag <value>] [--version <value>]
|
|
4038
|
+
|
|
4039
|
+
ARGUMENTS
|
|
4040
|
+
NAME Workflow definition name.
|
|
4041
|
+
|
|
4042
|
+
FLAGS
|
|
4043
|
+
--deployment=<value> Deployment name — the unique identity of one deployment in the config.
|
|
4044
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
|
|
4045
|
+
names exactly one; pass --deployment when it spans several.
|
|
4046
|
+
--version=<value> Deployed version to diff against (default: latest).
|
|
4047
|
+
|
|
4048
|
+
DESCRIPTION
|
|
4049
|
+
Diff an in-code definition against the deployed version (latest by default).
|
|
4050
|
+
|
|
4051
|
+
EXAMPLES
|
|
4052
|
+
$ sanity workflows definition diff productLaunch
|
|
4053
|
+
|
|
4054
|
+
$ sanity workflows definition diff productLaunch --version 2
|
|
4055
|
+
```
|
|
4056
|
+
|
|
4057
|
+
## `sanity workflows definition list`
|
|
4058
|
+
|
|
4059
|
+
List deployed workflow definitions.
|
|
4060
|
+
|
|
4061
|
+
```
|
|
4062
|
+
USAGE
|
|
4063
|
+
$ sanity workflows definition list [--tag <value>] [--limit <value>] [--name <value>] [--json]
|
|
4064
|
+
|
|
4065
|
+
FLAGS
|
|
4066
|
+
--json Emit structured JSON instead of rendered output.
|
|
4067
|
+
--limit=<value> [default: 100] The maximum number of definitions to return.
|
|
4068
|
+
--name=<value> Filter to a single workflow definition name (e.g. product-launch).
|
|
4069
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4070
|
+
resources are searched; omit to span them all.
|
|
4071
|
+
|
|
4072
|
+
DESCRIPTION
|
|
4073
|
+
List deployed workflow definitions.
|
|
4074
|
+
|
|
4075
|
+
EXAMPLES
|
|
4076
|
+
$ sanity workflows definition list
|
|
4077
|
+
|
|
4078
|
+
$ sanity workflows definition list --tag prod
|
|
4079
|
+
|
|
4080
|
+
$ sanity workflows definition list --json
|
|
4081
|
+
```
|
|
4082
|
+
|
|
4083
|
+
## `sanity workflows definition show NAME`
|
|
4084
|
+
|
|
4085
|
+
Show a deployed workflow definition.
|
|
4086
|
+
|
|
4087
|
+
```
|
|
4088
|
+
USAGE
|
|
4089
|
+
$ sanity workflows definition show NAME [--tag <value>] [--version <value>] [--json]
|
|
4090
|
+
|
|
4091
|
+
ARGUMENTS
|
|
4092
|
+
NAME Workflow definition name.
|
|
4093
|
+
|
|
4094
|
+
FLAGS
|
|
4095
|
+
--json Emit structured JSON instead of rendered output.
|
|
4096
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4097
|
+
resources are searched; omit to span them all.
|
|
4098
|
+
--version=<value> Specific version (default: latest).
|
|
4099
|
+
|
|
4100
|
+
DESCRIPTION
|
|
4101
|
+
Show a deployed workflow definition.
|
|
4102
|
+
```
|
|
4103
|
+
|
|
4104
|
+
## `sanity workflows deploy`
|
|
4105
|
+
|
|
4106
|
+
Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.
|
|
4107
|
+
|
|
4108
|
+
```
|
|
4109
|
+
USAGE
|
|
4110
|
+
$ sanity workflows deploy [--all-tags | | [--deployment <value> | --tag <value>]] [--dry-run] [--check] [--only
|
|
4111
|
+
<value>] [--share-defs]
|
|
4112
|
+
|
|
4113
|
+
FLAGS
|
|
4114
|
+
--all-tags Deploy every deployment in the config, not just a selection.
|
|
4115
|
+
--check Validate definitions only; do not contact the dataset.
|
|
4116
|
+
--deployment=<value> Deployment name — the unique identity of one deployment in the config.
|
|
4117
|
+
--dry-run Validate + diff against the deployed version; do not write.
|
|
4118
|
+
--only=<value> Limit deploy/check/diff to a single workflow definition by name (deployments are selected with
|
|
4119
|
+
--deployment). Every targeted deployment must contain it.
|
|
4120
|
+
--[no-]share-defs Share the definition documents newly created by this deploy with Sanity — the full document,
|
|
4121
|
+
verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment
|
|
4122
|
+
coordinates (project and dataset, or resource id); never content documents, instances, or your
|
|
4123
|
+
Sanity auth token. Sharing is the default in every environment, including CI / non-TTY /
|
|
4124
|
+
DO_NOT_TRACK. Use --no-share-defs to opt out.
|
|
4125
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — deploys every deployment carrying the tag (a tag is
|
|
4126
|
+
an environment group).
|
|
4127
|
+
|
|
4128
|
+
DESCRIPTION
|
|
4129
|
+
Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.
|
|
4130
|
+
|
|
4131
|
+
EXAMPLES
|
|
4132
|
+
$ sanity workflows deploy --deployment review-prod
|
|
4133
|
+
|
|
4134
|
+
$ sanity workflows deploy --tag prod
|
|
4135
|
+
|
|
4136
|
+
$ sanity workflows deploy --all-tags
|
|
4137
|
+
|
|
4138
|
+
$ sanity workflows deploy --check
|
|
4139
|
+
|
|
4140
|
+
$ sanity workflows deploy --dry-run
|
|
4141
|
+
|
|
4142
|
+
$ sanity workflows deploy --only productLaunch
|
|
4143
|
+
```
|
|
4144
|
+
|
|
4145
|
+
## `sanity workflows diagnose INSTANCEID`
|
|
4146
|
+
|
|
4147
|
+
Explain why a workflow instance is or isn't progressing, and what would unstick it.
|
|
4148
|
+
|
|
4149
|
+
```
|
|
4150
|
+
USAGE
|
|
4151
|
+
$ sanity workflows diagnose INSTANCEID [--deployment <value> | --tag <value>] [--json]
|
|
4152
|
+
|
|
4153
|
+
ARGUMENTS
|
|
4154
|
+
INSTANCEID Workflow instance id.
|
|
4155
|
+
|
|
4156
|
+
FLAGS
|
|
4157
|
+
--deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
|
|
4158
|
+
partition still comes from the loaded instance.
|
|
4159
|
+
--json Emit structured JSON instead of rendered output.
|
|
4160
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4161
|
+
resources are searched; omit to span them all.
|
|
4162
|
+
|
|
4163
|
+
DESCRIPTION
|
|
4164
|
+
Explain why a workflow instance is or isn't progressing, and what would unstick it.
|
|
4165
|
+
|
|
4166
|
+
EXAMPLES
|
|
4167
|
+
$ sanity workflows diagnose wf-instance.abc123
|
|
4168
|
+
|
|
4169
|
+
$ sanity workflows diagnose wf-instance.abc123 --tag prod
|
|
4170
|
+
|
|
4171
|
+
$ sanity workflows diagnose wf-instance.abc123 --json
|
|
4172
|
+
```
|
|
4173
|
+
|
|
4174
|
+
## `sanity workflows fire-action INSTANCEID`
|
|
4175
|
+
|
|
4176
|
+
Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to list what can be fired.
|
|
4177
|
+
|
|
4178
|
+
```
|
|
4179
|
+
USAGE
|
|
4180
|
+
$ sanity workflows fire-action INSTANCEID [--deployment <value> | --tag <value>] [--activity <value>] [--action <value>]
|
|
4181
|
+
[--param <value>...] [--json]
|
|
4182
|
+
|
|
4183
|
+
ARGUMENTS
|
|
4184
|
+
INSTANCEID Workflow instance id.
|
|
4185
|
+
|
|
4186
|
+
FLAGS
|
|
4187
|
+
--action=<value> Action to fire. Omit to list the actions available on the instance.
|
|
4188
|
+
--activity=<value> Activity the action belongs to. Required to fire; omit --action to list.
|
|
4189
|
+
--deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
|
|
4190
|
+
partition still comes from the loaded instance.
|
|
4191
|
+
--json Emit structured JSON instead of rendered output.
|
|
4192
|
+
--param=<value>... [default: ] Action param as key=value (repeatable). Values are JSON-parsed, falling back to a
|
|
4193
|
+
string.
|
|
4194
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4195
|
+
resources are searched; omit to span them all.
|
|
4196
|
+
|
|
4197
|
+
DESCRIPTION
|
|
4198
|
+
Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to
|
|
4199
|
+
list what can be fired.
|
|
4200
|
+
|
|
4201
|
+
EXAMPLES
|
|
4202
|
+
$ sanity workflows fire-action wf-instance.abc123
|
|
4203
|
+
|
|
4204
|
+
$ sanity workflows fire-action wf-instance.abc123 --activity approve --action approve
|
|
4205
|
+
|
|
4206
|
+
$ sanity workflows fire-action wf-instance.abc123 --activity publish --action publish --param note=shipping
|
|
4207
|
+
```
|
|
4208
|
+
|
|
4209
|
+
## `sanity workflows list`
|
|
4210
|
+
|
|
4211
|
+
List workflow instances in the configured dataset (in-flight by default).
|
|
4212
|
+
|
|
4213
|
+
```
|
|
4214
|
+
USAGE
|
|
4215
|
+
$ sanity workflows list [--tag <value>] [--include-completed] [--failed] [--definition <value>] [--document
|
|
4216
|
+
<value>] [--limit <value>] [--json]
|
|
4217
|
+
|
|
4218
|
+
FLAGS
|
|
4219
|
+
--definition=<value> Only instances of this workflow definition (its `name`; the instance's `definition` field).
|
|
4220
|
+
--document=<value> Only instances that reference this document (resource-qualified GDR URI, e.g.
|
|
4221
|
+
"dataset:proj:ds:article-1").
|
|
4222
|
+
--failed Only instances with at least one failed activity.
|
|
4223
|
+
--include-completed Include completed/aborted instances (default: in-flight only).
|
|
4224
|
+
--json Emit structured JSON instead of rendered output.
|
|
4225
|
+
--limit=<value> [default: 50] Maximum rows to return.
|
|
4226
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4227
|
+
resources are searched; omit to span them all.
|
|
4228
|
+
|
|
4229
|
+
DESCRIPTION
|
|
4230
|
+
List workflow instances in the configured dataset (in-flight by default).
|
|
4231
|
+
|
|
4232
|
+
EXAMPLES
|
|
4233
|
+
$ sanity workflows list
|
|
4234
|
+
|
|
4235
|
+
$ sanity workflows list --include-completed
|
|
4236
|
+
|
|
4237
|
+
$ sanity workflows list --definition productLaunch
|
|
4238
|
+
|
|
4239
|
+
$ sanity workflows list --document dataset:proj:ds:article-1
|
|
4240
|
+
|
|
4241
|
+
$ sanity workflows list --tag prod
|
|
4242
|
+
|
|
4243
|
+
$ sanity workflows list --json
|
|
4244
|
+
```
|
|
4245
|
+
|
|
4246
|
+
## `sanity workflows nuke`
|
|
4247
|
+
|
|
4248
|
+
Delete engine-owned documents — a whole deployment tag, or a single instance.
|
|
4249
|
+
|
|
4250
|
+
```
|
|
4251
|
+
USAGE
|
|
4252
|
+
$ sanity workflows nuke [--deployment <value>] [--tag <value>] [--instance <value>] [--force]
|
|
4253
|
+
|
|
4254
|
+
FLAGS
|
|
4255
|
+
--deployment=<value> The deployment name to reset. With --instance, narrows which deployment the instance is looked
|
|
4256
|
+
up in when its tag spans several.
|
|
4257
|
+
--force Skip the confirmation prompt (for scripts/CI). The plan still prints.
|
|
4258
|
+
--instance=<value> Delete a single terminal instance by id, plus its guard docs, instead of a tag.
|
|
4259
|
+
--tag=<value> The deployment tag to reset (while it names exactly one deployment). Not valid with --instance,
|
|
4260
|
+
which reads its tag from the instance id.
|
|
4261
|
+
|
|
4262
|
+
DESCRIPTION
|
|
4263
|
+
Delete engine-owned documents — a whole deployment tag, or a single instance.
|
|
4264
|
+
|
|
4265
|
+
The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the tag's
|
|
4266
|
+
instances, definitions, and guards (across every alias-bound resource). --instance <id> instead deletes one terminal
|
|
4267
|
+
instance plus its guards. Content documents are never touched. Prints a dry-run plan, then confirms (--force skips the
|
|
4268
|
+
prompt; the plan still prints).
|
|
4269
|
+
|
|
4270
|
+
EXAMPLES
|
|
4271
|
+
$ sanity workflows nuke --deployment plugin-dev
|
|
4272
|
+
|
|
4273
|
+
$ sanity workflows nuke --tag plugin-dev --force
|
|
4274
|
+
|
|
4275
|
+
$ sanity workflows nuke --instance plugin-dev.wf-instance.abc123
|
|
4276
|
+
```
|
|
4277
|
+
|
|
4278
|
+
## `sanity workflows reset-activity INSTANCEID ACTIVITY`
|
|
4279
|
+
|
|
4280
|
+
Reset a failed activity on an in-flight instance — back to active to re-run it, or --skip to bypass it (mark it skipped) so a gated exit transition can fire.
|
|
4281
|
+
|
|
4282
|
+
```
|
|
4283
|
+
USAGE
|
|
4284
|
+
$ sanity workflows reset-activity INSTANCEID ACTIVITY [--deployment <value> | --tag <value>] [--skip]
|
|
4285
|
+
|
|
4286
|
+
ARGUMENTS
|
|
4287
|
+
INSTANCEID Workflow instance id.
|
|
4288
|
+
ACTIVITY Activity name within the current stage.
|
|
4289
|
+
|
|
4290
|
+
FLAGS
|
|
4291
|
+
--deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
|
|
4292
|
+
partition still comes from the loaded instance.
|
|
4293
|
+
--skip Bypass the activity (mark it skipped) instead of re-running it (back to active).
|
|
4294
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4295
|
+
resources are searched; omit to span them all.
|
|
4296
|
+
|
|
4297
|
+
DESCRIPTION
|
|
4298
|
+
Reset a failed activity on an in-flight instance — back to active to re-run it, or --skip to bypass it (mark it
|
|
4299
|
+
skipped) so a gated exit transition can fire.
|
|
4300
|
+
|
|
4301
|
+
EXAMPLES
|
|
4302
|
+
$ sanity workflows reset-activity wf-instance.abc123 legal-review
|
|
4303
|
+
|
|
4304
|
+
$ sanity workflows reset-activity wf-instance.abc123 legal-review --skip
|
|
4305
|
+
```
|
|
4306
|
+
|
|
4307
|
+
## `sanity workflows set-stage INSTANCEID`
|
|
4308
|
+
|
|
4309
|
+
Force an instance into a stage, regardless of its declared transitions and filters — the engine's setStage admin override. The target stage's enter lifecycle still runs (auto-activities start, stage guards reconcile), and the post-move cascade can immediately auto-transition the instance onward.
|
|
4310
|
+
|
|
4311
|
+
```
|
|
4312
|
+
USAGE
|
|
4313
|
+
$ sanity workflows set-stage INSTANCEID [--deployment <value> | --tag <value>] [--to <value>] [--reason <value>]
|
|
4314
|
+
|
|
4315
|
+
ARGUMENTS
|
|
4316
|
+
INSTANCEID Workflow instance id to move.
|
|
4317
|
+
|
|
4318
|
+
FLAGS
|
|
4319
|
+
--deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
|
|
4320
|
+
partition still comes from the loaded instance.
|
|
4321
|
+
--reason=<value> Free-text reason — recorded on the history entry for audit.
|
|
4322
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4323
|
+
resources are searched; omit to span them all.
|
|
4324
|
+
--to=<value> Target stage name. Omit on an interactive terminal to pick from the workflow’s stages.
|
|
4325
|
+
|
|
4326
|
+
DESCRIPTION
|
|
4327
|
+
Force an instance into a stage, regardless of its declared transitions and filters — the engine's setStage admin
|
|
4328
|
+
override. The target stage's enter lifecycle still runs (auto-activities start, stage guards reconcile), and the
|
|
4329
|
+
post-move cascade can immediately auto-transition the instance onward.
|
|
4330
|
+
|
|
4331
|
+
EXAMPLES
|
|
4332
|
+
$ sanity workflows set-stage wf-instance.abc123 --to ready
|
|
4333
|
+
|
|
4334
|
+
$ sanity workflows set-stage wf-instance.abc123
|
|
4335
|
+
|
|
4336
|
+
$ sanity workflows set-stage wf-instance.abc123 --to ready --reason 'unblock for demo'
|
|
4337
|
+
```
|
|
4338
|
+
|
|
4339
|
+
## `sanity workflows show INSTANCEID`
|
|
4340
|
+
|
|
4341
|
+
Show the state, activities, and effects of a workflow instance.
|
|
4342
|
+
|
|
4343
|
+
```
|
|
4344
|
+
USAGE
|
|
4345
|
+
$ sanity workflows show INSTANCEID [--tag <value>] [--include history...] [--json]
|
|
4346
|
+
|
|
4347
|
+
ARGUMENTS
|
|
4348
|
+
INSTANCEID Workflow instance document id.
|
|
4349
|
+
|
|
4350
|
+
FLAGS
|
|
4351
|
+
--include=<option>... [default: ] Optional sections to include in rendered output (--json always carries the full
|
|
4352
|
+
document).
|
|
4353
|
+
<options: history>
|
|
4354
|
+
--json Emit structured JSON instead of rendered output.
|
|
4355
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
|
|
4356
|
+
resources are searched; omit to span them all.
|
|
4357
|
+
|
|
4358
|
+
DESCRIPTION
|
|
4359
|
+
Show the state, activities, and effects of a workflow instance.
|
|
4360
|
+
|
|
4361
|
+
EXAMPLES
|
|
4362
|
+
$ sanity workflows show wf-instance.abc123
|
|
4363
|
+
|
|
4364
|
+
$ sanity workflows show wf-instance.abc123 --include history
|
|
4365
|
+
|
|
4366
|
+
$ sanity workflows show wf-instance.abc123 --json
|
|
4367
|
+
```
|
|
4368
|
+
|
|
4369
|
+
## `sanity workflows start NAME`
|
|
4370
|
+
|
|
4371
|
+
Start a workflow instance from a deployed definition. Supply values for the workflow's input-sourced fields with --field (e.g. the subject document ref).
|
|
4372
|
+
|
|
4373
|
+
```
|
|
4374
|
+
USAGE
|
|
4375
|
+
$ sanity workflows start NAME [--deployment <value> | --tag <value>] [--version <value>] [--field <value>...]
|
|
4376
|
+
[--instance-id <value>] [--json]
|
|
4377
|
+
|
|
4378
|
+
ARGUMENTS
|
|
4379
|
+
NAME Workflow definition name.
|
|
4380
|
+
|
|
4381
|
+
FLAGS
|
|
4382
|
+
--deployment=<value> Deployment name — the unique identity of one deployment in the config.
|
|
4383
|
+
--field=<value>... [default: ] Initial value for a declared input-sourced field, as name=value (repeatable).
|
|
4384
|
+
Values are JSON-parsed, falling back to a string; ref kinds take a JSON object with a GDR `id`
|
|
4385
|
+
and doc `type`.
|
|
4386
|
+
--instance-id=<value> Start under this instance id — for retries. The id is the start's idempotency key: pass the id
|
|
4387
|
+
of a start that failed partway and the engine resumes it instead of creating a duplicate (an
|
|
4388
|
+
already-settled start replays as a no-op). Omit to mint a fresh id.
|
|
4389
|
+
--json Emit structured JSON instead of rendered output.
|
|
4390
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
|
|
4391
|
+
names exactly one; pass --deployment when it spans several.
|
|
4392
|
+
--version=<value> Definition version to start from (default: highest deployed).
|
|
4393
|
+
|
|
4394
|
+
DESCRIPTION
|
|
4395
|
+
Start a workflow instance from a deployed definition. Supply values for the workflow's input-sourced fields with
|
|
4396
|
+
--field (e.g. the subject document ref).
|
|
4397
|
+
|
|
4398
|
+
EXAMPLES
|
|
4399
|
+
$ sanity workflows start productLaunch
|
|
4400
|
+
|
|
4401
|
+
$ sanity workflows start article-review --field subject='{"id":"dataset:proj:ds:article-1","type":"article"}'
|
|
4402
|
+
|
|
4403
|
+
$ sanity workflows start productLaunch --version 2 --tag prod
|
|
4404
|
+
|
|
4405
|
+
$ sanity workflows start productLaunch --instance-id prod.wf-instance.a1b2c3d4e5f6
|
|
4406
|
+
```
|
|
4407
|
+
|
|
4408
|
+
## `sanity workflows tail INSTANCEID`
|
|
4409
|
+
|
|
4410
|
+
Stream new history entries on a workflow instance as they land in the dataset.
|
|
4411
|
+
|
|
4412
|
+
```
|
|
4413
|
+
USAGE
|
|
4414
|
+
$ sanity workflows tail INSTANCEID [--tag <value>]
|
|
4415
|
+
|
|
4416
|
+
ARGUMENTS
|
|
4417
|
+
INSTANCEID Workflow instance id to tail.
|
|
4418
|
+
|
|
4419
|
+
FLAGS
|
|
4420
|
+
--tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which resources
|
|
4421
|
+
are searched; omit to span them all.
|
|
4422
|
+
|
|
4423
|
+
DESCRIPTION
|
|
4424
|
+
Stream new history entries on a workflow instance as they land in the dataset.
|
|
4425
|
+
|
|
4426
|
+
EXAMPLES
|
|
4427
|
+
$ sanity workflows tail wf-instance.abc123
|
|
4428
|
+
```
|
|
4429
|
+
|
|
3948
4430
|
<!-- commandsstop -->
|