website-next/content/docs/nitro/cli/environment.md
The nitro environment commands manage environments. An environment is a workspace-level grouping that holds a list of variables that can be reused across documents in the Nitro UI.
All environment commands require authentication. Run nitro login first or pass --api-key (see Global Options).
nitro environment createCreate a new environment in a workspace.
nitro environment create --name "<name>"
| Option | Env | Description |
|---|---|---|
-n, --name <name> | Display name of the environment (for example dev, staging, production). Required. | |
--workspace-id <workspace-id> | NITRO_WORKSPACE_ID | ID of the workspace to create the environment in. Falls back to the workspace from the current session. |
When run interactively without --name, the CLI prompts for it.
Create an environment in the current workspace:
nitro environment create --name "<name>"
Create an environment in a specific workspace:
nitro environment create \
--name "<name>" \
--workspace-id "<workspace-id>"
nitro environment listList all environments in a workspace. Results are paginated, use the returned cursor to fetch the next page.
nitro environment list
| Option | Env | Description |
|---|---|---|
--workspace-id <workspace-id> | NITRO_WORKSPACE_ID | ID of the workspace. Falls back to the workspace from the current session. |
--cursor <cursor> | NITRO_CURSOR | Pagination cursor to resume from. Useful for non-interactive paging. |
nitro environment showShow the details of an environment by its ID.
nitro environment show "<environment-id>"
| Argument | Description |
|---|---|
<id> | ID of the environment to show. Required. |