/env
Manage Vercel environment variables. Commands include list, pull, add, remove, and diff. Use to sync environment variables between Vercel and your local development environment.
> /plugin marketplace add vercel-labs/vercel-plugin > /plugin install vercel-plugin@vercel
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/env
Context preview
What this command does when you run it.
Manage Vercel environment variables. Commands include list, pull, add, remove, and diff. Use to sync environment variables between Vercel and your local development environment.
Command definition
env.mddescription: Manage Vercel environment variables. Commands include list, pull, add, remove, and diff. Use to sync environment variables between Vercel and your local development environment.
Vercel Environment Variables
Manage environment variables for the current Vercel project with safety rails to prevent secret leakage.
> **๐ Never-Echo-Secrets Rule**: Environment variable **values** must never appear in command output, summaries, or conversation text. Only show variable **names**, **environments**, and **metadata** (created date, type). This rule applies to all subcommands.
Preflight
1. **CLI available?** โ Confirm `vercel` is on PATH.
- If missing: `npm i -g vercel` (or `pnpm add -g vercel` / `bun add -g vercel`).
2. **Project linked?** โ Check for `.vercel/project.json` in the current directory or nearest parent.
- If not found: run `vercel link` interactively, then re-run `/env`.
3. **Detect environment files** โ Check for `.env`, `.env.local`, `.env.production.local`, `.env.development.local` in the project root. Note which exist for the diff subcommand.
Plan
Based on "$ARGUMENTS", determine the action:
| Argument | Action | Destructive? | |----------|--------|-------------| | `list` / `ls` / _(none)_ | List env var names per environment | No | | `pull` | Download env vars to local `.env.local` | No (overwrites local file) | | `add <NAME>` | Add a new env var | Yes (if production) | | `rm <NAME>` / `remove <NAME>` | Remove an env var | **Yes** | | `diff` | Compare local vs Vercel key names | No |
For any operation that mutates **production** environment variables (`add` or `rm` targeting production):
> โ ๏ธ **Production environment mutation requested.** > This will change environment variables on your live production deployment. > **Ask the user for explicit confirmation before proceeding.** Do not mutate production env vars without a clear "yes."
Commands
"list" or "ls" or no arguments
<!-- Sourced from env-vars skill: vercel env CLI > List Environment Variables -->
# List all environment variables
vercel env ls
# Filter by environment
vercel env ls production
Present results as a table of variable **names only** grouped by environment. **Never print values.**
| Name | Production | Preview | Development | |------|-----------|---------|-------------| | DATABASE_URL | โ | โ | โ | | API_KEY | โ | โ | โ |
"pull"
<!-- Sourced from env-vars skill: 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
After pulling, remind the user:
> Ensure `.env*.local` is in your `.gitignore` to avoid committing secrets.
"add \<NAME\>"
1. Ask the user which environments to target: production, preview, development (can select multiple). 2. If **production** is selected, require explicit confirmation (see Plan section). 3. Run the add command:
<!-- Sourced from env-vars skill: vercel env CLI > Add Environment Variables -->
# Interactive โ prompts for value and environments
vercel env add MY_SECRET
# Non-interactive
echo "secret-value" | vercel env add MY_SECRET production
# Add to multiple environments
echo "secret-value" | vercel env add MY_SECRET production preview development
# Add a sensitive variable (encrypted, not shown in logs)
vercel env add MY_SECRET --sensitive
The CLI will prompt for the value interactively โ **do not pass the value as a CLI argument or echo it**.
"rm \<NAME\>" or "remove \<NAME\>"
1. If the variable exists in **production**, require explicit confirmation. 2. Run the remove command:
<!-- Sourced from env-vars skill: vercel env CLI > Remove Environment Variables -->
# Remove from specific environment
vercel env rm MY_SECRET production
# Remove from all environments
vercel env rm MY_SECRET
Confirm the target environment(s) with the user before executing.
"diff"
Compare local environment file key names against Vercel-configured key names. **Only compare names โ never read or display values.**
1. Read local env file keys (from `.env.local` or `.env` โ whichever exists):
grep -v '^#' .env.local | grep '=' | cut -d'=' -f1 | sort
2. Fetch Vercel env var names:
vercel env ls
Parse the output to extract variable names for the target environment (default: development).
3. Present the diff:
## Env Diff โ Local vs Vercel (development)
### In local but NOT on Vercel:
- EXTRA_LOCAL_VAR
- DEBUG_MODE
### On Vercel but NOT in local:
- ANALYTICS_KEY
- SENTRY_DSN
### In both:
- DATABASE_URL
- API_KEY
- NEXT_PUBLIC_APP_URL
If all keys match, report: "Local and Vercel environment keys are in sync."
Environment-Specific Configuration Reference
<!-- Sourced from env-vars skill: Environment-Specific Configuration -->
Vercel Dashboard vs .env Files
| Use Case | Where to Set | |----------|-------------| | Secrets (API keys, tokens) | Vercel Dashboard (`https://vercel.com/{team}/{project}/settings/environment-variables`) or `vercel env add` | | Public config (site URL, feature flags) | `.env` or `.env.[environment]` files | | Local-only overrides | `.env.local` | | CI/CD secrets | Vercel Dashboard (`https://vercel.com/{team}/{project}/settings/environment-variables`) with environment scoping |
Environment Scoping on Vercel
Variables set in the Vercel Dashboard at `https://vercel.com/{team}/{project}/settings/environment-variables` can be scoped to:
- **Production** โ only `vercel.app` production deployments
- **Preview** โ branch/PR deployments
- **Development** โ `vercel dev` and `ver
Read more
description: Manage Vercel environment variables. Commands include list, pull, add, remove, and diff. Use to sync environment variables between Vercel and your local development environment.
Vercel Environment Variables
Manage environment variables for the current Vercel project with safety rails to prevent secret leakage.
> **๐ Never-Echo-Secrets Rule**: Environment variable **values** must never appear in command output, summaries, or conversation text. Only show variable **names**, **environments**, and **metadata** (created date, type). This rule applies to all subcommands.
Preflight
1. **CLI available?** โ Confirm `vercel` is on PATH.
- If missing: `npm i -g vercel` (or `pnpm add -g vercel` / `bun add -g vercel`).
2. **Project linked?** โ Check for `.vercel/project.json` in the current directory or nearest parent.
- If not found: run `vercel link` interactively, then re-run `/env`.
3. **Detect environment files** โ Check for `.env`, `.env.local`, `.env.production.local`, `.env.development.local` in the project root. Note which exist for the diff subcommand.
Plan
Based on "$ARGUMENTS", determine the action:
| Argument | Action | Destructive? | |----------|--------|-------------| | `list` / `ls` / _(none)_ | List env var names per environment | No | | `pull` | Download env vars to local `.env.local` | No (overwrites local file) | | `add <NAME>` | Add a new env var | Yes (if production) | | `rm <NAME>` / `remove <NAME>` | Remove an env var | **Yes** | | `diff` | Compare local vs Vercel key names | No |
For any operation that mutates **production** environment variables (`add` or `rm` targeting production):
> โ ๏ธ **Production environment mutation requested.** > This will change environment variables on your live production deployment. > **Ask the user for explicit confirmation before proceeding.** Do not mutate production env vars without a clear "yes."
Commands
"list" or "ls" or no arguments
<!-- Sourced from env-vars skill: vercel env CLI > List Environment Variables -->
# List all environment variables vercel env ls # Filter by environment vercel env ls production
Present results as a table of variable **names only** grouped by environment. **Never print values.**
| Name | Production | Preview | Development | |------|-----------|---------|-------------| | DATABASE_URL | โ | โ | โ | | API_KEY | โ | โ | โ |
"pull"
<!-- Sourced from env-vars skill: 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
After pulling, remind the user:
> Ensure `.env*.local` is in your `.gitignore` to avoid committing secrets.
"add \<NAME\>"
1. Ask the user which environments to target: production, preview, development (can select multiple). 2. If **production** is selected, require explicit confirmation (see Plan section). 3. Run the add command:
<!-- Sourced from env-vars skill: vercel env CLI > Add Environment Variables -->
# Interactive โ prompts for value and environments vercel env add MY_SECRET # Non-interactive echo "secret-value" | vercel env add MY_SECRET production # Add to multiple environments echo "secret-value" | vercel env add MY_SECRET production preview development # Add a sensitive variable (encrypted, not shown in logs) vercel env add MY_SECRET --sensitive
The CLI will prompt for the value interactively โ **do not pass the value as a CLI argument or echo it**.
"rm \<NAME\>" or "remove \<NAME\>"
1. If the variable exists in **production**, require explicit confirmation. 2. Run the remove command:
<!-- Sourced from env-vars skill: vercel env CLI > Remove Environment Variables -->
# Remove from specific environment vercel env rm MY_SECRET production # Remove from all environments vercel env rm MY_SECRET
Confirm the target environment(s) with the user before executing.
"diff"
Compare local environment file key names against Vercel-configured key names. **Only compare names โ never read or display values.**
1. Read local env file keys (from `.env.local` or `.env` โ whichever exists):
grep -v '^#' .env.local | grep '=' | cut -d'=' -f1 | sort
2. Fetch Vercel env var names:
vercel env ls
Parse the output to extract variable names for the target environment (default: development).
3. Present the diff:
## Env Diff โ Local vs Vercel (development) ### In local but NOT on Vercel: - EXTRA_LOCAL_VAR - DEBUG_MODE ### On Vercel but NOT in local: - ANALYTICS_KEY - SENTRY_DSN ### In both: - DATABASE_URL - API_KEY - NEXT_PUBLIC_APP_URL
If all keys match, report: "Local and Vercel environment keys are in sync."
Environment-Specific Configuration Reference
<!-- Sourced from env-vars skill: Environment-Specific Configuration -->
Vercel Dashboard vs .env Files
| Use Case | Where to Set | |----------|-------------| | Secrets (API keys, tokens) | Vercel Dashboard (`https://vercel.com/{team}/{project}/settings/environment-variables`) or `vercel env add` | | Public config (site URL, feature flags) | `.env` or `.env.[environment]` files | | Local-only overrides | `.env.local` | | CI/CD secrets | Vercel Dashboard (`https://vercel.com/{team}/{project}/settings/environment-variables`) with environment scoping |
Environment Scoping on Vercel
Variables set in the Vercel Dashboard at `https://vercel.com/{team}/{project}/settings/environment-variables` can be scoped to:
- **Production** โ only `vercel.app` production deployments
- **Preview** โ branch/PR deployments
- **Development** โ `vercel dev` and `ver
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.
Repo: vercel-labs/vercel-plugin
Other commands on vercel.
- /bootstrap
Bootstrap a repository with Vercel-linked resources by running preflight checks, provisioning integrations, verifying env keys, and then executing db/dev startup commands safely.
Open command - /deploy
Deploy the current project to Vercel. Pass "prod" or "production" as argument to deploy to production. Default is preview deployment.
Open command - /status
Show the status of the current Vercel project โ recent deployments, linked project info, and environment overview.
Open command

