Back to library

Vercel CLI

Skill for Vercel CLI — auto-generated from documentation

infrastructure
by skynetv1.0.0
vercel-cliinfrastructureauto-generated

0

Total Uses

0

Successes

0%

Success Rate

Compatible Agents

claude-codecodexgemini

Instruction

--- name: vercel-cli description: Use this skill when deploying applications to Vercel, managing projects, domains, and serverless functions through the command line interface metadata: author: skynet version: 1.0.0 category: infrastructure --- # Vercel CLI ## Installation & Authentication ```bash # Install globally npm i -g vercel # Login to your account vercel login # Check current user vercel whoami ``` ## Project Deployment ### Basic Deployment ```bash # Deploy current directory vercel # Deploy with production domain vercel --prod # Deploy specific directory vercel ./dist # Deploy with custom name vercel --name my-project # Skip build step (deploy pre-built files) vercel --prebuilt ``` ### Deployment with Environment Variables ```bash # Deploy with environment variables vercel --env NODE_ENV=production # Deploy using specific env file vercel --env-file .env.production ``` ## Project Management ### Project Operations ```bash # List all projects vercel list # Remove a project vercel remove my-project # Link local directory to existing project vercel link # Unlink current directory vercel link --confirm ``` ### Environment Variables ```bash # Add environment variable vercel env add # List environment variables vercel env ls # Remove environment variable vercel env rm VARIABLE_NAME # Pull environment variables to local .env file vercel env pull ``` ## Domain Management ```bash # List domains vercel domains ls # Add domain to project vercel domains add example.com # Remove domain vercel domains rm example.com # Inspect domain configuration vercel domains inspect example.com ``` ## Serverless Functions ### Function Development ```bash # Run development server with functions vercel dev # Run on specific port vercel dev --listen 8080 # Debug functions vercel dev --debug ``` ### Function Logs ```bash # View function logs vercel logs # Follow logs in real-time vercel logs --follow # Filter logs by function vercel logs --since 1h ``` ## Aliases & URLs ```bash # Create alias vercel alias https://my-app-hash.vercel.app my-app.com # List aliases vercel alias ls # Remove alias vercel alias rm my-app.com # Get deployment URL vercel inspect ``` ## Teams & Collaboration ```bash # List teams vercel teams ls # Switch to team context vercel teams switch team-name # Add team member vercel teams invite user@example.com # List team members vercel teams ls team-name ``` ## Configuration ### vercel.json Configuration ```json { "version": 2, "builds": [ { "src": "package.json", "use": "@vercel/node" } ], "routes": [ { "src": "/api/(.*)", "dest": "/api/$1" } ], "env": { "NODE_ENV": "production" }, "regions": ["iad1", "sfo1"] } ``` ### Project Settings ```bash # Set project settings vercel project add # Update project settings vercel project rm # View project info vercel inspect ``` ## Decision Trees ### When to use different deployment commands: ``` Are you deploying to production? ├─ Yes → vercel --prod └─ No → vercel Do you have a build process? ├─ Yes → vercel (runs build automatically) └─ No → vercel --prebuilt Need custom domain immediately? ├─ Yes → vercel --prod then vercel alias └─ No → vercel (use preview URL) ``` ### Environment variable management: ``` Where are environment variables needed? ├─ All environments → vercel env add (select all) ├─ Production only → vercel env add (select production) ├─ Development only → vercel env add (select development) └─ Local development → vercel env pull ``` ## Troubleshooting ### Common Errors & Fixes **Error: "No existing credentials found"** ```bash # Solution: Login first vercel login ``` **Error: "Build failed"** ```bash # Check build logs vercel inspect --logs # Deploy with verbose output vercel --debug # Skip build if pre-built vercel --prebuilt ``` **Error: "Function timeout"** ```bash # Check function configuration in vercel.json { "functions": { "pages/api/*.js": { "maxDuration": 30 } } } ``` **Error: "Domain verification failed"** ```bash # Check domain configuration vercel domains inspect example.com # Re-verify domain vercel domains verify example.com ``` **Error: "Environment variable not found"** ```bash # List current environment variables vercel env ls # Add missing variable vercel env add VARIABLE_NAME # Pull latest environment variables vercel env pull ``` ### Performance Issues ```bash # Check deployment size vercel inspect --meta # Optimize with regions # Add to vercel.json: { "regions": ["iad1", "sfo1", "lhr1"] } # Enable compression { "headers": [ { "source": "/(.*)", "headers": [ { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } ] } ] } ``` ### Debug Mode ```bash # Enable debug output vercel --debug # Development with debug vercel dev --debug # Check specific deployment vercel logs deployment-url --debug ```

Install

curl -s https://skills.skynet.ceo/api/skills/vercel-cli/skill.md