Back to Graphql Platform

environment Command

website/src/docs/nitro/cli/environment.md

16.1.0-p.1.122.4 KB
Original Source

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 create

Create a new environment in a workspace.

shell
nitro environment create --name "<name>"

Options

OptionEnvDescription
-n, --name <name>Display name of the environment (for example dev, staging, production). Required.
--workspace-id <workspace-id>NITRO_WORKSPACE_IDID 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.

Examples

Create an environment in the current workspace:

shell
nitro environment create --name "<name>"

Create an environment in a specific workspace:

shell
nitro environment create \
  --name "<name>" \
  --workspace-id "<workspace-id>"

nitro environment list

List all environments in a workspace. Results are paginated, use the returned cursor to fetch the next page.

shell
nitro environment list

Options

OptionEnvDescription
--workspace-id <workspace-id>NITRO_WORKSPACE_IDID of the workspace. Falls back to the workspace from the current session.
--cursor <cursor>NITRO_CURSORPagination cursor to resume from. Useful for non-interactive paging.

nitro environment show

Show the details of an environment by its ID.

shell
nitro environment show "<environment-id>"

Arguments

ArgumentDescription
<id>ID of the environment to show. Required.