| name | vercel-cli |
| description | Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, managing domains, or interacting with the Vercel platform from the command line. |
| metadata | {"priority":4,"docs":["https://vercel.com/docs/cli"],"sitemap":"https://vercel.com/sitemap/docs.xml","pathPatterns":["vercel.json","vercel.ts",".vercel/**",".vercelignore","now.json"],"bashPatterns":["^\\s*vercel(?:\\s|$)","^\\s*vc(?:\\s|$)","\\bnpx\\s+vercel\\b","\\bpnpm\\s+dlx\\s+vercel\\b","\\bbunx\\s+vercel\\b","\\byarn\\s+dlx\\s+vercel\\b","\\bnpx\\s+@vercel/config\\b"],"promptSignals":{"phrases":["check deployment","check deploy","deployment status","deploy status","vercel logs","deployment logs","deploy logs","vercel inspect","is it deployed","deploy failing","deploy failed","deployment error","check vercel","vercel status"],"allOf":["[Truncated]","[Truncated]","[Truncated]","[Truncated]","[Truncated]","[Truncated]","[Truncated]"],"anyOf":["deployment","deploy","vercel","production"],"noneOf":["terraform","aws deploy","heroku"],"minScore":6}} |
Vercel CLI
You are an expert in the Vercel CLI v59.10.0 (vercel or vc). The CLI is the primary way to manage Vercel projects from the terminal.
Installation
npm i -g vercel
Login
The CLI uses an OAuth 2.0 Device Flow for authentication.
vercel login
Deprecation notice: Email-based login (vercel login your@email.com) and the flags --github, --gitlab, --bitbucket, --oob were removed February 26, 2026. The team method (SAML-based login) remains supported until June 1, 2026, then will also be removed.
Core Commands
Deployment
vercel
vercel --prod
vercel build
vercel deploy --prebuilt
vercel build --prod
vercel deploy --prebuilt --prod
vercel --force
vercel promote <deployment-url>
vercel rollback
Development
vercel dev
vercel link
vercel link --yes --project <name-or-id> --scope <team>
vercel pull
vercel pull --environment=production
vercel open
Deterministic Project Linking (Recommended)
Prefer explicit non-interactive linking for bootstrap and automation:
vercel link --yes --project <name-or-id> --scope <team>
This is more reliable than interactive prompt-driven linking, which can pick the wrong project or team in multi-account setups. If there is any ambiguity, run vercel open to confirm the dashboard project, then relink with explicit --project and --scope.
Environment Variables
vercel env ls
vercel env add MY_VAR
vercel env add MY_VAR production
vercel env add MY_VAR preview development
vercel env add MY_VAR preview --branch=feature-x
vercel env add MY_SECRET --sensitive
vercel env rm MY_VAR
vercel env pull
vercel env pull .env.production.local --environment=production
Logs & Inspection
The vercel logs command (rebuilt February 2026) supports historical log querying and uses git context by default — it automatically scopes logs to your current repository when run from a project directory.
vercel logs <deployment-url>
vercel logs <deployment-url> --follow
vercel logs --since 24h
vercel logs --since 7d
vercel logs <deployment-url> --since 1h
vercel logs <deployment-url> --since 30m
vercel logs <deployment-url> --level error
vercel logs <deployment-url> --level warning
vercel logs --deployment-id dpl_xxxxx
vercel logs --request-id req_xxxxx
vercel logs --query "TypeError"
vercel logs <deployment-url> --json
vercel logs <deployment-url> --follow --since 1h --level error --json
vercel inspect <deployment-url>
vercel ls
Note: vercel logs shows runtime request logs only. For build output, use
vercel inspect <deployment-url> or view build logs at https://vercel.com/{team}/{project}/deployments → select deployment → Build Logs.
Drains and advanced observability: Log drains, trace export, and analytics data forwarding are
configured via the Vercel Dashboard at https://vercel.com/dashboard/{team}/~/settings/log-drains or REST API (/v1/drains), not the CLI. See ⤳ skill: observability
for drain setup, payload schemas, and signature verification.
Domains
vercel domains ls
vercel domains add example.com
vercel domains rm example.com
DNS
vercel dns ls example.com
vercel dns add example.com @ A 1.2.3.4
Teams
vercel teams ls
vercel teams switch my-team
Cache Management
vercel cache purge
vercel cache purge --type cdn
vercel cache purge --type data
vercel cache purge --yes
vercel cache invalidate --tag blog-posts
vercel cache invalidate --tag blog-posts,user-profiles,homepage
vercel cache dangerously-delete --tag blog-posts
vercel cache dangerously-delete --tag blog-posts --revalidation-deadline-seconds 3600
vercel cache invalidate --srcimg /api/avatar/1
vercel cache dangerously-delete --srcimg /api/avatar/1
Key distinction: invalidate serves STALE and revalidates in the background. dangerously-delete serves MISS and blocks while revalidating. Prefer invalidate unless you need immediate freshness.
Note: --tag and --srcimg cannot be used together.
MCP Server Integration
vercel mcp
vercel mcp --project
The vercel mcp command links your local MCP client configuration to a Vercel Project. It generates connection details so AI agents and tools can call your MCP endpoints deployed on Vercel securely.
Programmatic Configuration (@vercel/config)
npx @vercel/config compile
npx @vercel/config validate
npx @vercel/config generate
Use vercel.ts (or .js, .mjs, .cjs, .mts) instead of vercel.json for type-safe, dynamic project configuration. Only one config file per project — vercel.json or vercel.ts, not both.
Note: Legacy now.json support will be removed on March 31, 2026. Rename to vercel.json (no content changes needed).
Marketplace Integrations
Auto-provisioning is the default for vercel integration add — the CLI automatically creates resources and sets environment variables without extra prompts.
vercel integration list
vercel integration add neon
vercel integration open neon
vercel integration remove neon
Agent-Optimized: discover and guide
AI agents can autonomously discover, install, and retrieve setup instructions for Marketplace integrations (added March 2026):
vercel integration discover --format=json
vercel integration discover database --format=json
vercel integration guide neon
vercel integration discover storage --format=json
vercel integration add neon
vercel integration guide neon
discover — Searches the Vercel Marketplace catalog. Use --format=json for non-interactive output suitable for scripting and agent pipelines.
guide <name> — Returns getting-started documentation in agent-friendly markdown: environment variables, SDK setup, and code snippets.
- Human-in-the-loop safety: the CLI prompts for developer confirmation when accepting Terms of Service.
Full subcommands: discover, guide, add, list (alias ls), balance, open, remove.
Project-Level Routing (No Redeploy)
Create and update routing rules — headers, rewrites, redirects — without building a new deployment. Rules take effect instantly.
Available via dashboard (CDN tab), API, CLI, and Vercel SDK. Project-level routes run after bulk redirects and before deployment config routes.
Feature Flags
vercel flags add redesigned-checkout --kind boolean --description "New checkout flow"
vercel flags sdk-keys ls
vercel flags --help
See ⤳ skill: vercel-flags for full flag configuration and adapter patterns.
Direct API Access
The vercel api command (added January 2026) gives direct access to the full Vercel REST API from the terminal. Designed for AI agents — call Vercel APIs with no additional configuration.
vercel api GET /v9/projects
vercel api GET /v13/deployments
vercel api POST /v9/projects/:id/env --body '{"key":"MY_VAR","value":"val","target":["production"]}'
vercel api GET /v9/projects | jq '.[].name'
Metrics
vercel metrics
vercel metrics --raw-values
CI/CD Integration
Required environment variables for CI:
VERCEL_TOKEN=<your-token>
VERCEL_ORG_ID=<org-id>
VERCEL_PROJECT_ID=<project-id>
GitHub Actions Example
- name: Deploy to Vercel
run: |
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
Global Options
| Flag | Purpose |
|---|
--token | Authentication token (for CI) |
--cwd <dir> | Working directory |
--debug / -d | Verbose output |
--yes / -y | Skip confirmation prompts |
--scope <team> | Execute as a team |
Common Workflows
First-Time Setup
vercel link
vercel env pull
vercel dev
Deploy from CI
vercel pull --yes --environment=production --token=$TOKEN
vercel build --prod --token=$TOKEN
vercel deploy --prebuilt --prod --token=$TOKEN
Quick Preview
vercel
Official Documentation