Skip to main content

envshed rename-env

Rename an environment, changing its display name and/or slug (key).

Usage​

envshed rename-env <slug> [options]

Arguments​

ArgumentDescription
slugCurrent environment slug

Options​

FlagDescriptionDefault
-n, --name <name>New display nameUnchanged
-s, --slug <slug>New slug (key)Auto-generated from name
-o, --org <slug>Organization slugFrom config
-p, --project <slug>Project slugFrom 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 --name is provided, the slug is automatically generated from the new name.
  • If --slug is 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.json files that reference the old slug in defaultEnv.