# Preserve local environment variables when linking with the Vercel CLI

DevFeed: [Preserve local environment variables when linking with the Vercel CLI](<https://devfeed.tech/articles/preserve-local-environment-variables-when-linking-with-the-vercel-cli-1044.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/preserve-local-environment-variables-when-linking-with-the-vercel-cli>)

Author: Melkey Moksyakov

Published: 2026-06-23T00:00:00Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>), [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>)

Tags: [cli](<https://devfeed.tech/tags/cli.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [update](<https://devfeed.tech/tags/update.md>), [vercel](<https://devfeed.tech/tags/vercel.md>)

## AI overview

The Vercel CLI now preserves existing variables in .env.local when running vercel link. It updates VERCEL_OIDC_TOKEN when present or appends it when missing, without modifying other content.

## Source excerpt

The Vercel CLI now preserves your .env.local file when running vercel link. Previously, linking could overwrite variables already in the file. The CLI now updates VERCEL_OIDC_TOKEN if it exists, or appends it if missing, without touching anything else. Run pnpm i -g vercel@latest to update, then run vercel link to get started. Learn more in the vercel link documentation. Read more