UNPKG

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