> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Space management with the Contentful CLI

> These commands will help you manage spaces in Contentful | Requirements | List of available commands and their descriptions | Creating and deleting a space

These commands will help you manage spaces in Contentful.

## Requirements

* A (free) [Contentful account](https://www.contentful.com/sign-up/)
* Locally [installed](/tutorials/cli/installation) `contentful-cli`
* [Authenticated](/tutorials/cli/authentication) with `contentful-cli`

## List available commands and their description

```bash
contentful space --help
```

## Create a space

To create a new space, supply the name. The `--organization` option is available for power users.

```bash
contentful space create --name cli-test
# confirm space creation and select the organization you want to create the space for.
```

*The output should look similar to this:*

```bash
Successfully created space cli-test (<space-id>)
```

## Get a list of all available spaces

You can list all of the spaces you have access to. The current active space selected via the
`contentful space use` command is highlighted.

```bash
contentful space list
```

*The output should look similar to this:*

```bash
┌────────────────────────────────┬────────────┐
│ Space name                     │ Space id   │
├────────────────────────────────┼────────────┤
│ cli-test [active]              │ <space-id> │
└────────────────────────────────┴────────────┘
```

## Set a space-id to use it in all subsequent commands

Many commands have a `--space-id` option since they manipulate something related to a space. Since it is unintuitive to pass the space ID every time, you can use the `space use` command to lock your CLI to a specific Space. Until you use another space or pass a different `--space-id` to a subsequent command, this space will be your default.

```bash
contentful space use --space-id <spaceId>
```

*The output should look similar to this:*

```bash
Now using the 'master' Environment of Space cli-test (<space-id>) when the `--environment-id` option is missing.
```

## Delete a space in your current account

Delete a space.

```bash
contentful space delete --space-id <space-id>
# Confirm the space deletion
```

*The output should look similar to this:*

```bash
Your cli-test (<space-id>) space was successfully deleted.
```

## Next steps

* [Manage environments with the Contentful CLI](/tutorials/cli/environment-management/)
* [Manage extensions with the Contentful CLI](/tutorials/cli/extension-management)
* [Check out the documentation in the GitHub repository](https://github.com/contentful/contentful-cli/tree/master/docs/space)