Reference
CLI cheat sheet
The commands this course uses, and a few you will want next. Run them from the linked project folder.
Every command and flag here was checked against --help in Vercel CLI 62.1.0 on 2 Oct 2026. Full reference: vercel.com/docs/cli.
Set up
| Command | What it does |
|---|---|
npm i -g vercel | Install the CLI. |
vercel login | Sign in through the browser. |
vercel whoami | Print the logged-in username. |
vercel link | Tie this folder to a project. Writes .vercel/. |
vercel git connect | Connect the project to this folder's Git remote. |
Environment variables
Environments are production, preview and development. ls and rm are short for list and remove.
| Command | What it does |
|---|---|
vercel env ls | List every variable and its environments. Secret values are not shown. |
vercel env ls production | List one environment. |
vercel env add NAME production | Add a variable; prompts for the value. Stored as a Secret in production and preview by default. |
vercel env add NAME development | Add the laptop value. Must be its own command. |
vercel env add NAME production --no-sensitive | Add a readable Config value instead of a Secret. |
vercel env add NAME production --value "x" --yes | Non-interactive. Lands in shell history: non-secrets only. |
vercel env add NAME preview --git-branch feat1 | Value for one preview branch only; overrides the general preview value. |
vercel env update NAME production | Replace a value; prompts for the new one. |
vercel env rm NAME production | Remove from one environment. |
vercel env pull | Write Development values to .env.local, merging with what is there. |
vercel env pull --environment=preview | Pull another environment's values. Secrets come back as placeholders. |
vercel env run -- npm run dev | Run a command with Development values, without writing a file. |
Deploy and inspect
With Git connected you rarely deploy by hand: pushing does it. These are for the times you need to.
| Command | What it does |
|---|---|
vercel | Deploy this folder as a Preview. (First deploy of a new project is Production.) |
vercel --prod | Deploy this folder to Production. |
vercel deploy --logs | Deploy and print the build log. |
vercel redeploy <url> | Rebuild and deploy an existing deployment, picking up current variables. |
vercel inspect <url> --logs | Show a deployment's build log. |
vercel logs --environment production --level error --since 5m | Recent production errors. Hobby keeps one hour of runtime logs. |
vercel logs --follow | Stream live runtime logs. |
Storage
| Command | What it does |
|---|---|
vercel install neon | Provision Neon Postgres, connect it to the project, inject variables, pull them. |
vercel install neon --help | Show that integration's products, plans and options. |
vercel install neon -e production -e preview | Connect only the named environments. |
The Git commands the course pairs with them
| Command | Effect on Vercel |
|---|---|
git push on main | New Production deployment. |
git push -u origin my-branch | New Preview deployment for that branch. |
git commit --allow-empty -m "Redeploy" then push | A fresh deployment with no code change; another way to pick up new variables. |