# Preserve local environment variables when linking with the Vercel CLI

By Steven Van · 2026-06-23

Vercel CLI's \`vercel link\` now updates only \`VERCEL\_OIDC\_TOKEN\` in \`.env.local\` instead of overwriting the whole file.

The Vercel CLI no longer overwrites .env.local when running vercel link. Previously, linking could clobber variables already in the file; now it only updates VERCEL\_OIDC\_TOKEN if present, or appends it if missing, and leaves everything else untouched. Run pnpm i -g vercel@latest to update, then run [vercel link](<https://vercel.com/docs/cli/link>) as usual.

[![](<https://vercel.com/api/docs-og?title=vercel%20link&format=docs&sig=a854f35d5fa8508a447f7d7af895aeba619f01fc6ff32d201dc2f84a46a97734&category=Ship%20and%20scale&subcategory=CLI>)](<https://vercel.com/docs/cli/link>)

![Vercel](<https://www.google.com/s2/favicons?domain=vercel.com&sz=128>)

Vercel

The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.

[View Vercel →](<https://creatorstoolbox.com/tools/vercel>)

Sources

[Original source](<https://vercel.com/docs/cli/link>)

[Read Preserve local environment variables when linking with the Vercel CLI on Creators Toolbox](<https://creatorstoolbox.com/blog/vercel-preserve-local-environment-variables-when-linking-with-the-vercel-cli>)

---
Canonical source: https://creatorstoolbox.com/blog/vercel-preserve-local-environment-variables-when-linking-with-the-vercel-cli
