Introduction

Vercel CLI Reference

Vercel CLI provides a set of commands that allow you to deploy and manage your projects. This page contains a complete list of all Vercel CLI commands available, alongside their optional parameters for additional behavior.

To download and install Vercel CLI, follow the instructions here.

All commands and options are listed in the following categories:

Category
Description
A list of commands from Vercel CLI.
Additional options for Vercel CLI commands.

Commands

Overview

The vercel command is used to deploy projects and can be used from either the root of the project directory or by providing a path to it.

Basic Usage

vercel

Using the vercel command from the root of a project directory.

Extended Usage

vercel [path-to-project]

Using the vercel command and supplying a path to the root directory of the project.

Project Linking

When running vercel in a directory for the first time, Vercel CLI needs to know which scope and Project you want to deploy your directory to. You can choose to either link an existing project or to create a new one.

Note: Project linking requires at least version 17 of Vercel CLI. If you have an earlier version, please update to the latest version.

vercel
? Set up and deploy “~/web/my-lovely-project”? [Y/n] y
? Which scope do you want to deploy to? My Awesome Team
? Link to existing project? [y/N] y
? What’s the name of your existing project? my-lovely-project
🔗 Linked to awesome-team/my-lovely-project (created .vercel and added it to .gitignore)

Linking an existing project when running vercel in a new directory.

Once set up, a new .vercel directory will be added to your directory. The .vercel directory contains both the organization and project id of your project. If you want unlink your directory, you can remove the .vercel directory.

You can use the --confirm option to skip these questions.

Framework Detection

When you create a new project, Vercel CLI will automatically detect the framework you are using and offer default project settings accordingly.

vercel
? Set up and deploy “~/web/my-new-project”? [Y/n] y
? Which scope do you want to deploy to? My Awesome Team
? Link to existing project? [y/N] n
? What’s your project’s name? my-new-project
? In which directory is your code located? my-new-project/
Auto-detected project settings (Next.js):
- Build Command: `next build` or `build` from `package.json`
- Output Directory: Next.js default
- Development Command: next dev --port $PORT
? Want to override the settings? [y/N]

Creating a new project with the vercel command.

When creating a new project, you will be provided with default Build Command, Output Directory, and Development Command options.

You can continue with the default project settings or overwrite them. You can also edit your project settings later in your project dashboard.

Global Options

The following global options can be passed when using the vercel command:

  • --debug
  • --force
  • --help

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel command, therefore, more information is provided.

Build Env

The --build-env option, shorthand -b, can be used to provide environment variables to the build step.

Usage Example
vercel --build-env [key1=value1 key2=value2 key3=value3]

Using the vercel command with the --build-env option.

Confirm

The --confirm option can be used to skip questions you are asked when setting up a new project. The questions will be answered with the provided defaults, inferred from vercel.json and the folder name.

Usage Example
vercel --confirm

Using the vercel command with the --confirm option.

Env

The --env option, shorthand -e, can be used to provide Environment Variables at Runtime.

Usage Example
vercel --env [key1=value1 key2=value2 key3=value3]

Using the vercel command with the --env option.

Name

Note: The --name option has been deprecated in favor of Project Linking, which allows you to link a Vercel Project to your local codebase when you runvercel.

The --name option, shorthand -n, can be used to provide a project name for a deployment.

Usage Example
vercel --name foo

Using the vercel command with the --name option.

No Clipboard

The --no-clipboard option, shorthand -C, can be used to prevent Vercel CLI from copying the deployment URL to the clipboard.

Usage Example
vercel --no-clipboard

Using the vercel command with the --no-clipboard option.

Prod

The --prod option can be used to create a deployment for a production domain specified in the project dashboard.

Usage Example
vercel --prod

Using the vercel command with the --prod option.

Public

The --public option can be used to ensures the source code is publicly available at the /_src path.

Usage Example
vercel --public

Using the vercel command with the --public option.

Regions

The --regions option can be used to specify which regions the deployments Serverless Functions should run in.

Usage Example
vercel --regions sfo1

Using the vercel command with the --regions option.

Version

The --version option can be used to verify the version of Vercel CLI currently being used.

Usage Example
vercel --version

Using the vercel command with the --version option.

Dev

The vercel dev command is used to replicate the Vercel deployment environment locally, allowing you to test your Serverless Functions, without requiring you to deploy each time a change is made.

Note: Before using the vercel dev command, make sure to install your project's dependencies.

Basic Usage

vercel dev

Using the vercel dev command from the root of a project directory.

Global Options

The following global options can be passed when using the vercel dev command:

  • --debug
  • --help

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel dev command, therefore, more information is provided.

