Skip to main content

envshed env

Manage environments in a project. The env command groups all environment lifecycle operations into a single namespace.

Note: envshed env <slug> (checkout shorthand) continues to work for backward compatibility.

Subcommands

SubcommandDescription
env listList all environments in a project
env createCreate a new environment
env updateUpdate an environment's name or description
env deleteDelete an environment
env duplicateDuplicate an environment with all its secrets
env checkoutSwitch the active environment (alias: envshed env <slug>)

envshed env list

List all environments in a project.

envshed env list [options]
OptionDescriptionRequired
-o, --org <slug>Organization slugYes (or via config)
-p, --project <slug>Project slugYes (or via config)
--output <format>Output format: jsonNo

Example:

$ envshed env list
Name Slug Description
─────────────────────────────────────────────
Development development
Staging staging
Production production

envshed env create

Create a new environment in a project.

envshed env create --name <name> [options]
OptionDescriptionRequired
-n, --name <name>Environment nameYes
-d, --description <text>Environment descriptionNo
-o, --org <slug>Organization slugYes (or via config)
-p, --project <slug>Project slugYes (or via config)
--output <format>Output format: jsonNo

Example:

$ envshed env create --name staging
✓ Environment 'staging' created (slug: staging)

JSON output:

$ envshed env create --name staging --output json
{
"environment": {
"name": "staging",
"slug": "staging"
}
}

envshed env update

Update an environment's name or description. If the name changes, the slug is automatically derived from the new name and .envshed.json is updated if the environment was your defaultEnv.

envshed env update <slug> [options]
OptionDescriptionRequired
<slug>Environment slug to updateYes
-n, --name <name>New environment nameNo (at least one of --name or --description)
-d, --description <text>New descriptionNo (at least one of --name or --description)
-o, --org <slug>Organization slugYes (or via config)
-p, --project <slug>Project slugYes (or via config)
--output <format>Output format: jsonNo

Example:

$ envshed env update staging --name "Staging v2"
✓ Environment 'Staging v2' updated (slug: staging-v-2)

Note: If the environment being updated is your defaultEnv in .envshed.json and its slug changes, the CLI automatically updates .envshed.json to use the new slug.


envshed env delete

Delete an environment permanently. This action is irreversible.

envshed env delete <slug> [options]
OptionDescriptionRequired
<slug>Environment slug to deleteYes
-o, --org <slug>Organization slugYes (or via config)
-p, --project <slug>Project slugYes (or via config)
-y, --yesSkip confirmation promptNo
--output <format>Output format: jsonNo

Example (with confirmation):

$ envshed env delete staging
? Are you sure you want to delete environment 'staging'? This cannot be undone. (y/N) y
✓ Environment 'staging' deleted

Skip confirmation:

$ envshed env delete staging --yes
✓ Environment 'staging' deleted

Warning: Deleting an environment permanently removes all its secrets and audit logs. This cannot be undone.


envshed env duplicate

Duplicate an environment, copying all its secrets into a new environment with the given name.

envshed env duplicate <source-slug> --name <new-name> [options]
OptionDescriptionRequired
<source-slug>Source environment slugYes
-n, --name <name>Name for the new environmentYes
-o, --org <slug>Organization slugYes (or via config)
-p, --project <slug>Project slugYes (or via config)
--output <format>Output format: jsonNo

Example:

$ envshed env duplicate staging --name staging-copy
✓ Environment 'staging-copy' duplicated (slug: staging-copy)

JSON output:

$ envshed env duplicate staging --name staging-copy --output json
{
"environment": {
"name": "staging-copy",
"slug": "staging-copy"
}
}

Note: The server verifies you have read access to the source environment before creating the copy.


envshed env checkout

Switch the active environment. Updates defaultEnv in .envshed.json.

envshed env checkout <slug>
envshed env <slug>
ArgumentDescription
slugEnvironment slug to switch to

Example:

$ envshed env checkout staging
Switched environment: development → staging

$ envshed env production
Switched environment: staging → production

The CLI verifies the environment exists before switching. If not found, you are prompted to create it.

Monorepo behavior

In a monorepo with workspaces configured:

  • Inside a workspace directory: switches only that workspace's defaultEnv
  • At the monorepo root: switches all workspaces to the given environment
  • With --workspace <path>: switches only the specified workspace