Skip to content

@tank/vercel

1.1.0

Vercel deployment and project management via CLI. Covers deploy, build, dev, env, domains, dns, logs, promote, rollback. vercel.json config (redirects, rewrites, headers, functions, crons, regions). CI/CD patterns (GitHub Actions, GitLab CI). Env var management, serverless/edge functions, troubleshooting. Triggers: vercel, vercel deploy, vercel cli, vercel build, vercel dev, vercel env, vercel domains, vercel.json, deployment, CI/CD vercel, serverless function, edge function, vercel monorepo.


name: "@tank/vercel" description: | Vercel deployment and project management using the CLI. Covers all CLI commands (deploy, build, dev, pull, env, domains, dns, logs, promote, rollback), vercel.json configuration (redirects, rewrites, headers, functions, crons, images, regions), CI/CD workflows (GitHub Actions, GitLab CI, preview and production pipelines), environment variable management, domain and DNS setup, serverless and edge functions, and troubleshooting. Synthesizes Vercel CLI docs (2026), vercel.json schema, and production deployment patterns.

Trigger phrases: "vercel", "vercel deploy", "vercel cli", "vercel build", "vercel dev", "vercel pull", "vercel env", "vercel domains", "vercel dns", "vercel logs", "vercel promote", "vercel rollback", "vercel.json", "deployment", "preview deployment", "production deployment", "CI/CD vercel", "serverless function", "edge function", "cron job vercel", "vercel monorepo", "vercel turborepo", "vercel domain", "vercel certificate", "deploy to vercel", "vercel environment variables", "vercel preview", "vercel production"

Vercel Deployment and Management

Deploy, configure, and manage Vercel projects using the CLI. Covers the complete lifecycle from project setup through production deployment, monitoring, and troubleshooting.

Core Philosophy

  1. Verify before acting -- Run vercel whoami to confirm auth and vercel project inspect to confirm project linking before any operation.
  2. Pull before build -- Always run vercel pull before vercel build or vercel dev to sync environment variables and project settings.
  3. Preview before production -- Deploy to preview first, verify, then promote or deploy to production. Never skip preview in CI/CD.
  4. Use --yes in automation -- Every interactive prompt has a flag-based path. Use --yes and --token for all CI/CD commands.
  5. Match functions to workload -- Use Edge for auth/routing/geo (<30s, global), Serverless for heavy compute (up to 800s, regional).

Quick-Start

"I want to deploy my project"

StepAction
1Check auth: vercel whoami
2Link project: vercel link (or vercel link --yes in CI)
3Preview deploy: vercel
4Production deploy: vercel --prod
-> See references/deployment-workflows.md for CI/CD patterns

"I need to set up CI/CD with GitHub Actions"

StepAction
1Set secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID
2Use the 3-step pattern: pull -> build -> deploy
3Use --prebuilt --archive=tgz for faster deploys
-> See references/deployment-workflows.md

"I need to configure my project"

StepAction
1Add $schema for autocomplete
2Configure redirects, rewrites, headers, functions, crons
3Set regions for function deployment
-> See references/project-configuration.md

"Something is broken"

SymptomAction
Build failsCheck env vars: vercel env ls, test locally: vercel build
Function timeoutCheck limits, increase maxDuration, check Fluid compute
5xx errorsvercel logs --status-code 5xx --since 1h
Slow functionvercel httpstat /api/endpoint, check cold starts
Domain not workingvercel domains inspect, check DNS propagation
Need to revertvercel rollback (instant, no rebuild)
-> See references/troubleshooting.md

Project Detection

Before running commands, check for existing Vercel setup:

SignalMeaningNext Step
.vercel/ directory existsProject is linkedVerify with vercel project inspect
vercel.json existsProject has configRead and respect existing settings
Neither existsNew projectRun vercel link to connect
vercel.json + no .vercel/Config but not linkedRun vercel link --yes

Decision Trees

Deployment Method

