Now's Command Line Interface

The now CLI is the main interface to the Now platform.

It's available on macOS, Windows and Linux either via npm or as pre-built binaries. The recommended installation mechanism, however, is Now Desktop (which includes Now CLI and also ensures it's always up-to-date).

While the default behavior of now is to deploy, it also has a variety of sub commands grouped by different concerns.

The following are the most important commands in Now CLI:

SyntaxDescription
now [path] ...When you invoke now, the files within the current directory will be uploaded to Now and a new deployment will be created.

After that, you'll instantly receive its URL so that you can share it with other people around the globe.

The [path] can either be a file (leads to a static deployment) or a directory (the deployment type will be determined depending on the contents).

If you want to deploy multiple paths at once, read this.
now ls|list [app]Show a list of all deployments. If [app] is defined, it will only list the deployments under that namespace.
now rm|remove [id]Remove a deployment from our platform. The [id] parameter can either be the URL of your deployment (e.g. https://static-ytbbrhoggd.now.sh or the hostname (e.g. static-ytbbrhoggd.now.sh).
now ln|alias [id] [url]Let's you configure an alias for an existing deployment. You can read more about how to take the maximum of functionality out of this sub command here.
now domains [name]Allows you to manage your domain names directly from the command line (before using them as aliases with now alias). Read more about it here.
now certs [cmd]By default, Now will automatically provision certificates for your deployments. Using this sub command, you can see when they're expiring and upload your own ones (read more).
now secrets [name]Read more
now dns [name]Read more
now openRunning this sub command will open the latest deployment of the project within the current directory in your default browser (aliases won't be respected).

By default, running now will deploy the current working directory. In order to deploy a different path, pass it to the command:

now [path]

In certain cases, however, you might want to deploy multiple files or directories at once. This works the same way – just pass more paths to the command:

now [path] [path] ...

If you pass more than one path, all of them will be uploaded and bundled into a single static deployment on the server. The result will be a single URL.

Manage your account straight from your terminal:

SyntaxDescription
now billing|ccEasily add or remove credits cards from your account and adjust billing methods.
now upgrade|downgrade [plan]Switch your plan from within the command line interface. Even after the command is run, we don't require you to use a web interface. The whole process happens directly in your terminal.

To show the list of sub commands and options in your terminal, run this command:

now help

Now uses the metafiles inside your project to determine which files and directories should be uploaded to our platform and which ones should be ignored:

  • If .gitignore exists, we don't upload the contents that are defined in it
  • If .npmignore exists, we don't upload the contents that are defined in it and ignore the existence of .gitignore
  • If .dockerignore exists, we don't upload the contents that are defined in it and ignore the existence of .gitignore and .npmignore

But it will get a little tricky if you're using the files property inside package.json: In that case, we follow npm's behaviour. This means that if files exists (which as per definition defines which files should be uploaded), .npmignore will take precedence and have the final word on which items will be uploaded to Now.

This means that if you want to specify a list of files that should never be ignored when it comes to now, you should either use the now.files (not files) property inside package.json or the files property inside now.json:

"files": [
  "hello.png",
  "dist"
]

You can learn more about how to use this property here.