env-vars

Manages Vercel environment variables, .env files, and OIDC token lifecycle.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/sharad07072007/paras --skill env-vars-sharad07072007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-vars
Source: https://github.com/sharad07072007/paras/tree/main/.agents/plugins/vercel/skills/env-vars
Command: npx skills add https://github.com/sharad07072007/paras --skill env-vars-sharad07072007

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing environment variables across Vercel deployments and local development is error-prone: secrets get committed to git, vercel env pull silently overwrites custom variables, and local OIDC tokens expire mid-session causing confusing auth failures. This Skill provides expert guidance on the full environment variable lifecycle. ## Core Features & Use Cases - .env File Hierarchy: Explains Next.js load order across .env, .env.local, and environment-specific variants, including which files are git-tracked and where secrets belong. - vercel env CLI Operations: Covers pulling, adding, listing, and removing variables with environment scoping, sensitive flags, and Git branch overrides. - OIDC Token Management: Documents how VERCEL_OIDC_TOKEN works on Vercel versus locally, and how to recover from token expiry. - Use Case: After cloning a project on a new machine, run vercel link followed by vercel env pull .env.local --yes, then verify all keys from .env.example exist before starting development. ## Quick Start Pull my Vercel project's environment variables into .env.local and verify that every key listed in .env.example is present.

Frequently Asked Questions about env-vars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pull Vercel environment variables to my local machine?

Run `vercel env pull .env.local --yes` after linking your project with `vercel link`. This writes all variables for the development environment into `.env.local`, including a `VERCEL_OIDC_TOKEN` valid for about 12 hours.

What is the Next.js .env file load order?

Next.js loads `.env` first, then `.env.[environment]`, then `.env.local` (skipped in test), and finally `.env.[environment].local` with highest priority. Later files override earlier ones, and `.local` variants are gitignored for secrets.

Why does vercel env pull delete my custom variables?

`vercel env pull` replaces the entire target file, so manually added variables are lost. Back up custom vars before pulling and re-append them, or keep them in `.env.development.local` which Next.js loads after `.env.local`.

Why do I get OIDC auth errors in local development?

Local `VERCEL_OIDC_TOKEN` expires after roughly 12 hours, causing authentication failures with services like AI Gateway. Re-run `vercel env pull .env.local --yes` to provision a fresh token, ideally at the start of each dev session.

Can I scope Vercel environment variables to a specific Git branch?

Yes, preview environment variables can be scoped to specific branches using the `--git-branch` flag, for example `echo "value" | vercel env add DATABASE_URL preview --git-branch=staging`. Variables can also be scoped to production, preview, or development environments.