Listen

The --listen option, shorthand -l, can be used to specify which port vercel dev runs on.

Usage Example
vercel dev --listen 5005

Using the vercel dev command with the --listen option.

Login

The vercel login command allows you to login to your Vercel account through Vercel CLI.

Basic Usage

vercel login

Using the vercel login command to login to a Vercel account.

Logout

The vercel logout command allows you to logout of your Vercel account through Vercel CLI.

Basic Usage

vercel logout

Using the vercel logout command to logout of a Vercel account.

Init

The vercel init command is used to initialize projects locally from the examples found in the Vercel repository.

Basic Usage

vercel init

Using the vercel init command to initialize a project locally.

Extended Usage

vercel init [project-name]

Using the vercel init command to initialize a specific project locally.

vercel init [project-name] [new-project-name]

Using the vercel init command to initialize a specific project locally and rename the directory.

Global Options

The following global options can be passed when using the vercel init command:

  • --debug
  • --help
  • --force

For more information on global options and their usage, refer to the options section.

Env

The vercel env command is used to manage Environment Variables under a Project, providing functionality to list, add, remove, and pull.

Basic Usage

vercel env ls

Using the vercel env command to list all Environment Variables under a Project.

vercel env add

Using the vercel env command to add an Environment Variable to a Project.

vercel env rm

Using the vercel env command to remove an Environment Variable from a Project.

vercel env pull

Using the vercel env command to download Development Environment Variables from the cloud and write to the .env file.

Extended Usage

vercel env ls [environment]

Using the vercel env command to list Environment Variables for a specific Environment under a Project.

vercel env add [name] [environment]

Using the vercel env command to add an Environment Variable to a Project.

vercel env add [name] [environment] < [file]

Using the vercel env command to add an Environment Variable to a Project using a local file as the value.

vercel env rm [name] [environment]

Using the vercel env command to remove an Environment Variable from a Project.

vercel env pull [file]

Using the vercel env command to download Development Environment Variables from the cloud and write to a specific file.

Global Options

The following global options can be passed when using the vercel env command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --token

For more information on global options and their usage, refer to the options section.

Secrets

The vercel secrets command is used to manage Secrets used in Environment Variables under an account, providing functionality to list, add, rename, and remove Secrets.

Basic Usage

vercel secrets list

Using the vercel secrets command to list all Secrets under an account.

Extended Usage

vercel secrets add [secret-name] [secret-value]

Using the vercel secrets command to add a Secret to an account.

vercel secrets rename [old-name] [new-name]

Using the vercel secrets command to rename a Secret under an account.

vercel secrets remove [secret-name]

Using the vercel secrets command to remove a Secret from an account.

Global Options

The following global options can be passed when using the vercel secrets command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Switch

The vercel switch command is used to switch to a different team scope when logged in with Vercel CLI. You can choose to select a team from a list of all those you are part of or specify a team when entering the command.

Basic Usage

vercel switch

Using the vercel switch command to change team scope with Vercel CLI.

Extended Usage

vercel switch [team-name]

Using the vercel switch command to change to a specific team scope with Vercel CLI.

Global Options

The following global options can be passed when using the vercel switch command:

  • --debug
  • --help

For more information on global options and their usage, refer to the options section.

Help

The vercel help command generates a list of all available Vercel CLI commands and options in the terminal. When combined with a second argument - a valid Vercel CLI command - it outputs more detailed information about that command.

Basic Usage

vercel help

Using the vercel help command to generate a list of Vercel CLI commands and options.

Extended Usage

vercel help [command]

Using the vercel help command to generate detailed information about a specific Vercel CLI command.

Inspect

The vercel inspect command is used to retrieve information about a deployment referenced either by its unique deployment URL or production domain.

Basic Usage

vercel inspect [unique-deployment-url]

Using the vercel inspect command to retrieve information about a specific deployment.

Extended Usage

vercel inspect [production-deployment-url]

Using the vercel inspect command to retrieve information about a production deployment.

Global Options

The following global options can be passed when using the vercel inspect command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

List

The vercel list command, which can be shortened to vercel ls, is used to provide a list of your deployments along with information about them.

Basic Usage

vercel list

Using the vercel list command to retrieve information about multiple deployments.

Extended Usage

vercel list [project-name]

Using the vercel list command to retrieve information about deployments for a specific project.

vercel list [project-name] [--meta foo=bar]

Using the vercel list command to retrieve information about deployments filtered by metadata.

Global Options

The following global options can be passed when using the vercel list command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel list command, therefore, more information is provided.

Listen

The --meta option, shorthand -m, can be used to filter results based on project metadata.

