1 | # Netlify CLI
|
2 |
|
3 | The Netlify CLI tools lets you create, deploy, and delete new sites straight from your terminal.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | To install the CLI tools:
|
8 |
|
9 | ```bash
|
10 | npm install netlify-cli -g
|
11 | ```
|
12 |
|
13 | ## Usage
|
14 |
|
15 | Deploy a front-end project that lives in `my-project` and builds to `dist` directory:
|
16 |
|
17 | ```bash
|
18 | cd my-project/
|
19 | netlify deploy dist
|
20 | ```
|
21 |
|
22 | ## Configuration and Authentication
|
23 |
|
24 | The first time you use the netlify cli command you'll be asked to authenticate.
|
25 |
|
26 | Your access token is stored in `~/.netlify/config`.
|
27 |
|
28 | Netlify also stores a local `.netlify` file in the folder where you run `netlify deploy` from where the `site_id` is stored.
|
29 |
|
30 | ## Environments
|
31 |
|
32 | You can easily setup different environments like `staging` or `production`. Just use the `-e` flag:
|
33 |
|
34 | ```bash
|
35 | netlify deploy dist -e production
|
36 | ```
|
37 |
|
38 | Netlify creates different sites with each their own URL for each of your environments and keeps track of them in the `.netlify` config file.
|