/env-vars
Vercel environment variable expert guidance. Use when working with .env files, vercel env commands, Secret or Config variable types, OIDC tokens, or managing environment-specific configuration.
Claude Code
$ npx -y skills add vercel/vercel-plugin --skill env-vars --agent claude-code
Codex
$ npx skills add vercel/vercel-plugin --skill env-vars -a codex -y
Cursor
$ npx skills add vercel/vercel-plugin --skill env-vars -a cursor -y
Gemini CLI
$ npx skills add vercel/vercel-plugin --skill env-vars -a gemini-cli -y
GitHub Copilot
$ npx skills add vercel/vercel-plugin --skill env-vars -a github-copilot -y
OpenCode
$ npx skills add vercel/vercel-plugin --skill env-vars -a opencode -y
Windsurf
$ npx skills add vercel/vercel-plugin --skill env-vars -a windsurf -y
SKILL.md
env-vars.SKILL.mdname: env-vars
description: Vercel environment variable expert guidance. Use when working with .env files, vercel env commands, Secret or Config variable types, OIDC tokens, or managing environment-specific configuration.
metadata:
priority: 7
docs:
- "https://vercel.com/docs/environment-variables"
- "https://vercel.com/docs/environment-variables/sensitive-environment-variables"
sitemap: "https://vercel.com/sitemap.xml"
pathPatterns:
- '.env'
- '.env.*'
- '.env.local'
- '.env.production'
- '.env.development'
- '.env.test'
- '.env.production.local'
- '.env.development.local'
- '.env.test.local'
- '.env.example'
bashPatterns:
- '\bvercel\s+env\s+pull\b'
- '\bvercel\s+env\s+add\b'
- '\bvercel\s+env\s+rm\b'
- '\bvercel\s+env\s+ls\b'
- '\bvercel\s+env\s+update\b'
- '\bvercel\s+env\s+run\b'
chainTo:
-
pattern: '\b(OPENAI_API_KEY|ANTHROPIC_API_KEY|GOOGLE_API_KEY)\b'
targetSkill: ai-gateway
message: 'Direct provider API key detected — loading AI Gateway guidance for OIDC auth (no manual keys needed on Vercel).'
retrieval:
aliases:
- environment variables
- env file
- secrets
- config vars
- secret env var
- sensitive env var
intents:
- set env var
- manage secrets
- pull env vars
- configure environment
entities:
- .env
- vercel env
- OIDC
- environment variableVercel Environment Variables
You are an expert in Vercel environment variable management — `.env` file conventions, the `vercel env` CLI, OIDC token lifecycle, and environment-specific configuration.
.env File Hierarchy
Vercel and Next.js load environment variables in a specific order. Later files override earlier ones:
| File | Purpose | Git-tracked? | |------|---------|-------------| | `.env` | Default values for all environments | Yes | | `.env.local` | Local overrides and secrets | **No** (gitignored) | | `.env.development` | Development-specific defaults | Yes | | `.env.development.local` | Local dev overrides | **No** | | `.env.production` | Production-specific defaults | Yes | | `.env.production.local` | Local prod overrides | **No** | | `.env.test` | Test-specific defaults | Yes | | `.env.test.local` | Local test overrides | **No** |
Load Order (Next.js)
1. `.env` (lowest priority) 2. `.env.[environment]` (development, production, or test) 3. `.env.local` (skipped in test environment) 4. `.env.[environment].local` (highest priority)
Critical Rules
- **Never commit secrets** to `.env`, `.env.development`, or `.env.production` — use `.local` variants or Vercel environment variables
- `.env.local` is always gitignored by Next.js — this is where `vercel env pull` writes secrets
- Variables prefixed with `NEXT_PUBLIC_` are exposed to the browser bundle — never put secrets in `NEXT_PUBLIC_` vars
- All other variables are server-only (API routes, Server Components, middleware)
vercel env CLI
Pull Environment Variables
# Pull all env vars for the current environment into .env.local
vercel env pull .env.local
# Pull for a specific environment
vercel env pull .env.local --environment=production
vercel env pull .env.local --environment=preview
vercel env pull .env.local --environment=development
# Overwrite existing file without prompting
vercel env pull .env.local --yes
# Pull to a custom file
vercel env pull .env.production.local --environment=production
Add Environment Variables
Every variable has a type:
| Type | After saving | Use for | |------|--------------|---------| | **Secret** | Hidden in the dashboard and `vercel env ls`; can be replaced, never read back. Production and Preview Secrets are not returned by `vercel env pull`. | Passwords, API keys, tokens, database URLs | | **Config** | Readable by members with access | Non-sensitive values you need to read later |
Deployments receive both types at build time and runtime. Secret and Config replaced the Sensitive toggle; existing Sensitive variables are Secrets.
# Interactive — prompts for value, environments, and type
vercel env add MY_SECRET
# Non-interactive: read the value from a file so it never lands in shell
# history or process arguments (echo "value" | ... and --value do both)
vercel env add MY_SECRET production < ./secret.txt
# Add to production and preview in one command
vercel env add MY_SECRET production,preview < ./secret.txt
# Set the type explicitly
vercel env add MY_SECRET production --type secret < ./secret.txt
vercel env add SITE_REGION production --type config < ./region.txt
# Add development in its own command; development-only adds default to Config
vercel env add MY_SECRET development < ./dev-secret.txt
# Update an existing value
vercel env update MY_SECRET production < ./secret.txt
- **Defaults**: a non-interactive add to production, preview, or a custom environment is stored as Secret.
- **Public prefixes are always Config**: variables such as `NEXT_PUBLIC_*` or `VITE_*` are exposed to browsers, so the CLI refuses `--type secret` for them. Keep a private value under a name without the prefix.
- **Flags**: `--type config|secret` needs Vercel CLI 59.6 or later. Older CLIs use `--visibility`, now a deprecated alias of `--type`. `--sensitive` (Secret) and `--no-sensitive` (Config) still work in every version.
- **Team policy**: **Separate Production Secret Values** requires a Production Secret to differ from the Preview, Development, and custom environment values of the same key. Under it, create separate Production and non-Production values instead of adding one value to all targets. It replaces the deprecated **Enforce Sensitive Environment Variables** policy.
List Environment Variables
# List all environment variables
vercel env ls
# Filter by environment
vercel env ls production
Remove Environment Variables
# Remove from specific environment
vercel env rm MY_SECRET production
# Remove fr
Read more
name: env-vars
description: Vercel environment variable expert guidance. Use when working with .env files, vercel env commands, Secret or Config variable types, OIDC tokens, or managing environment-specific configuration.
metadata:
priority: 7
docs:
- "https://vercel.com/docs/environment-variables"
- "https://vercel.com/docs/environment-variables/sensitive-environment-variables"
sitemap: "https://vercel.com/sitemap.xml"
pathPatterns:
- '.env'
- '.env.*'
- '.env.local'
- '.env.production'
- '.env.development'
- '.env.test'
- '.env.production.local'
- '.env.development.local'
- '.env.test.local'
- '.env.example'
bashPatterns:
- '\bvercel\s+env\s+pull\b'
- '\bvercel\s+env\s+add\b'
- '\bvercel\s+env\s+rm\b'
- '\bvercel\s+env\s+ls\b'
- '\bvercel\s+env\s+update\b'
- '\bvercel\s+env\s+run\b'
chainTo:
-
pattern: '\b(OPENAI_API_KEY|ANTHROPIC_API_KEY|GOOGLE_API_KEY)\b'
targetSkill: ai-gateway
message: 'Direct provider API key detected — loading AI Gateway guidance for OIDC auth (no manual keys needed on Vercel).'
retrieval:
aliases:
- environment variables
- env file
- secrets
- config vars
- secret env var
- sensitive env var
intents:
- set env var
- manage secrets
- pull env vars
- configure environment
entities:
- .env
- vercel env
- OIDC
- environment variableVercel Environment Variables
You are an expert in Vercel environment variable management — `.env` file conventions, the `vercel env` CLI, OIDC token lifecycle, and environment-specific configuration.
.env File Hierarchy
Vercel and Next.js load environment variables in a specific order. Later files override earlier ones:
| File | Purpose | Git-tracked? | |------|---------|-------------| | `.env` | Default values for all environments | Yes | | `.env.local` | Local overrides and secrets | **No** (gitignored) | | `.env.development` | Development-specific defaults | Yes | | `.env.development.local` | Local dev overrides | **No** | | `.env.production` | Production-specific defaults | Yes | | `.env.production.local` | Local prod overrides | **No** | | `.env.test` | Test-specific defaults | Yes | | `.env.test.local` | Local test overrides | **No** |
Load Order (Next.js)
1. `.env` (lowest priority) 2. `.env.[environment]` (development, production, or test) 3. `.env.local` (skipped in test environment) 4. `.env.[environment].local` (highest priority)
Critical Rules
- **Never commit secrets** to `.env`, `.env.development`, or `.env.production` — use `.local` variants or Vercel environment variables
- `.env.local` is always gitignored by Next.js — this is where `vercel env pull` writes secrets
- Variables prefixed with `NEXT_PUBLIC_` are exposed to the browser bundle — never put secrets in `NEXT_PUBLIC_` vars
- All other variables are server-only (API routes, Server Components, middleware)
vercel env CLI
Pull Environment Variables
# Pull all env vars for the current environment into .env.local vercel env pull .env.local # Pull for a specific environment vercel env pull .env.local --environment=production vercel env pull .env.local --environment=preview vercel env pull .env.local --environment=development # Overwrite existing file without prompting vercel env pull .env.local --yes # Pull to a custom file vercel env pull .env.production.local --environment=production
Add Environment Variables
Every variable has a type:
| Type | After saving | Use for | |------|--------------|---------| | **Secret** | Hidden in the dashboard and `vercel env ls`; can be replaced, never read back. Production and Preview Secrets are not returned by `vercel env pull`. | Passwords, API keys, tokens, database URLs | | **Config** | Readable by members with access | Non-sensitive values you need to read later |
Deployments receive both types at build time and runtime. Secret and Config replaced the Sensitive toggle; existing Sensitive variables are Secrets.
# Interactive — prompts for value, environments, and type vercel env add MY_SECRET # Non-interactive: read the value from a file so it never lands in shell # history or process arguments (echo "value" | ... and --value do both) vercel env add MY_SECRET production < ./secret.txt # Add to production and preview in one command vercel env add MY_SECRET production,preview < ./secret.txt # Set the type explicitly vercel env add MY_SECRET production --type secret < ./secret.txt vercel env add SITE_REGION production --type config < ./region.txt # Add development in its own command; development-only adds default to Config vercel env add MY_SECRET development < ./dev-secret.txt # Update an existing value vercel env update MY_SECRET production < ./secret.txt
- **Defaults**: a non-interactive add to production, preview, or a custom environment is stored as Secret.
- **Public prefixes are always Config**: variables such as `NEXT_PUBLIC_*` or `VITE_*` are exposed to browsers, so the CLI refuses `--type secret` for them. Keep a private value under a name without the prefix.
- **Flags**: `--type config|secret` needs Vercel CLI 59.6 or later. Older CLIs use `--visibility`, now a deprecated alias of `--type`. `--sensitive` (Secret) and `--no-sensitive` (Config) still work in every version.
- **Team policy**: **Separate Production Secret Values** requires a Production Secret to differ from the Preview, Development, and custom environment values of the same key. Under it, create separate Production and non-Production values instead of adding one value to all targets. It replaces the deprecated **Enforce Sensitive Environment Variables** policy.
List Environment Variables
# List all environment variables vercel env ls # Filter by environment vercel env ls production
Remove Environment Variables
# Remove from specific environment vercel env rm MY_SECRET production # Remove fr
Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.
Other skills on vercel.
More skills from other plugins.
container
Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,…
frontend-forge-fe-oper…
Operate FrontendExtension (FE) resources in frontend-forge: create, update, rebuild, inspect package artifacts, download…
agent-advisor
Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC — one…
agents-sdk
Build, debug, or review Cloudflare Agents SDK applications using the agents package.
Questions about env-vars.
- Which coding agents can use env-vars?
- env-vars installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

