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.
To download and install Now CLI, follow the instructions here.
All commands and options are listed in the following categories:
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.
Extended Usage
now [path-to-project]
Using the now command and supplying a path to the root directory of the project.
Project Linking
When running now in a directory for the first time, Now 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.
now ? 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 .now and added it to .gitignore)
Linking an existing project when running now in a new directory.
Once set up, a new .now directory will be added to your directory. The .now directory contains
both the organization and project id of your project. If you want unlink your directory, you can remove the .now directory.
You can use the--confirm option to skip these questions.
Framework Detection
When you create a new project, Now CLI will automatically detect the framework you are using and offer default project settings accordingly.
now ? 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 now 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 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.
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 now.json and the folder name.
Usage Example
now --confirm
Using the now command with the --confirm 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
--name option has been deprecated in favor of Project Linking, which allows you to link a ZEIT Now Project to your local codebase when you runnow.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.
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.
now dev command, make sure to install your project's dependencies.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.
Init
The now init command is used to initialize projects locally from the examples found in the ZEIT Now repository.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
--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.
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.
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.
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
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.
Token
The --token option, shorthand -t, can be used to execute Now CLI commands with an authorization token.