Introduction

Now CLI Reference

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

All commands and options are listed in the following categories:

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

Commands

Now

The now 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

now

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

Extended Usage

now [path-to-project]

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

Global Options

The following global options can be passed when using the now 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 now 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
now --build-env [key1=value1 key2=value2 key3=value3]

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

Env

The --env option, shorthand -e, can be used to provide environment variables at run time.

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

Using the now command with the --env option.

Name

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

Usage Example
now --name foo

Using the now command with the --name option.

No Clipboard

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

Usage Example
now --no-clipboard

Using the now 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
now --prod

Using the now 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
now --public

Using the now 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
now --regions sfo1

Using the now command with the --regions option.

Version

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

Usage Example
now --version

Using the now command with the --version option.

Dev

The now dev command is used to replicate the ZEIT Now 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 now dev command, make sure to install your project's dependencies.

Basic Usage

now dev

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

Global Options

The following global options can be passed when using the now 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 now dev command, therefore, more information is provided.

Listen

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

Usage Example
now dev --listen 5005

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

Login

The now login command allows you to login to your ZEIT account through Now CLI.

Basic Usage

now login

Using the now login command to login to a ZEIT account.

Logout

The now logout command allows you to logout of your ZEIT account through Now CLI.

Basic Usage

now logout

Using the now logout command to logout of a ZEIT account.

Init

The now init command is used to initialize projects locally from the Now Examples repository.

Basic Usage

now init

Using the now init command to initialize a project locally.

Extended Usage

now init [project-name]

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

now init [project-name] [new-project-name]

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

Global Options

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

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

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

Secrets

The now secrets command is used to manage Now Secrets under an account, providing functionality to list, add, rename, and remove Secrets.

Basic Usage

now secrets list

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

Extended Usage

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

Using the now secrets command to add a Now Secret to an account.

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

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

now secrets remove [secret-name]

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

Global Options

The following global options can be passed when using the now 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 now switch command is used to switch to a different team scope when logged in with Now 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

now switch

Using the now switch command to change team scope with Now CLI.

Extended Usage

now switch [team-name]

Using the now switch command to change to a specific team scope with Now CLI.

Global Options

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

  • --debug
  • --help

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

Help

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

Basic Usage

now help

Using the now help command to generate a list of Now CLI commands and options.

Extended Usage

now help [command]

Using the now help command to generate detailed information about a specific Now CLI command.

Inspect

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

Basic Usage

now inspect [unique-deployment-url]

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

Extended Usage

now inspect [production-deployment-url]

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

Global Options

The following global options can be passed when using the now 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 now list command, which can be shortened to now ls, is used to provide a list of your deployments along with information about them.

Basic Usage

now list

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

Extended Usage

now list [project-name]

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

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

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

Global Options

The following global options can be passed when using the now 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 now 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
now list --meta key1=value1 key2=value2

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

Logs

The now 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 ZEIT Dashboard.

Basic Usage

now logs [deployment-url]

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

Global Options

The following global options can be passed when using the now 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 now 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
now logs --all

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

Follow

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

Usage Example
now logs --follow

Using the now 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
now logs --number 10

Using the now 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
now logs --output raw

Using the now 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
now logs --since 2019-09-04T07:05:43+00:00

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

Query

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

Usage Example
now logs --query foo

Using the now 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
now logs --until 2019-09-04T07:05:43+00:00

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

Teams

The now 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 ZEIT Dashboard.

Basic Usage

now teams list

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

Extended Usage

now teams add

Using the now teams command to create a new team.

now teams invite [email]

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

Global Options

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

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

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

Domains

The now 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 ZEIT Dashboard.

Basic Usage

now domains ls

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

Extended Usage

now domains inspect [domain]

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

now domains add [domain]

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

now domains rm [domain]

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

now domains buy [domain]

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

now domains move [domain] [account-name]

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

now domains transfer-in [domain]

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

now domains verify [domain]

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

Global Options

The following global options can be passed when using the now 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 now 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

now dns ls

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

Extended Usage

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

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

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

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

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

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

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

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

now dns rm [record-id]

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

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

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

Global Options

The following global options can be passed when using the now 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 now whoami command is used to show the username of the user currently logged into Now CLI.

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

Basic Usage

now whoami

Using the now whoami command to view the username of the user currently logged into Now CLI.

Global Options

The following global options can be passed when using the now 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 now remove command, which can be shortened to now 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 ZEIT Dashboard.

Basic Usage

now remove [deployment-url]

Using the now remove command to remove a deployment from the ZEIT Now platform.

Extended Usage

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

Using the now remove command to remove multiple deployments from the ZEIT Now platform.

now remove [project-name]

Using the now remove command to remove all deployments for a project from the ZEIT Now 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 now 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 now 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
now remove my-project --safe

Using the now 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
now remove my-deployment.com --yes

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

Certs

The now 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. ZEIT Now manages certificates for domains automatically.

Basic Usage

now certs ls

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

Extended Usage

now certs issue [domain1, domain2, domain3]

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

now certs rm [certificate-id]

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

Global Options

The following global options can be passed when using the now 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 now 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
now certs issue foo.com --challenge-only

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

Challenge Only

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

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

Using the now 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
now certs add foo.com --crt foo.crt --key bar.pem --ca foobar.ca

Using the now 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 Now 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 Now 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 Now CLI commands.

Debug

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

Usage Example

now --debug

Using the now 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 the creation of a directory.

Usage Example

now --force

Using the now command with the --force option.

now init gatsby my-project-directory --force

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

Global Config

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

Usage Example

now --global-config /path-to/.now

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

Help

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

Usage Example

now --help

Using the now command with the --help option.

now secrets --help

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

Local Config

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

Usage Example

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

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

Scope

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

Usage Example

now --scope my-team-name

Using the now command with the --scope option.

Token

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

Usage Example

now --token iZJb2oftmY4ab12HBzyBXMkp

Using the now command with the --token option.