Was this page helpful?
Reference documentation for the Sanity CLI Blueprints command.
The blueprints CLI command enables initializing, managing, and deploying Blueprints and resources like Functions.
usage: npx sanity blueprints [--default] [-v|--version] [-d|--debug] [-h|--help] <command> [<args>] Commands: add Add a Resource to a Blueprint config View or edit local Blueprints configuration deploy Deploy a Blueprint to create or update a Stack destroy Destroy a Blueprint to undeploy the Stack doctor Check the health of a Blueprint project info Retrieve information about a Blueprint Stack init Initialize a new Blueprint manifest file logs Display logs for the current Blueprint Stack plan Enumerate Resources to be deployed stacks List all Blueprint Stacks for the current Project See 'npx sanity help blueprints <command>' for specific information on a subcommand.
addusage: npx sanity blueprints add <type> [--name <name>] [--fn-type <document-publish>] [--fn-lang <ts|js>] [--javascript]
Add a Resource to a Blueprint
Arguments
<type> Type of Resource to add (currently only 'function' is supported)
Options
--name, -n <name> Name of the Resource
--fn-type <type> Type of Function to add (e.g. document-publish)
--fn-language, --lang <ts|js> Language of the Function. Default: "ts"
--js, --javascript Shortcut for --fn-language=js
--fn-helpers, --helpers Add helpers to the Function
--no-fn-helpers Do not add helpers to the Function
--fn-installer, Package manager to use for Function helpers
--installer <npm|pnpm|yarn> sets --fn-helpers to true
--install, -i Shortcut for --fn-installer=npm
Examples:
# Add a Function (TypeScript by default)
sanity blueprints add function
# Add a Function with a specific name and install helpers with npm
sanity blueprints add function --name my-function -i
# Add a Function with a specific type
sanity blueprints add function --fn-type document-publish
# Add a JavaScript Function
sanity blueprints add function --js
# Add a Function without helpers
sanity blueprints add function --no-fn-helpers
# Add a document-publish .js Function with helpers and install with npm
sanity blueprints add function -n roboto --fn-type document-publish --js -iconfigusage: npx sanity blueprints config [--edit] [-e] [--test] [-t] [--project-id <id>] View or edit local Blueprints configuration Options --edit, -e Modify the configuration interactively, or directly when combined with ID flags. --project-id <id> Directly set the Project ID in the configuration. Requires --edit flag --stack-id <id> Directly set the Stack ID in the configuration. Requires --edit flag --verbose Output verbose logs Examples: # View current configuration sanity blueprints config # Edit configuration sanity blueprints config --edit # Test configuration sanity blueprints config --test # Edit and test configuration sanity blueprints config -et
deployusage: npx sanity blueprints deploy [--no-wait] Deploy a Blueprint to create or update a Stack Options --no-wait Do not wait for deployment to complete Examples: # Deploy the current blueprint sanity blueprints deploy # Deploy the current blueprint without waiting for completion sanity blueprints deploy --no-wait
destroyusage: npx sanity blueprints destroy [--force] [-f] [--no-wait] Destroy a Blueprint deployment Options --force, -f Force destroy without confirmation --no-wait Do not wait for destroy to complete Examples: # Destroy the current deployment sanity blueprints destroy # Force destroy without confirmation sanity blueprints destroy --force # Destroy without waiting for completion sanity blueprints destroy --no-wait
doctorusage: npx sanity blueprints doctor [--verbose] Check the health of a Blueprint project Examples: # Check the health of the current Blueprint project sanity blueprints doctor --verbose
infousage: npx sanity blueprints info Retrieve information about a Blueprint Stack Examples: # Retrieve information about the current Stack sanity blueprints info
initusage: npx sanity blueprints init [dir] [--blueprint-type <type>] [--project-id <id>] Initialize a new Blueprint manifest file Arguments [dir] Path to initialize the Blueprint in Options --blueprint-type, --type <json> Type of Blueprint to create --project-id <id> Project ID to use Examples: # Create a new Blueprint manifest file in the current directory sanity blueprints init # Create a new Blueprint manifest file in a specific directory sanity blueprints init my-sanity-project --type json
logsusage: npx sanity blueprints logs [--watch] [-w] Display logs for the current Blueprint Stack Options --watch, -w Watch for new logs (streaming mode) Examples: # Show logs for the current Stack sanity blueprints logs # Watch for new logs (streaming mode) sanity blueprints logs --watch
planusage: npx sanity blueprints plan Enumerate Resources to be deployed Safe to run at any time. Will not modify any Resources. Examples: # Show deployment plan for the current Blueprint sanity blueprints plan
usage: npx sanity blueprints [--default] [-v|--version] [-d|--debug] [-h|--help] <command> [<args>]
Commands:
add Add a Resource to a Blueprint
config View or edit local Blueprints configuration
deploy Deploy a Blueprint to create or update a Stack
destroy Destroy a Blueprint to undeploy the Stack
doctor Check the health of a Blueprint project
info Retrieve information about a Blueprint Stack
init Initialize a new Blueprint manifest file
logs Display logs for the current Blueprint Stack
plan Enumerate Resources to be deployed
stacks List all Blueprint Stacks for the current Project
See 'npx sanity help blueprints <command>' for specific information on a subcommand.usage: npx sanity blueprints add <type> [--name <name>] [--fn-type <document-publish>] [--fn-lang <ts|js>] [--javascript]
Add a Resource to a Blueprint
Arguments
<type> Type of Resource to add (currently only 'function' is supported)
Options
--name, -n <name> Name of the Resource
--fn-type <type> Type of Function to add (e.g. document-publish)
--fn-language, --lang <ts|js> Language of the Function. Default: "ts"
--js, --javascript Shortcut for --fn-language=js
--fn-helpers, --helpers Add helpers to the Function
--no-fn-helpers Do not add helpers to the Function
--fn-installer, Package manager to use for Function helpers
--installer <npm|pnpm|yarn> sets --fn-helpers to true
--install, -i Shortcut for --fn-installer=npm
Examples:
# Add a Function (TypeScript by default)
sanity blueprints add function
# Add a Function with a specific name and install helpers with npm
sanity blueprints add function --name my-function -i
# Add a Function with a specific type
sanity blueprints add function --fn-type document-publish
# Add a JavaScript Function
sanity blueprints add function --js
# Add a Function without helpers
sanity blueprints add function --no-fn-helpers
# Add a document-publish .js Function with helpers and install with npm
sanity blueprints add function -n roboto --fn-type document-publish --js -iusage: npx sanity blueprints config [--edit] [-e] [--test] [-t] [--project-id <id>]
View or edit local Blueprints configuration
Options
--edit, -e Modify the configuration interactively, or directly when combined with ID flags.
--project-id <id> Directly set the Project ID in the configuration. Requires --edit flag
--stack-id <id> Directly set the Stack ID in the configuration. Requires --edit flag
--verbose Output verbose logs
Examples:
# View current configuration
sanity blueprints config
# Edit configuration
sanity blueprints config --edit
# Test configuration
sanity blueprints config --test
# Edit and test configuration
sanity blueprints config -etusage: npx sanity blueprints deploy [--no-wait]
Deploy a Blueprint to create or update a Stack
Options
--no-wait Do not wait for deployment to complete
Examples:
# Deploy the current blueprint
sanity blueprints deploy
# Deploy the current blueprint without waiting for completion
sanity blueprints deploy --no-waitusage: npx sanity blueprints destroy [--force] [-f] [--no-wait]
Destroy a Blueprint deployment
Options
--force, -f Force destroy without confirmation
--no-wait Do not wait for destroy to complete
Examples:
# Destroy the current deployment
sanity blueprints destroy
# Force destroy without confirmation
sanity blueprints destroy --force
# Destroy without waiting for completion
sanity blueprints destroy --no-waitusage: npx sanity blueprints doctor [--verbose]
Check the health of a Blueprint project
Examples:
# Check the health of the current Blueprint project
sanity blueprints doctor --verboseusage: npx sanity blueprints info
Retrieve information about a Blueprint Stack
Examples:
# Retrieve information about the current Stack
sanity blueprints infousage: npx sanity blueprints init [dir] [--blueprint-type <type>] [--project-id <id>]
Initialize a new Blueprint manifest file
Arguments
[dir] Path to initialize the Blueprint in
Options
--blueprint-type, --type <json> Type of Blueprint to create
--project-id <id> Project ID to use
Examples:
# Create a new Blueprint manifest file in the current directory
sanity blueprints init
# Create a new Blueprint manifest file in a specific directory
sanity blueprints init my-sanity-project --type jsonusage: npx sanity blueprints logs [--watch] [-w]
Display logs for the current Blueprint Stack
Options
--watch, -w Watch for new logs (streaming mode)
Examples:
# Show logs for the current Stack
sanity blueprints logs
# Watch for new logs (streaming mode)
sanity blueprints logs --watchusage: npx sanity blueprints plan
Enumerate Resources to be deployed
Safe to run at any time. Will not modify any Resources.
Examples:
# Show deployment plan for the current Blueprint
sanity blueprints plan