> 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).

# Manage stacks

List your Blueprints stacks, see which stack your local blueprint deploys to, and remove stacks you no longer need.

A stack is the deployed form of a blueprint: the live set of resources Sanity runs for it. Use the Blueprints CLI to see which stacks exist, check which stack your local blueprint deploys to, and remove stacks you no longer need. For how blueprint files, stacks, and scope fit together, see [Stacks and scope](https://www.sanity.io/docs/blueprints/stacks-and-scope).

This guide shows how to list stacks, view the current stack, and remove a stack.

## Prerequisites

- Run the commands in this guide from a directory that contains a blueprint configured for the project or organization that owns the stacks. If you haven't set up a blueprint yet, see [Your first Blueprint](https://www.sanity.io/docs/blueprints/your-first-blueprint).
- Log in to the Sanity CLI with `npx sanity@latest login`, using an account that can access the stacks in that project or organization. For details, see [CLI authentication](https://www.sanity.io/docs/apis-and-sdks/cli-authentication).

## List stacks

To see every stack in your blueprint's scope, run the `blueprints stacks` command:

**npm**

```shell
npx sanity@latest blueprints stacks
```

**pnpm**

```shell
pnpm dlx sanity@latest blueprints stacks
```

**yarn**

```shell
yarn dlx sanity@latest blueprints stacks
```

**bun**

```shell
bunx sanity@latest blueprints stacks
```

The output shows each stack's name and ID, and marks the stack your local blueprint uses as current. Stack IDs start with `ST-`.

To list the stacks in a different project or organization, add `--project-id` or `--organization-id`. To list stacks across every project and organization you can access, add `--all`.

To list the stacks in one organization and in each of its projects, add `--include-projects` together with `--organization-id`. These broader listings check a limited number of projects: the first 200 with `--all`, and the first 50 with `--include-projects`. When you have more projects than that, the CLI prints a warning, for example `Found 230 projects, only checked the first 200.`

## View the current stack

Your local blueprint deploys to one stack, recorded in `.sanity/blueprint.config.json`. To see that stack's status, configuration, and deployed resources, run the `blueprints info` command:

**npm**

```shell
npx sanity@latest blueprints info
```

**pnpm**

```shell
pnpm dlx sanity@latest blueprints info
```

**yarn**

```shell
yarn dlx sanity@latest blueprints info
```

**bun**

```shell
bunx sanity@latest blueprints info
```

To inspect a different stack, pass its name or ID with `--stack`.

## Remove a stack

By default, each project or organization can have up to 10 stacks. Removing a stack you no longer use frees a slot for a new one.

> [!WARNING]
> Removing a stack destroys its resources
> `blueprints destroy` permanently removes the stack and destroys the resources it manages, following each resource's deletion policy. Resources with a `retain` policy are kept and detached from the stack, and a resource with a `protect` policy makes the destroy fail. Your blueprint file and resource files stay as they are. For each policy's behavior, see [the lifecycle field](https://www.sanity.io/docs/blueprints/blueprint-config) in the Blueprint configuration reference.

First, find the name or ID of the stack you want to remove:

**npm**

```shell
npx sanity@latest blueprints stacks
```

**pnpm**

```shell
pnpm dlx sanity@latest blueprints stacks
```

**yarn**

```shell
yarn dlx sanity@latest blueprints stacks
```

**bun**

```shell
bunx sanity@latest blueprints stacks
```

Then pass it to the `blueprints destroy` command with `--stack`:

**npm**

```shell
npx sanity@latest blueprints destroy --stack STACK_NAME_OR_ID
```

**pnpm**

```shell
pnpm dlx sanity@latest blueprints destroy --stack STACK_NAME_OR_ID
```

**yarn**

```shell
yarn dlx sanity@latest blueprints destroy --stack STACK_NAME_OR_ID
```

**bun**

```shell
bunx sanity@latest blueprints destroy --stack STACK_NAME_OR_ID
```

Replace `STACK_NAME_OR_ID` with the stack's name or its ID. The CLI asks you to confirm before it destroys anything.

To remove the stack your local blueprint currently uses, run `blueprints destroy` without `--stack`. The CLI then removes that stack's ID from `.sanity/blueprint.config.json`.

In continuous integration (CI) and other non-interactive environments, add `--force` to skip the confirmation prompt. To remove a stack outside your local blueprint's scope, pass `--project-id` or `--organization-id` together with `--stack` and `--force`.

The CLI prints these messages for the most common stack errors:

- `No stack found with name "NAME"`: the `--stack` value doesn't exactly match the name of any stack in the scope. Run `blueprints stacks` to check the name, or pass the stack's ID instead.
- `Stack destruction was accepted but completion could not be confirmed`: the destroy started, but the CLI couldn't confirm that it finished, and it exits with code `75`. Run `blueprints info` to check the stack's status before you retry.
- `Quota exceeded`: the project or organization already has its maximum number of stacks, so a new stack can't be created. Remove a stack you no longer use, then try again.

#### Related

[Stacks and scope](https://www.sanity.io/docs/blueprints/stacks-and-scope)
How one blueprint file maps to many stacks, and what project versus organization scope means.

[Blueprints CLI command reference](https://www.sanity.io/docs/cli-reference/cli-blueprints)
Reference documentation for the Sanity CLI Blueprints command.

[Blueprint configuration reference](https://www.sanity.io/docs/blueprints/blueprint-config)
Reference documentation for the Blueprint configuration files.

