Getting Started
Install
npm i -g vercelFirst-Time Setup
- Authenticate -
vercel loginopens a browser/device flow. For CI, use theVERCEL_TOKENenvironment variable instead. Wait for deliberate user completion when a browser flow starts. - Link your project -
vercel linkfor a working-directory project orvercel link --repofor repository directory mappings. Both create files under.vercel/. - Verify the target - from the intended working directory, run
vercel project inspect --non-interactiveand confirm its owner and project. Stop onlink_requiredor a mismatch rather than linking automatically.vercel whoami --format jsonidentifies the authenticated user and effective team, not the linked project. - Pull local data -
vercel pullwrites project settings and environment data under.vercel/, including.vercel/.env.<environment>.local. Usevercel env pullto write.env.localor another file that is already excluded from source control. - Dev or deploy -
vercel devstarts a local server;vercel --proddeploys to production.
Project Linking
Project resolution starts from the command's working directory:
<cwd>/.vercel/project.json: This exact working-directory link takes precedence. A root single-project link is not generally inherited by arbitrary subdirectories.<repo-root>/.vercel/repo.json: The deepest configured directory containing the working directory wins.- No matching repo directory: Interactive repo resolution prompts. Non-interactive repo resolution currently selects the sole configured repo project or remains unresolved when multiple projects exist. Commands that set up projects may then enter a linking flow.
An app subdirectory only identifies a project when the repo mapping covers it. Verify the result with vercel project inspect --non-interactive before operating on the project.
Read-only inspection can trigger login or team SAML re-authentication, open a browser/device flow, and wait for approval. Ask the user to complete the flow before retrying or continuing.