vercel env add accepts multiple target environments
Introduced 2026-07-14 · score 0.98
HOW TO USE IT
When creating one Environment Variable entry for multiple targets, pass a comma-separated target list to `vercel env add`. Supply the value through stdin or `--value`; a Git branch is allowed only when Preview is the sole target.
printf '%s' '<value>' | vercel env add API_URL production,preview,developmentWHY THIS HELPS
Create one Environment Variable entry for multiple deployment targets.
BEFORE THIS CHANGE
Run `vercel env add` separately for each target environment to create entries for multiple environments.
REQUIREMENTS AND LIMITATIONS
- Version: 56.2.0
- name (positional) (required): Environment Variable name, such as `API_URL`.
- environment (positional) (required): One target or a comma-separated target list; documented targets include standard targets and custom Environment slugs/ids. Unknown tokens fail locally; slugs normalize to ids.
- value (stdin or `--value`) (required): Variable value; provide through stdin or `--value`.
- --git-branch <name>: Set a branch-specific Preview variable; branch is allowed only when Preview is the sole target.
- Prerequisite: Run in a directory linked to a Vercel project; the documented flow requires an existing project link.
- Prerequisite: Provide the variable value via stdin or `--value` in non-interactive use.
- A Git branch is rejected unless Preview is the only target.
- Docs conflict: The current official CLI env reference documents a single `[environment]` positional and separate commands for multiple targets; it does not document the comma-separated form. The official CLI UX contract on the repository's current main branch does document that form, but the page does not establish that it is at version 56.2.0.
FIRST-PARTY EVIDENCE
- https://github.com/vercel/vercel/releases/tag/vercel%4056.2.0
- https://github.com/vercel/vercel/blob/main/packages/cli/.agents/skills/cli-ux/references/command-contracts.md
- https://github.com/vercel/vercel/blob/main/skills/vercel-cli/references/environment-variables.md
- https://vercel.com/docs/environment-variables/manage-across-environments
Check the installed version and the source before using it. Entry JSON