UNPKG

1.44 kBMarkdownView Raw
1# Netlify CLI
2
3The Netlify CLI tools lets you create, deploy, and delete new sites straight from your terminal.
4
5This CLI utility is deprecated in favor of [netlifyctl](https://github.com/netlify/netlifyctl) which is the currently maintained CLI utility.
6
7## Installation
8
9To install the CLI tools:
10
11```bash
12npm install netlify-cli -g
13```
14
15## Usage
16
17Deploy a front-end project that lives in `my-project` and builds to `dist` directory:
18
19```bash
20cd my-project/
21netlify deploy dist
22```
23
24## Configuration and Authentication
25
26The first time you use the netlify cli command you'll be asked to authenticate.
27
28Your access token is stored in `~/.netlify/config`.
29
30Netlify also stores a local `.netlify` file in the folder where you run `netlify deploy` from where the `site_id` is stored.
31
32## Environments
33
34You can easily setup different environments like `staging` or `production`. Just use the `-e` flag:
35
36```bash
37netlify deploy dist -e production
38```
39
40Netlify creates different sites with each their own URL for each of your environments and keeps track of them in the `.netlify` config file.
41
42## Caveats
43
44- netlify-cli is known to hang with an "ECONNRESET" error (parsed as JSON, it will look odd) when used from many CI environments. This is a known issue that is only fixed in our alternate and current CLI: https://github.com/netlify/netlifyctl
45
46- netlify-cli is known to hang when used with Node.js version 8.1.0. Version 8.1.2 works well