Visitar URL original
Vercel CLI Global OptionsSkip to content

Vercel CLI Global Options

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

The --cwd option can be used to provide a working directory (that can be different from the current directory) when running Vercel CLI commands.

This option can be a relative or absolute path.

terminal
vercel --cwd ~/path-to/project

Using the vercel command with the --cwd option.

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

terminal
vercel --debug

Using the vercel command with the --debug option.

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

terminal
vercel --global-config /path-to/global-config-directory

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

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

terminal
vercel --help

Using the vercel command with the --help option.

terminal
vercel alias --help

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

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

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

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

The --scope option, shorthand -S, runs a Vercel CLI command against a specific team without switching your current team. vercel login is the exception: it saves that team as your current team. Pass the team's slug or ID:

terminal
vercel --scope my-team-slug

Using the vercel command with the --scope option.

You can specify which Vercel Project to use for a CLI command in three ways:

  1. --project flag: Pass a project name or ID directly to the command
  2. VERCEL_PROJECT_ID environment variable: Set the project ID as an environment variable, together with VERCEL_ORG_ID (the ID of the team that owns the project)
  3. Project linking: Use the .vercel directory created by vercel link

If you provide multiple options, the CLI uses this precedence order (highest to lowest):

  1. --project flag
  2. VERCEL_PROJECT_ID environment variable
  3. .vercel/project.json from project linking
terminal
# Using the --project flag with a project name
vercel deploy --project my-project
 
# Using the --project flag with a project ID
vercel deploy --project prj_abc123
 
# Using the environment variables
VERCEL_ORG_ID=team_abc123 VERCEL_PROJECT_ID=prj_abc123 vercel deploy

Different ways to specify the project for a Vercel CLI command.

The --project flag and VERCEL_PROJECT_ID both accept a project name or project ID. When using CI/CD pipelines or non-interactive environments, set VERCEL_ORG_ID and VERCEL_PROJECT_ID as environment variables to skip project linking. If you set only one of them and don't pass --project, commands that need a project, such as vercel deploy, exit with an error. See using Vercel CLI for custom workflows for more details.

You can authenticate Vercel CLI commands with an authorization token in two ways:

  1. --token flag (shorthand -t): Pass the token directly to the command
  2. VERCEL_TOKEN environment variable: Set the token as an environment variable

If both are provided, the --token flag takes precedence over the environment variable.

Using the VERCEL_TOKEN environment variable is recommended for CI/CD pipelines because it avoids exposing the token in command-line arguments, which can be visible in process lists and logs.

To deploy without a token or login, run vercel deploy --temporary. See Deploying without logging in.

terminal
vercel --token vcp_7ceTtedqEf96eTe7Mw32n9gjfSo23kHBHAbTrchMINrvUMZv0EXAMPLE

Using the vercel command with the --token option.

terminal
export VERCEL_TOKEN=vcp_7ceTtedqEf96eTe7Mw32n9gjfSo23kHBHAbTrchMINrvUMZv0EXAMPLE
vercel deploy

Using the VERCEL_TOKEN environment variable to authenticate.

The --no-color option, or NO_COLOR=1 environment variable, can be used to execute Vercel CLI commands with no color or emoji output. This respects the NO_COLOR standard.

terminal
vercel login --no-color

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

The --version option, shorthand -v, outputs the current version number of Vercel CLI.

terminal
vercel --version

Using the vercel command with the --version option to display the CLI version.

The --non-interactive option runs a Vercel CLI command without interactive prompts. Use it for CI/CD pipelines, scripts, and agent environments. When the CLI detects that it is running under an agent, non-interactive mode is the default.

terminal
vercel deploy --non-interactive

Using the vercel deploy command with the --non-interactive option.

Use the CLI's exit code to distinguish success, operational failures, and usage errors in scripts:

CodeMeaningExamples
0Success or helpA successful command, vercel --help, or a bare command group such as vercel env
1Operational failureA failed API request or deployment build
2Usage errorAn unknown option or subcommand, a missing argument or option value, or an invalid flag value

--help and bare command groups print help to stdout and exit 0. Help for a command path that doesn't exist exits 2.

Some commands return other exit codes. For example, vercel env run exits with the exit code of the command that it runs.

vercel inspect --wait exits 1 when its wait times out while the deployment is still in progress.

Last updated November 14, 2026

Was this helpful?

supported.