Environment management with the Contentful CLI
These commands will help you manage environments in Contentful.
Requirements
- A (free) Contentful account
- Locally installed
contentful-cli - Authenticated with
contentful-cli
List available commands and their description
Create a new environment
This is how you create a new environment within a Space. You have to supply an ID for the environment.
The output should look similar to this:
Clone an existing environment
You have to supply the ID of the source environment that will be copied to create the new environment. The default is “master”.
The output should look similar to this:
Get a list of all available environments
Lists all available environments from a Space.
The output should look similar to this:
Set an environment-id to use in all subsequent commands
Many commands have an --environment-id option since they can be scoped to a specific environment. Since it is unintuitive to pass the environment ID every time, you can use the environment use command to lock the CLI to a specific environment. It will be used until you use another environment or pass a different --environment-id to a subsequent command. If you specify a different --space-id, rather than using the already active space (see space use) then the current environment will be ignored and 'master' will be used instead.
The output should look similar to this:
Delete an environment in your current space
You have to supply an ID for the environment.
The output should look similar to this: