Skip to content

Vercel CLI Commands

Comprehensive Vercel CLI commands and workflows for deployment and serverless development.

Installation and Setup

Command Description
npm install -g vercel Install Vercel CLI globally
yarn global add vercel Install with Yarn
vercel login Login to Vercel account
vercel logout Logout from Vercel
vercel whoami Show current user
vercel --version Show CLI version
vercel --help Show help information

Project Management

Command Description
vercel Deploy current directory
vercel --prod Deploy to production
vercel --prebuilt Deploy prebuilt static files
vercel init Initialize new project
vercel link Link local directory to Vercel project
vercel unlink Unlink project
vercel ls List all deployments
vercel rm <deployment> Remove deployment

Deployment Commands

Command Description
vercel deploy Deploy project
vercel --name <name> Deploy with custom name
vercel --target production Deploy to production
vercel --target preview Deploy to preview
vercel --build-env KEY=value Set build environment variable
vercel --env KEY=value Set runtime environment variable
vercel --regions <regions> Deploy to specific regions
vercel --force Force new deployment

Environment Variables

Command Description
vercel env ls List environment variables
vercel env add <name> Add environment variable
vercel env rm <name> Remove environment variable
vercel env pull Download environment variables
vercel env pull .env.local Pull to specific file

Domain Management

Command Description
vercel domains ls List all domains
vercel domains add <domain> Add custom domain
vercel domains rm <domain> Remove domain
vercel domains inspect <domain> Inspect domain configuration
vercel alias <deployment> <domain> Set domain alias
vercel alias rm <alias> Remove alias

Project Configuration

Command Description
vercel projects ls List all projects
vercel projects add <name> Create new project
vercel projects rm <name> Remove project
vercel switch <project> Switch to project
vercel inspect <deployment> Inspect deployment details

Logs and Monitoring

Command Description
vercel logs <deployment> View deployment logs
vercel logs --follow Follow logs in real-time
vercel logs --since 1h Show logs from last hour
vercel logs --until 2h Show logs until 2 hours ago
vercel logs --output raw Show raw log output

Secrets Management

Command Description
vercel secrets ls List all secrets
vercel secrets add <name> <value> Add secret
vercel secrets rm <name> Remove secret
vercel secrets rename <old> <new> Rename secret

Teams and Organizations

Command Description
vercel teams ls List teams
vercel teams switch <team> Switch to team
vercel teams add <email> Invite team member
vercel teams rm <email> Remove team member

Development Server

Command Description
vercel dev Start local development server
vercel dev --listen 3000 Start on specific port
vercel dev --debug Start with debug mode
vercel dev --confirm Skip confirmation prompts

DNS Management

Command Description
vercel dns ls <domain> List DNS records
vercel dns add <domain> <type> <value> Add DNS record
vercel dns rm <record-id> Remove DNS record
vercel dns import <domain> <file> Import DNS records

Certificates

Command Description
vercel certs ls List SSL certificates
vercel certs add <domain> Add SSL certificate
vercel certs rm <cert-id> Remove certificate
vercel certs issue <domain> Issue new certificate

Build Configuration

Command Description
vercel build Build project locally
vercel --build-env NODE_ENV=production Set build environment
vercel --no-build Skip build process
vercel --debug Enable debug output

Git Integration

Command Description
vercel git connect Connect Git repository
vercel git disconnect Disconnect Git repository
vercel git ls List connected repositories

Functions and API Routes

Command Description
vercel functions ls List serverless functions
vercel functions inspect <function> Inspect function details
vercel functions logs <function> View function logs

Deployment Aliases

Command Description
vercel alias ls List all aliases
vercel alias set <deployment> <alias> Set deployment alias
vercel alias rm <alias> Remove alias

Project Settings

Command Description
vercel --scope <team> Run command in team scope
vercel --token <token> Use specific auth token
vercel --global-config <path> Use custom config path
vercel --local-config <path> Use local config file

Advanced Deployment

Command Description
vercel --archive=tgz Create deployment archive
vercel --public Make deployment public
vercel --regions all Deploy to all regions
vercel --regions sfo1,iad1 Deploy to specific regions

Troubleshooting

Command Description
vercel --debug Enable debug mode
vercel --verbose Enable verbose output
vercel doctor Run diagnostic checks
vercel status Check Vercel service status

Configuration Files

File Description
vercel.json Project configuration
.vercelignore Files to ignore during deployment
.env.local Local environment variables
.env.production Production environment variables

Integration Commands

Command Description
vercel integrations ls List integrations
vercel integrations add <integration> Add integration
vercel integrations rm <integration> Remove integration

Performance Optimization

Command Description
vercel --prod --regions sfo1 Deploy to single region
vercel --build-env NEXT_TELEMETRY_DISABLED=1 Disable telemetry
vercel --no-clipboard Disable clipboard copy