Command line interface

Build, deploy, init plugin boilerplate and wrangle datasets and webhooks, all from the command line

> sanity

The Sanity CLI tool can be installed through npm: npm install -g @sanity/cli. Once installed, you can bootstrap a new project using sanity init.

usage: sanity [-v|--version] [-d|--debug] [-h|--help] <command> [<args>]

   build           Builds the current Sanity configuration to a static bundle
   check           Performs a Sanity check
   configcheck     Checks if the required configuration files for plugins exists and are up to date
   cors            Interact with CORS-entries for your project
   dataset         Interact with datasets in your project
   debug           Gathers information on Sanity environment
   deploy          Deploys a statically built Sanity studio
   docs            Opens the Sanity documentation
   documents       Interact with documents in your project
   exec            Runs a script in Sanity context
   graphql deploy  Deploy a GraphQL API from the current Sanity schema
   help            Displays help information about Sanity
   hook            Interact with hooks in your project
   init            Initialize a new Sanity project or plugin
   install         Installs a Sanity plugin to the current Sanity configuration
   login           Authenticates against the API
   logout          Logs out of the session
   manage          Opens the Sanity project management UI
   start           Starts a webserver that serves Sanity
   undeploy        Removes the deployed studio from <hostname>
   uninstall       Removes a Sanity plugin from the current Sanity configuration
   upgrade         Upgrades all (or some) Sanity modules to their latest versions
   versions        Shows the installed versions of Sanity CLI and core components

See 'sanity help <command>' for specific information on a subcommand.


Some of the commands listed above only applies when the sanity command are being run from a Sanity project folder. If sanity help is missing any of these commands, make sure your current working directory is the root of your Sanity project.