Usage Example
vercel list --meta key1=value1 key2=value2

Using the vercel list command with the --meta option.

Logs

The vercel logs command is used to retrieve logs data for a specific deployment.

Warning: This command is for advanced use only. You can find more detailed logs on the Deployment Overview page from the Vercel Dashboard.

Basic Usage

vercel logs [deployment-url]

Using the vercel logs command to retrieve logs for a specific deployment.

Global Options

The following global options can be passed when using the vercel logs command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel logs command, therefore, more information is provided.

All

The --all option, shorthand -a, can be used to receive access logs in addition to the regular logs output.

Usage Example
vercel logs --all

Using the vercel logs command with the --all option.

Follow

The --follow option, shorthand -f, can be used to watch for additional logs output.

Usage Example
vercel logs --follow

Using the vercel logs command with the --follow option.

Number

The --number option, shorthand -n, can be used to specify the number of log lines to output.

Usage Example
vercel logs --number 10

Using the vercel logs command with the --number option.

Output

The --output option, shorthand -o, can be used to specify the format of the logs output, this can be either short (default) or raw.

Usage Example
vercel logs --output raw

Using the vercel logs command with the --output option.

Since

The --since option can be used to return logs only after a specific date, using the ISO 8601 format.

Usage Example
vercel logs --since 2019-09-04T07:05:43+00:00

Using the vercel logs command with the --since option.

Query

The --query option, shorthand -q, can be used to return logs against a search query.

Usage Example
vercel logs --query foo

Using the vercel logs command with the --query option.

Until

The --until option can be used to return logs only up until a specific date, using the ISO 8601 format.

Usage Example
vercel logs --until 2019-09-04T07:05:43+00:00

Using the vercel logs command with the --until option.

Teams

The vercel teams command is used to manage teams under an account, providing functionality to list, add, and invite new members to teams.

Warning: This command is for advanced use only. You can manage teams with further options and greater control from the Vercel Dashboard.

Basic Usage

vercel teams list

Using the vercel teams command to list all teams under an account.

Extended Usage

vercel teams add

Using the vercel teams command to create a new team.

vercel teams invite [email]

Using the vercel teams command to invite a new member to a team.

Global Options

The following global options can be passed when using the vercel teams command:

  • --debug
  • --global-config
  • --help
  • --local-config

For more information on global options and their usage, refer to the options section.

Domains

The vercel domains command is used to manage domains under an account, providing functionality to list, inspect, add, remove, purchase, move, transfer-in, and verify domains.

Warning: This command is for advanced use only. You can manage domains with further options and greater control under a project's Domains tab from the Vercel Dashboard.

Basic Usage

vercel domains ls

Using the vercel domains command to list all domains under an account.

Extended Usage

vercel domains inspect [domain]

Using the vercel domains command to retrieve information about a specific domain.

vercel domains add [domain]

Using the vercel domains command to add a domain to an account.

vercel domains rm [domain]

Using the vercel domains command to remove a domain from an account.

vercel domains buy [domain]

Using the vercel domains command to buy a domain for an account.

vercel domains move [domain] [account-name]

Using the vercel domains command to move a domain to another account.

vercel domains transfer-in [domain]

Using the vercel domains command to transfer in a domain to an account.

vercel domains verify [domain]

Using the vercel domains command to verify a domain for an account.

Global Options

The following global options can be passed when using the vercel domains command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

DNS

The vercel dns command is used to manage DNS record for domains, providing functionality to list, add, remove, and import records.

Warning: This command is for advanced use only. When adding DNS records, please wait up to 24 hours for new records to propagate.

Basic Usage

vercel dns ls

Using the vercel dns command to list all DNS records under an account.

Extended Usage

vercel dns add [domain] [subdomain] [A || AAAA || ALIAS || CNAME || TXT] [value]

Using the vercel dns command to add an A record for a subdomain.

vercel dns add [domain] '@' MX [record-value] [priority]

Using the vercel dns command to add an MX record for a domain.

vercel dns add [domain] [name] SRV [priority] [weight] [port] [target]

Using the vercel dns command to add an SRV record for a domain.

vercel dns add [domain] [name] CAA '[flags] [tag] "[value]"'

Using the vercel dns command to add a CAA record for a domain.

vercel dns rm [record-id]

Using the vercel dns command to remove a record for a domain.

vercel dns import [domain] [path-to-zonefile]

Using the vercel dns command to import a zonefile for a domain.

Global Options

The following global options can be passed when using the vercel dns command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Whoami

The vercel whoami command is used to show the username of the user currently logged into Vercel CLI.

Warning: This command is for advanced use only. You can see the name of the currently active account with the vercel switch command.

