| name | vercel-management |
| description | Use when deploying, managing, or working with Vercel projects without using the dashboard.
Triggers: "vercel deploy", "manage vercel", "vercel project", "vercel domain", "vercel environment",
"vercel ci/cd", "vercel promotion", "vercel rollback", "vercel functions", "vercel edge",
"vercel analytics", "vercel dns", "vercel ssl", "vercel team".
Provides comprehensive workflows for authentication, deployment, domain management, environment variables,
team collaboration, and production-ready CI/CD patterns.
|
Vercel Management
Comprehensive guide for managing Vercel projects entirely via CLI and API, eliminating the need for dashboard access.
Quick Reference
| Task | Command | Notes |
|---|
| Deploy | vercel --prod | Production deployment |
| Deploy preview | vercel | Preview deployment |
| Link project | vercel link | Link local directory |
| Pull config | vercel pull | Download settings & env vars |
| Env add | echo "value" | vercel env add KEY production | Add environment variable |
| Env pull | vercel env pull .env.local | Pull dev env vars to file |
| List deployments | vercel list | Recent deployments |
| Promote | vercel promote <url> | Make deployment current |
| Rollback | vercel rollback | Revert to previous |
| Domain add | vercel domains add example.com | Add custom domain |
| DNS add | vercel dns add example.com www A 1.2.3.4 | Add DNS record |
| Logs | vercel logs <url> | Stream deployment logs |
| Team context | vercel --team=myteam deploy | Deploy to team |
Installation & Authentication
Install CLI
npm install -g vercel@latest
npx vercel@latest
Authentication
vercel login
vercel login user@example.com
vercel --token $VERCEL_TOKEN deploy --prod
export VERCEL_TOKEN="your-token-here"
Check Authentication
vercel whoami
Project Management
Initialize & Link Projects
vercel init nextjs-app
vercel link
vercel link --scope=my-team
vercel pull
vercel pull --environment=production
vercel pull --yes
Project Configuration
The vercel pull command creates:
.vercel/project.json - Project metadata
.vercel/README.txt - Configuration info
.env.local - Development environment variables
Open in Dashboard (when necessary)
vercel open
Deployment
Basic Deployment
vercel
vercel --prod
vercel /path/to/project --prod
vercel --cwd /path/to/project --prod
Advanced Deployment Options
vercel --force --prod
vercel --force --with-cache --prod
vercel deploy --prebuilt --prod
vercel --no-wait --prod
vercel --logs --prod
vercel --prod --skip-domain
vercel --regions sfo1,iad1 --prod
vercel --meta commit=abc123 --meta branch=main --prod
vercel -e NODE_ENV=production --prod
vercel -b API_URL=https://api.example.com --prod
vercel --archive=tgz --prod
Capture Deployment URL
vercel --prod > deployment-url.txt
url=$(vercel --prod)
echo "Deployed to: $url"
if vercel --prod > deployment-url.txt 2> error.txt; then
DEPLOY_URL=$(cat deployment-url.txt)
echo "Success: $DEPLOY_URL"
else
echo "Failed: $(cat error.txt)"
exit 1
fi
Environment Variables
List Environment Variables
vercel env ls
vercel env ls production
vercel env ls preview
vercel env ls development
vercel env ls preview main
Add Environment Variables
vercel env add API_KEY production
echo "secret-value" | vercel env add API_KEY production
vercel env add API_KEY production
vercel env add API_KEY preview
echo "secret" | vercel env add SECRET production --sensitive
cat cert.pem | vercel env add CERTIFICATE production
Update Environment Variables
vercel env update API_KEY production
echo "new-value" | vercel env update API_KEY production
cat ~/.npmrc | vercel env update NPM_RC preview
Remove Environment Variables
vercel env rm API_KEY production
vercel env rm API_KEY production
vercel env rm API_KEY preview
vercel env rm API_KEY development
Pull Environment Variables to File
vercel env pull .env.local
vercel env pull --environment=production .env.production
vercel env pull --environment=preview --git-branch=feature-x .env.preview
vercel env pull --yes .env.local
Run Commands with Environment Variables
vercel env run -- next dev
vercel env run -- npm test
vercel env run -- node script.js
vercel env run -e production -- npm run migration
vercel env run -e preview -- npm run seed
vercel env run -e preview --git-branch feature-x -- npm start
Deployment Management
List Deployments
vercel list
vercel ls
vercel list my-project
vercel list --environment=production
vercel list --environment=preview
vercel list --meta commit=abc123
vercel list --meta branch=main
vercel list --prod
Promote Deployments
vercel promote https://my-app-xyz123.vercel.app
vercel promote <deployment-id>
vercel --prod --skip-domain > staging-url.txt
vercel promote $(cat staging-url.txt)
Redeploy
vercel redeploy https://my-app-xyz123.vercel.app
vercel redeploy <deployment-url>
Rollback
vercel rollback
vercel rollback https://my-app-xyz123.vercel.app
Remove Deployments
vercel remove <deployment-url>
vercel rm <deployment-id>
vercel remove <deployment-url> --yes
Inspect Deployments
vercel inspect <deployment-url>
vercel inspect <deployment-id>
Domain Management
List Domains
vercel domains ls
Add Domain
vercel domains add example.com
Remove Domain
vercel domains rm example.com
Inspect Domain
vercel domains inspect example.com
Aliases
vercel alias ls
vercel alias set <deployment-url> custom.example.com
vercel alias rm custom.example.com
DNS Management
List DNS Records
vercel dns ls
vercel dns ls example.com
Add DNS Records
vercel dns add example.com www A 76.76.21.21
vercel dns add example.com blog CNAME myblog.vercel.app
vercel dns add example.com @ TXT "verification-code-here"
vercel dns add example.com @ AAAA 2001:0db8:85a3::8a2e:0370:7334
vercel dns add example.com @ ALIAS target.vercel.app
Supported record types: A, AAAA, ALIAS, CNAME, TXT
Remove DNS Records
vercel dns rm example.com www
vercel dns rm example.com @
SSL Certificates
List Certificates
vercel certs ls
Issue Certificate
vercel certs add example.com
vercel certs add example.com www.example.com api.example.com
Remove Certificate
vercel certs rm <cert-id>
Note: Vercel automatically manages SSL certificates for domains using Vercel nameservers. Manual certificate management is only needed for external DNS configurations.
Logs & Monitoring
Stream Logs
vercel logs <deployment-url>
vercel logs <deployment-id>
JSON Output for Parsing
vercel logs <deployment-url> --json
vercel logs <deployment-url> --json | jq 'select(.level == "error")'
vercel logs <deployment-url> --json | jq '{timestamp: .timestamp, message: .message}'
Build Logs
Build logs are shown during deployment with --logs flag:
vercel deploy --logs --prod
Local Development
Development Server
vercel dev
vercel dev --listen 3000
vercel dev --env NODE_ENV=development
Build Locally
vercel build
vercel build --prod
vercel build --target=production
vercel build --output ./custom-output
Deploy Prebuilt
vercel deploy --prebuilt --prod
Team Management
List Teams
vercel teams ls
Switch Team Context
vercel switch <team-slug>
vercel --team=my-team deploy --prod
vercel -T team-id list
vercel --scope=my-team link
Invite Team Members
Note: Team member management (roles, permissions) requires dashboard access. Use Vercel Dashboard for:
- Inviting members with specific roles
- Configuring member permissions
- Managing team settings
Advanced Features
Redirects Configuration
Configure via vercel.json:
{
"redirects": [
{
"source": "/old-path",
"destination": "/new-path",
"statusCode": 301
},
{
"source": "/blog/:slug",
"destination": "https://blog.example.com/:slug",
"statusCode": 302
}
]
}
Headers Configuration
Configure via vercel.json:
{
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
}
]
}
]
}
Cron Jobs
Configure via vercel.json:
{
"crons": [
{
"path": "/api/cron/daily",
"schedule": "0 5 * * *"
},
{
"path": "/api/cron/hourly",
"schedule": "0 * * * *"
}
]
}
Protect cron endpoints:
export async function GET(request: Request) {
const authHeader = request.headers.get('authorization');
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response('Unauthorized', { status: 401 });
}
}
Edge Config (Feature Flags)
Note: Edge Config creation and management requires dashboard access or Vercel API. Use Dashboard for:
- Creating Edge Config stores
- Managing feature flags
- Setting up A/B tests
Access Edge Config in code:
import { get } from '@vercel/edge-config';
export async function middleware(request: Request) {
const isFeatureEnabled = await get('feature-flag');
}
CI/CD Best Practices
GitHub Actions Example
name: Deploy to Vercel
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
Required Secrets
Create at: https://vercel.com/account/tokens
VERCEL_TOKEN - Authentication token
VERCEL_ORG_ID - Organization/team ID (found in .vercel/project.json)
VERCEL_PROJECT_ID - Project ID (found in .vercel/project.json)
Deployment Strategies
Strategy 1: Direct Production Deploy
vercel --prod --token $VERCEL_TOKEN
Pros: Simple, fast
Cons: No testing window
Strategy 2: Staged Production Deploy
vercel --prod --skip-domain --token $VERCEL_TOKEN > deployment-url.txt
npm run e2e:test $(cat deployment-url.txt)
if [ $? -eq 0 ]; then
vercel promote $(cat deployment-url.txt) --token $VERCEL_TOKEN
else
echo "Tests failed, deployment not promoted"
exit 1
fi
Pros: Safe, testable
Cons: More complex
Strategy 3: Preview → Manual Promotion
vercel --token $VERCEL_TOKEN > preview-url.txt
vercel promote $(cat preview-url.txt) --token $VERCEL_TOKEN
Pros: Maximum control
Cons: Requires manual step
Global Options
Available for all commands:
| Option | Description |
|---|
--cwd <path> | Set working directory |
--debug / -d | Enable verbose output |
--global-config <dir> / -Q | Path to global config |
--help / -h | Show help |
--local-config <file> / -A | Path to vercel.json |
--no-color | Disable color output |
--scope <scope> / -S | Team or user scope |
--token <token> / -t | Auth token |
--team <team> / -T | Team slug or ID |
--version / -v | Show CLI version |
--yes / -y | Skip confirmation prompts |
Dashboard-Only Features
Some features require dashboard access:
- Analytics: View detailed analytics (no CLI equivalent)
- Webhooks: Configure deployment webhooks
- Edge Config: Create and manage Edge Config stores
- Team Settings: Advanced team permissions and roles
- Billing: Spending limits and payment settings
- Log Drains: Configure log forwarding
- Protection Rules: Advanced deployment protection
For these features, use the Vercel Dashboard or REST API (see references/api-reference.md).
Common Workflows
Initial Project Setup
vercel login
cd my-project
vercel link
vercel pull --environment=production --yes
vercel --prod
Environment Variable Sync
vercel env pull .env.local
vercel env add NEW_VAR development < .env.local
vercel env add NEW_VAR production < .env.prod
Zero-Downtime Deployment
vercel --prod --skip-domain > staging-url.txt
curl $(cat staging-url.txt)/api/health
vercel promote $(cat staging-url.txt)
Emergency Rollback
vercel rollback
vercel list --prod
vercel rollback <deployment-id>
Troubleshooting
Authentication Issues
vercel whoami
vercel logout
vercel login
Deployment Failures
vercel --logs --prod
vercel build --debug
vercel inspect <deployment-id>
Environment Variables Not Loading
vercel env pull --environment=production --yes
vercel env ls production
cat vercel.json
Domain Not Working
vercel domains inspect example.com
vercel dns ls example.com
vercel certs ls
Version Information
CLI Version: 50.4.5
Skill Version: 1.0.0
Last Updated: 2026-01-17
Additional Resources