vercel env
Learn how to manage your environment variables in your projects from the command line.The vercel env command is used to manage Environment Variables under a Project, providing functionality to list, add, remove, and pull.
vercel env ls
Using the vercel env command to list all Environment Variables in a Project.
vercel env add
Using the vercel env command to add an Environment Variable to a Project.
vercel env rm
Using the vercel env command to remove an Environment Variable from a Project.
vercel env ls [environment]
Using the vercel env command to list Environment Variables for a specific Environment in a Project.
vercel env ls [environment] [gitbranch]
Using the vercel env command to list Environment Variables for a specific Environment and Git branch.
vercel env add [name]
Using the vercel env command to add an Environment Variable to all Environments to a Project.
vercel env add [name] [environment]
Using the vercel env command to add an Environment Variable for a specific Environment to a Project.
vercel env add [name] [environment] < [file]
Using the vercel env command to add an Environment Variable to a Project using a local file's content as the value.
echo [value] | vercel env add [name] [environment]
Using the echo command to generate the value of the Environment Variable and piping that value into the vercel dev command. Warning: this will save the value in bash history, so this is not recommend for secrets.
vercel env add [name] [environment] [gitbranch] < [file]
Using the vercel env command to add an Environment Variable with Git branch to a Project using a local file's content as the value.
vercel env rm [name] [environment]
Using the vercel env command to remove an Environment Variable from a Project.
vercel env pull [file]
Using the vercel env command to download Development Environment Variables from the cloud and write to a specific file. This can be useful for local development with frameworks that have local development servers for server-side functions, such as next dev or gatsby dev.
The following global options can be passed when using the vercel env command:
--cwd--debug--global-config--help--local-config--token
For more information on global options and their usage, refer to the options section.
These are options that only apply to the vercel env command.
The --yes option can be used to bypass the confirmation prompt when overwriting an environment file or removing an environment variable.
vercel env pull --yes
Using the vercel env pull command with the --yes option to overwrite an existing environment file.
vercel env rm [name] --yes
Using the vercel env rm command with the --yes option to skip the remove confirmation.