Basic Usage

vercel whoami

Using the vercel whoami command to view the username of the user currently logged into Vercel CLI.

Global Options

The following global options can be passed when using the vercel whoami command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --token

For more information on global options and their usage, refer to the options section.

Remove

The vercel remove command, which can be shortened to vercel rm, is used to remove deployments either by ID or for a specific project.

Warning: This command is for advanced use only. Although unlikely you will be required to, you can remove deployments from the Project Overview page on the Vercel Dashboard.

Basic Usage

vercel remove [deployment-url]

Using the vercel remove command to remove a deployment from the Vercel platform.

Extended Usage

vercel remove [deployment-url-1 deployment-url-2]

Using the vercel remove command to remove multiple deployments from the Vercel platform.

vercel remove [project-name]

Using the vercel remove command to remove all deployments for a project from the Vercel platform.

Warning: By using the project name, the entire project will be removed from the account unless the --safe is used.

Global Options

The following global options can be passed when using the vercel remove command:

  • --debug
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel remove command, therefore, more information is provided.

Safe

The --safe option, shorthand -s, can be used to skip the removal of deployments with an active preview URL or production domain when a project is provided as the parameter.

Usage Example
vercel remove my-project --safe

Using the vercel remove command with the --safe option.

Yes

The --yes option, shorthand -y, can be used to skip the confirmation step for a deployment or project removal.

Usage Example
vercel remove my-deployment.com --yes

Using the vercel remove command with the --yes option.

Certs

The vercel certs command is used to manage certificates for domains, providing functionality to list, issue, and remove them.

Warning: This command is intended for advanced use only. Vercel manages certificates for domains automatically.

Basic Usage

vercel certs ls

Using the vercel certs command to list all certificates under an account.

Extended Usage

vercel certs issue [domain1, domain2, domain3]

Using the vercel certs command to issue certificates for multiple domains.

vercel certs rm [certificate-id]

Using the vercel certs command to remove a certificate by ID.

Global Options

The following global options can be passed when using the vercel certs command:

  • --debug
  • --force
  • --global-config
  • --help
  • --local-config
  • --scope
  • --token

For more information on global options and their usage, refer to the options section.

Unique Options

These are options that only apply to the vercel certs command, therefore, more information is provided.

Challenge Only

The --challenge-only option can be used to only show the challenges needed to issue a certificate.

Usage Example
vercel certs issue foo.com --challenge-only

Using the vercel certs command with the --challenge-only option.

Certificate Files

The --crt, --key and --ca options must be used together to upload certificate files for a domain.

Usage Example
vercel certs add foo.com --crt foo.crt --key bar.pem --ca foobar.ca

Using the vercel certs command with the --crt, --key, and --ca options.


Options

This section contains information about the two types of options available to pass when using Vercel CLI commands, unique and global.

To understand which options can be used with a particular command, take a look at the specific command for more information.

Unique Options

Unique options relate only to a single Vercel CLI command and as such, are documented in full in the command section they relate to.

When using unique options, some of the shorthands may conflict with those of global options, this only occurs when the particular global option is not available for that command.

Global Options

Global options are commonly available to use with multiple Vercel CLI commands.

Debug

The --debug option, shorthand -d, can be used to provide a more verbose output when running Vercel CLI commands.

Usage Example

vercel --debug

Using the vercel command with the --debug option.

Force

The --force option, shorthand -f, is used either to force a deployment where there have been no changes or to forcibly replace an existing local directory.

Usage Example

vercel --force

Using the vercel command with the --force option.

vercel init gatsby my-project-directory --force

Using the vercel init command with the --force option.

Global Config

The --global-config option, shorthand -Q, can be used set the path to the global /.vercel directory.

Usage Example

vercel --global-config /path-to/.vercel

Using the vercel command with the --global-config option.

Help

The --help option, shorthand -h, can be used to display more information about Vercel CLI commands.

Usage Example

vercel --help

Using the vercel command with the --help option.

vercel secrets --help

Using the vercel secrets command with the --help option.

Local Config

The --local-config option, shorthand -A, can be used set the path to a local vercel.json file.

Usage Example

vercel --local-config /path-to/vercel.json

Using the vercel command with the --local-config option.

Scope

The --scope option, shorthand -S, can be used to execute Vercel CLI commands from a different team or user account than is currently active.

Usage Example

vercel --scope my-team-name

Using the vercel command with the --scope option.

Token

The --token option, shorthand -t, can be used to execute Vercel CLI commands with an authorization token.

Usage Example

vercel --token iZJb2oftmY4ab12HBzyBXMkp

Using the vercel command with the --token option.