Commands
The Now CLI provides a complete set of commands that allow you to deploy and manage your projects. This section contains a complete list of all Now CLI commands available, alongside their optional parameters.
The optional parameters can be used to influence the behavior of each command, you can read more about these in the options section.
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
Extended Usage
now [path-to-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]
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]
Name
The --name
option, shorthand -n
, can be used to provide a project name for a deployment.
Usage Example
now --name foo
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
Prod
The --prod
option can be used to create a deployment for a production domain specified in the project dashboard.
Usage Example
now --prod
Public
The --public
option can be used to ensures the source code is publicly available at the /_src
path.
Usage Example
now --public
Regions
The --regions
option can be used to specify which regions the deployments Serverless Functions should run in.
Usage Example
now --regions sfo1
Version
The --version
option can be used to verify the version of Now CLI currently being used.
Usage Example
now --version
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.Basic Usage
now dev
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
Login
The now login
command allows you to login to your ZEIT account through Now CLI.
Basic Usage
now login
Logout
The now logout
command allows you to logout of your ZEIT account through Now CLI.
Basic Usage
now logout
Init
The now init
command is used to initialize projects locally from the Now Examples repository.
Basic Usage
now init
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
Extended Usage
now secrets add [secret-name] [secret-value]
now secrets rename [old-name] [new-name]
now secrets remove [secret-name]
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
Extended Usage
now switch [team-name]
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
Extended Usage
now help [command]
Inspect
The now inspect
command is used to retrieve information about a deployment referenced either by its unique deployment URL or alias.
Basic Usage
now inspect [unique-deployment-url]
Extended Usage
now inspect [aliased-deployment-url]
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
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
Logs
The now logs
command is used to retrieve logs data for a specific deployment.
Basic Usage
now logs [deployment-url]
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
Follow
The --follow
option, shorthand -f
, can be used to watch for additional logs output.
Usage Example
now logs --follow
Number
The --number
option, shorthand -n
, can be used to specify the number of log lines to output.
Usage Example
now logs --number 10
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
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
Query
The --query
option, shorthand -q
, can be used to return logs against a search query.
Usage Example
now logs --query foo
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
Teams
The now teams
command is used to manage teams under an account, providing functionality to list, add, and invite new members to teams.
Basic Usage
now teams list
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.
Basic Usage
now domains ls
Extended Usage
now domains inspect [domain]
now domains add [domain]
now domains rm [domain]
now domains buy [domain]
now domains move [domain] [account-name]
now domains transfer-in [domain]
now domains verify [domain]
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.
Basic Usage
now dns ls
Extended Usage
now dns add [domain] [subdomain] [A || AAAA || ALIAS || CNAME || TXT] [value]
now dns add [domain] '@' MX [record-value] [priority]
now dns add [domain] [name] SRV [priority] [weight] [port] [target]
now dns add [domain] [name] CAA '[flags] [tag] "[value]"'
now dns rm [record-id]
now dns import [domain] [path-to-zonefile]
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
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]
Extended Usage
now remove [deployment-url-1 deployment-url-2]
now remove [project-name]
--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 alias when a project is provided as the parameter.
Usage Example
now remove my-project --safe
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
Certs
The now certs
command is used to manage certificates for domains, providing functionality to list, issue, and remove them.
Basic Usage
now certs ls
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
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
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
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
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
now init gatsby my-project-directory --force
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
Help
The --help
option, shorthand -h
, can be used to display more information about Now CLI commands.
Usage Example
now --help
now secrets --help
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
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
Token
The --token
option, shorthand -t
, can be used to execute Now CLI commands with an authorization token.
Usage Example
now --token iZJb2oftmY4ab12HBzyBXMkp