CLI reference

Docs

Opens the Sanity documentation

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

Commands:
   browse  Open Sanity docs in a web browser
   read    Read an article in terminal
   search  Search Sanity docs

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

Commands

browse

usage: npx sanity docs browse 

   Open Sanity docs in a web browser

read

usage: npx sanity docs read <path|url> [-w, --web]

   Read an article in terminal

Arguments
  <path> Path or URL to article, found in search results and docs content as links

Options
  -w, --web               Open in a web browser

Examples
  # Read as markdown in terminal
  sanity docs read /docs/studio/installation
  sanity docs read https://www.sanity.io/docs/studio/installation

  # Open in web browser
  sanity docs read /docs/studio/installation --web
  sanity docs read https://www.sanity.io/docs/studio/installation -w

search

usage: npx sanity docs search <query> [--limit <limit>]

   Search Sanity docs

Arguments
  <query> Search query for documentation

Options
  --limit <limit>   Maximum number of results to return [default: 10]

Examples
  # Search for documentation about schemas
  sanity docs search schema

  # Search with phrase
  sanity docs search "groq functions"

  # Limit search results
  sanity docs search "deployment" --limit=5

Was this page helpful?