> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# Debug CLI command reference

Gathers information about your local Sanity environment.

**CLI output**

```sh
USAGE
  $ sanity debug [--secrets] [--verbose]

FLAGS
      --secrets  Include API keys in output
      --verbose  Show full error details including stack traces

DESCRIPTION
  Print diagnostic info for troubleshooting

EXAMPLES
    $ sanity debug

    $ sanity debug --secrets
```



## Related changelog entries

Entries are listed newest first; each link points to the full entry as markdown. Follow one 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.

- [Sanity Studio v5.18.0: Fixes Next.js session management and multiple bugfixes and improvements](https://www.sanity.io/docs/changelog/studio-NS4xNy4x.md) — March 24, 2026