Vercel is an end-to-end platform for developers, that allows you to create and deploy your web application. Vercel provides the following features to enable you to serve fast and personalized content to your users:
- Deployments
- CI/CD
- Custom domains
- Monitoring your project
The vercel env command is used to manage Environment Variables of a Project, providing functionality to list, add, remove, and export.
vercel env ls [environment]
: Using the vercel env command to list Environment Variables for a specific Environment in a Vercel Project.
Run commands:
Login to vercel
Setup scope and link to the existing project. When seeing Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\System32.vercel':
Solution:
This error occurs because the current working directory of the PC is not in the project. Make sure you clone the project from github locally and cd
to the project before running the command vercel
.
Successfully set up:
Run commands vercel env ls [environment]
, for example, to list all preview environments:
Source
https://github.com/vercel/vercel/pull/9028
https://github.com/vercel/vercel/releases/tag/vercel%4028.9.0
Update the vercel version to the version (or higher) that supports the feature
Pull all environment variables of preview environment on main branch, vercel will create a file .vercel/.env.preview.local and store these variables into the file automatically
Use access token that is set on the vercel account. Create a token with a proper access scope and expired date, and save the token.
Open a terminal that has vercel installed, no need to log in vercel (to make sure the token works, should logout vercel if the current status is login)
Add --token [the vercel access token]
behind the command to give the right permission for the vercel command, for example:
When the current account is a member of a team on vercel, might need to provide the right scope to access the certain resource:
devops
cicd
vercel