SignalMethodReference
Push to Git, automatic deploys desiredGit integration (dashboard)--
CI/CD pipeline, custom build stepsCLI: pull -> build -> deployreferences/deployment-workflows.md
Quick manual deploy from localvercel or vercel --prodreferences/cli-commands.md
Monorepo with TurborepoTurbo build + vercel deploy --prebuiltreferences/deployment-workflows.md
Deploy without sharing sourcevercel build + vercel deploy --prebuiltreferences/deployment-workflows.md

Function Runtime

NeedRuntimeKey Constraints
Full Node.js APIs, heavy computeServerless (Node.js)Regional, ~250ms cold start
Ultra-low latency, globalEdgeNo fs/native modules, 30s max, 1MB compressed
Auth gating, redirects, geo-routingEdge MiddlewareRuns before every matched request
Python, Go, RubyServerless (community)Limited runtime support

Environment Variables

TaskCommand
Add variable to productionvercel env add NAME production
Pull vars for local devvercel env pull
Run command with env varsvercel env run -- next dev
Sync project settings + varsvercel pull
Override var for one deployvercel deploy --env KEY=value
-> See references/environment-variables.md

Anti-Patterns

Don'tDo InsteadWhy
Deploy to production without previewvercel first, then vercel --prodCatch issues before users see them
Use interactive prompts in CIAdd --yes --token $TOKEN to all commandsCI has no TTY
Skip vercel pull before vercel buildAlways pull firstBuild needs env vars and project settings
Set memory in vercel.json with FluidConfigure in dashboard SettingsFluid compute manages memory differently
Use has/missing and test with vercel devTest conditional routes on preview deploysConditions don't work locally
Hardcode env vars in vercel.jsonUse vercel env add or dashboardEnv vars don't belong in config files
Commit .vercel/ directoryAdd to .gitignoreContains local project linking data
Use vercel deploy for monorepo CIUse turbo build + vercel deploy --prebuiltTurborepo caching saves 80%+ build time
Promote preview without checking env varsVerify: promoted deploys use production env varsPreview and production env vars differ
Use serverless for auth/redirectsUse Edge middlewareEdge is global, <1ms cold start

The 3-Step CI/CD Pattern

The standard deployment pattern for all CI/CD pipelines:

vercel pull --yes --environment=production --token=$VERCEL_TOKEN
vercel build --prod --token=$VERCEL_TOKEN
vercel deploy --prod --prebuilt --archive=tgz --token=$VERCEL_TOKEN

Step 1 syncs env vars and project config. Step 2 builds locally. Step 3 uploads pre-built artifacts. Use --archive=tgz for large projects.

For preview deployments, remove --prod from build and deploy, and use --environment=preview for pull.

Reference Files

FileContents
references/cli-commands.mdAll CLI commands organized by category, key flags and options for each, global options, project specification precedence, usage examples
references/project-configuration.mdComplete vercel.json schema, all configuration fields with JSON examples, framework presets, monorepo config, routing (redirects, rewrites, headers), functions, crons, images, gotchas
references/deployment-workflows.mdCI/CD patterns (GitHub Actions, GitLab CI, Bitbucket), preview and production workflows, promote, rollback, rolling releases, monorepo deployment, deploy hooks, prebuilt deploys
references/environment-variables.mdPer-environment management, branch-specific vars, sensitive vars, pull vs env pull, env run, system variables, limits, security best practices
references/domains-and-dns.mdDomain lifecycle, DNS records (A, CNAME, MX, TXT, SRV, CAA), SSL certificates, wildcard domains, multi-tenant patterns, apex and www setup
references/serverless-and-edge.mdServerless vs edge functions, middleware, geolocation, Edge Config, cold start mitigation, streaming, Build Output API, storage integrations, firewall, feature flags
references/troubleshooting.mdCommon errors and fixes, debugging commands, plan limits by tier, cost optimization strategies, recovery procedures, cache management, vercel dev limitations

Command Palette

Search skills, docs, and navigate Tank