envshed rename-env
Rename an environment, changing its display name and/or slug (key).
Usage
envshed rename-env <slug> [options]
Arguments
| Argument | Description |
|---|---|
slug | Current environment slug |
Options
| Flag | Description | Default |
|---|---|---|
-n, --name <name> | New display name | Unchanged |
-s, --slug <slug> | New slug (key) | Auto-generated from name |
-o, --org <slug> | Organization slug | From config |
-p, --project <slug> | Project slug | From config |
At least one of --name or --slug must be provided.
Examples
# Rename display name (slug auto-updates)
$ envshed rename-env staging --name "Staging v2"
Renamed environment: staging → staging-v2 (Staging v2)
# Change only the slug
$ envshed rename-env staging --slug pre-prod
Renamed environment: staging → pre-prod (Staging)
# Change both name and slug
$ envshed rename-env dev --name "Development" --slug development
Renamed environment: dev → development (Development)
Notes
- If only
--nameis provided, the slug is automatically generated from the new name. - If
--slugis provided, that exact slug is used regardless of the name. - Environments are workspace-wide: the rename is applied to every project in the organization that uses the same slug, and the new slug must be unique across the workspace.
- When other projects share the slug, the rename requires an organization owner or admin, because it changes those projects too. Project admins and editors can rename environments that exist only in their own project.
- Existing secrets, service tokens, and access rules are preserved (they reference the environment by ID, not slug).
- After renaming, update any
.envshed.jsonfiles that reference the old slug indefaultEnv.