env-vars

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

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill env-vars-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-vars
Source: https://github.com/AarnavBaddam/skills/tree/main/env-vars
Command: npx skills add https://github.com/AarnavBaddam/skills --skill env-vars-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing environment variables across Vercel projects is error-prone: secrets get committed to git, vercel env pull silently overwrites custom variables, local OIDC tokens expire mid-session, and standalone scripts fail because they don't auto-load .env.local. This Skill provides expert guidance to avoid these pitfalls. ## Core Features & Use Cases - .env File Hierarchy Guidance: Explains Next.js load order, which files are git-tracked, and where secrets belong. - vercel env CLI Workflows: Covers pull, add, ls, and rm commands, including bootstrap flows for fresh clones and re-pulling after secret changes. - OIDC Token Lifecycle: Explains how VERCEL_OIDC_TOKEN works on Vercel versus locally, and how to troubleshoot expiry and auth errors. - Use Case: You clone a project on a new machine and need it running fast. Follow the bootstrap sequence: vercel link, vercel env pull .env.local --yes, then verify all keys from .env.example exist. ## Quick Start Ask the assistant to pull the Vercel environment variables for your 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 load order of .env files 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.

Why does vercel env pull delete my custom variables?

The `vercel env pull` command replaces the entire target file, removing any manually added variables. Keep custom variables in `.env.development.local`, which Next.js loads after `.env.local`, or back them up before pulling.

Why do I get OIDC auth errors after hours of local development?

The local `VERCEL_OIDC_TOKEN` provisioned by `vercel env pull` expires after roughly 12 hours. Re-run `vercel env pull .env.local --yes` to get a fresh token, ideally at the start of each dev session.

Can I use environment variables in standalone Node scripts?

Only Next.js auto-loads `.env.local`; standalone scripts like drizzle-kit or tsx need explicit loading. Use dotenv-cli (`npx dotenv -e .env.local -- npx tsx script.ts`) or source the file manually before running.

Should secrets go in NEXT_PUBLIC_ environment variables?

No. Variables prefixed with `NEXT_PUBLIC_` are bundled into the browser and publicly visible, so never put secrets in them. Keep secrets in server-only variables set via the Vercel Dashboard or `vercel env add`.