JSPM

  • Created
  • Published
  • Downloads 158231
  • Score
    100M100P100Q171407F
  • License MIT

Sanity's Runtime CLI for Blueprints and Functions

Package Exports

  • @sanity/runtime-cli
  • @sanity/runtime-cli/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sanity/runtime-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@sanity/runtime-cli

Sanity's Runtime CLI for Blueprints and Functions

oclif Version Downloads/week

Usage

$ npm install -g @sanity/runtime-cli
$ sanity-run COMMAND
running command...
$ sanity-run (--version)
@sanity/runtime-cli/2.6.0 linux-x64 node-v22.14.0
$ sanity-run --help [COMMAND]
USAGE
  $ sanity-run COMMAND
...

Commands

sanity-run blueprints add TYPE

Add a resource to a Blueprint

USAGE
  $ sanity-run blueprints add TYPE

ARGUMENTS
  TYPE  (function) Type of resource to add (e.g. function)

DESCRIPTION
  Add a resource to a Blueprint

EXAMPLES
  $ sanity-run blueprints add function

See code: src/commands/blueprints/add.ts

sanity-run blueprints config

View or edit Blueprint configuration

USAGE
  $ sanity-run blueprints config [--edit]

FLAGS
  --edit  Edit the configuration

DESCRIPTION
  View or edit Blueprint configuration

EXAMPLES
  $ sanity-run blueprints config

  $ sanity-run blueprints config --edit

See code: src/commands/blueprints/config.ts

sanity-run blueprints deploy

Deploy a Blueprint

USAGE
  $ sanity-run blueprints deploy

DESCRIPTION
  Deploy a Blueprint

EXAMPLES
  $ sanity-run blueprints deploy

See code: src/commands/blueprints/deploy.ts

sanity-run blueprints info

Show information about a Blueprint

USAGE
  $ sanity-run blueprints info [--id <value>]

FLAGS
  --id=<value>  Stack ID to show info for (defaults to current stack)

DESCRIPTION
  Show information about a Blueprint

EXAMPLES
  $ sanity-run blueprints info

  $ sanity-run blueprints info --id abc123

See code: src/commands/blueprints/info.ts

sanity-run blueprints init

Initialize a new Blueprint

USAGE
  $ sanity-run blueprints init

DESCRIPTION
  Initialize a new Blueprint

EXAMPLES
  $ sanity-run blueprints init

See code: src/commands/blueprints/init.ts

sanity-run blueprints logs

Display logs for a Blueprint stack

USAGE
  $ sanity-run blueprints logs [-w]

FLAGS
  -w, --watch  Watch for new logs (streaming mode)

DESCRIPTION
  Display logs for a Blueprint stack

EXAMPLES
  $ sanity-run blueprints logs

  $ sanity-run blueprints logs --watch

See code: src/commands/blueprints/logs.ts

sanity-run blueprints plan

Enumerate resources to be deployed - will not modify any resources

USAGE
  $ sanity-run blueprints plan

DESCRIPTION
  Enumerate resources to be deployed - will not modify any resources

EXAMPLES
  $ sanity-run blueprints plan

See code: src/commands/blueprints/plan.ts

sanity-run blueprints stacks

List all Blueprint stacks

USAGE
  $ sanity-run blueprints stacks

DESCRIPTION
  List all Blueprint stacks

EXAMPLES
  $ sanity-run blueprints stacks

See code: src/commands/blueprints/stacks.ts

sanity-run functions dev

Start the Sanity Function emulator

USAGE
  $ sanity-run functions dev [-p <value>]

FLAGS
  -p, --port=<value>  Port to start emulator on

DESCRIPTION
  Start the Sanity Function emulator

EXAMPLES
  $ sanity-run functions dev --port 8974

See code: src/commands/functions/dev.ts

sanity-run functions env add NAME KEY VALUE

Add or set the value of an environment variable for a Sanity function

USAGE
  $ sanity-run functions env add NAME KEY VALUE

ARGUMENTS
  NAME   The name of the Sanity Function
  KEY    The name of the environment variable
  VALUE  The value of the environment variable

DESCRIPTION
  Add or set the value of an environment variable for a Sanity function

EXAMPLES
  $ sanity-run functions env add MyFunction API_URL https://api.example.com/

See code: src/commands/functions/env/add.ts

sanity-run functions env remove NAME KEY

Remove an environment variable for a Sanity function

USAGE
  $ sanity-run functions env remove NAME KEY

ARGUMENTS
  NAME  The name of the Sanity Function
  KEY   The name of the environment variable

DESCRIPTION
  Remove an environment variable for a Sanity function

EXAMPLES
  $ sanity-run functions env remove MyFunction API_URL

See code: src/commands/functions/env/remove.ts

sanity-run functions invoke NAME

Invoke a remote Sanity Function

USAGE
  $ sanity-run functions invoke NAME [-d <value>] [-f <value>]

ARGUMENTS
  NAME  The name of the Sanity Function

FLAGS
  -d, --data=<value>  Data to send to the function
  -f, --file=<value>  Read data from file and send to the function

DESCRIPTION
  Invoke a remote Sanity Function

EXAMPLES
  $ sanity-run functions invoke <name> --data '{ "id": 1 }'

  $ sanity-run functions invoke <name> --file 'payload.json'

See code: src/commands/functions/invoke.ts

sanity-run functions logs NAME

Retrieve logs for a Sanity Function

USAGE
  $ sanity-run functions logs NAME [-l <value>] [-j]

ARGUMENTS
  NAME  The name of the Sanity Function

FLAGS
  -j, --json           Return logs in JSON format
  -l, --limit=<value>  [default: 50] Total number of log entries to retrieve

DESCRIPTION
  Retrieve logs for a Sanity Function

EXAMPLES
  $ sanity-run functions logs <name>

  $ sanity-run functions logs <name> --json

  $ sanity-run functions logs <name> --limit 100

See code: src/commands/functions/logs.ts

sanity-run functions test NAME

Invoke a local Sanity Function

USAGE
  $ sanity-run functions test NAME [-d <value>] [-f <value>] [-t <value>] [-a <value>] [--dataset <value>]
    [--project <value>]

ARGUMENTS
  NAME  The name of the Sanity Function

FLAGS
  -a, --api=<value>      Sanity API Version to use
  -d, --data=<value>     Data to send to the function
  -f, --file=<value>     Read data from file and send to the function
  -t, --timeout=<value>  Execution timeout value in seconds
      --dataset=<value>  The Sanity dataset to use
      --project=<value>  The Sanity project to use

DESCRIPTION
  Invoke a local Sanity Function

EXAMPLES
  $ sanity-run functions test <name> --data '{ "id": 1 }'

  $ sanity-run functions test <name> --file 'payload.json'

  $ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60

See code: src/commands/functions/test.ts

sanity-run help [COMMAND]

Display help for sanity-run.

USAGE
  $ sanity-run help [COMMAND...] [-n]

ARGUMENTS
  COMMAND...  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for sanity-run.

See code: @oclif/plugin-help