env-vars

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

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

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 Vercel environment variable workflow. ## Core Features & Use Cases - .env File Hierarchy Guidance: Explains the Next.js load order (.env, .env.[environment], .env.local) and which files are safe to commit versus gitignored. - vercel env CLI Operations: Covers pulling, adding, listing, and removing variables with environment scoping, sensitive flags, and Git branch overrides. - OIDC Token Lifecycle: Documents how VERCEL_OIDC_TOKEN works on deployments versus locally, and how to troubleshoot expiry after ~12 hours. - 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 the Vercel environment variables for this project 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` after linking your project with `vercel link`. Add `--environment=production` or `--environment=preview` to target a specific environment, and `--yes` to overwrite without prompting.

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

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.

Why does my Vercel OIDC token stop working locally?

The `VERCEL_OIDC_TOKEN` pulled via `vercel env pull` is valid for roughly 12 hours. When it expires, re-run `vercel env pull .env.local --yes` to get a fresh token, ideally at the start of each dev session.

Does vercel env pull overwrite my custom variables?

Yes, `vercel env pull` replaces the entire target file, deleting manually added variables. Back up custom vars before pulling, or keep them in `.env.development.local`, which Next.js loads after `.env.local`.

Can I put secrets in NEXT_PUBLIC_ environment variables?

No. Variables prefixed with `NEXT_PUBLIC_` are embedded in the browser bundle and publicly visible. Keep secrets in server-only variables and store them via the Vercel Dashboard or `vercel env add`.

Why don't standalone scripts load .env.local automatically?

Only Next.js auto-loads `.env.local`; tools like drizzle-kit or tsx do not. Use dotenv-cli (`npx dotenv -e .env.local -- <command>`) or export the variables manually before running the script.