# Deploy CLI command reference



**CLI output**

```sh
USAGE
  $ sanity deploy [SOURCEDIR] [--yes] [--auto-updates] [--build] [--external] [--minify] [--schema-required] [--source-maps] [--url <value>] [--verbose]

ARGUMENTS
  [SOURCEDIR]  Source directory

FLAGS
  -y, --yes              Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
      --auto-updates     Automatically update the studio to the latest version
      --build            Build the studio before deploying (use --no-build to deploy existing `dist/` output)
      --external         Register an externally hosted studio
      --minify           Minify built JavaScript (use --no-minify to skip for faster builds)
      --schema-required  Fail if schema deployment fails
      --source-maps      Enable source maps for built bundles (increases size of bundle)
      --url=<value>      Studio URL for deployment. For external studios, the full URL. For hosted studios, the hostname (e.g. "my-studio" or "my-studio.sanity.studio")
      --verbose          Enable verbose logging

DESCRIPTION
  Builds and deploys Sanity Studio or application to Sanity hosting

EXAMPLES
  Build and deploy the studio to Sanity hosting

    $ sanity deploy

  Deploys non-minified build with source maps

    $ sanity deploy --no-minify --source-maps

  Fail fast on schema store fails - for when other services rely on the stored schema

    $ sanity deploy --schema-required

  Register an externally hosted studio (studioHost contains full URL)

    $ sanity deploy --external
```

## What --no-build skips

By default, sanity deploy builds the Studio through Vite, extracts your schema and manifest, packages everything, and uploads it to Sanity hosting. Passing --no-build skips the build step but still runs schema extraction and upload. The dist/ directory must already exist. To make schema extraction fail instead of warn, pass --schema-required.



## Related changelog entries

Entries are listed newest first. Follow a link (or append `.md` to its URL for a plain-markdown response) when you need to know what changed, when, or why — for example, to summarize recent updates, explain behavior that differs from older documentation, or check whether a fix has shipped.

- [Incoming references view, automatic type generation, external studio support + improvements and bugfixes](https://www.sanity.io/docs/changelog/studio-NS43LjA) — *v5.8.0* — February 3, 2026
- [Auto-Updates Now Enabled by Default for Newly Initialized Studios](https://www.sanity.io/docs/changelog/44e212f7-bcad-41e6-b0cd-ab130519819c) — *v3.57.3* — September 12, 2024