Skip to main content

envshed link

Link a secret to the same key in another project's environment. Linked secrets propagate automatically when you push.

Usage

envshed link <key> --to-project <slug> --to-env <slug>

Arguments

ArgumentDescription
keyThe secret key to link (e.g., DATABASE_URL)

Options

FlagDescriptionRequired
--to-project <slug>Target project slugYes
--to-env <slug>Target environment slugYes

Examples

# Link DATABASE_URL to the api project's development env
envshed link DATABASE_URL --to-project api --to-env development

# From a workspace directory
envshed --workspace apps/web link SHARED_KEY --to-project api --to-env staging

How linking works

When you link a secret:

  1. Both secrets (source and target) join a link group
  2. When you push and a linked secret has changed, the new value is propagated to all other members of the link group
  3. If the other side also changed independently, a conflict is detected and you're prompted to resolve it (see push)

A secret can only belong to one link group at a time. Link groups can have more than two members (e.g., the same DATABASE_URL linked across three projects).

Monorepo behavior

  • Inside a workspace directory or with -w: uses that workspace's project context
  • At the monorepo root (without --all): uses the root project context
  • Bulk mode (--all): not supported — use -w to target a specific workspace

Requires authentication and update Secret permission on the source project.