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
| Argument | Description |
|---|---|
key | The secret key to link (e.g., DATABASE_URL) |
Options
| Flag | Description | Required |
|---|---|---|
--to-project <slug> | Target project slug | Yes |
--to-env <slug> | Target environment slug | Yes |
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:
- Both secrets (source and target) join a link group
- When you
pushand a linked secret has changed, the new value is propagated to all other members of the link group - 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-wto target a specific workspace
Requires authentication and update Secret permission on the source project.