UNPKG

7.17 kBMarkdownView Raw
1# Netlify CLI
2
3[![npm version][npm-img]][npm] [![downloads][dl-img]][dl] [![netlify-status][netlify-img]][netlify] [![dependencies][david-img]][david][![FOSSA Status](https://app.fossa.com/api/projects/custom%2B17679%2Fgit%40github.com%3Anetlify%2Fcli.git.svg?type=shield)](https://app.fossa.com/projects/custom%2B17679%2Fgit%40github.com%3Anetlify%2Fcli.git?ref=badge_shield)
4
5Interact with [Netlify](http://netlify.com/) from the comfort of your CLI.
6
7See the [CLI command line reference](https://cli.netlify.com/commands/) to get started and the docs on using [Netlify Dev](https://github.com/netlify/cli/blob/master/docs/netlify-dev.md) to run your site locally.
8
9## Table of Contents
10
11<!-- AUTO-GENERATED-CONTENT:START (TOC:collapse=true&collapseText=Click to expand) -->
12<details>
13<summary>Click to expand</summary>
14
15- [Installation](#installation)
16- [Usage](#usage)
17- [Documentation](#documentation)
18- [Commands](#commands)
19 * [addons](#addons)
20 * [api](#api)
21 * [build](#build)
22 * [deploy](#deploy)
23 * [dev](#dev)
24 * [env](#env)
25 * [functions](#functions)
26 * [init](#init)
27 * [link](#link)
28 * [login](#login)
29 * [open](#open)
30 * [sites](#sites)
31 * [status](#status)
32 * [switch](#switch)
33 * [unlink](#unlink)
34 * [watch](#watch)
35- [Contributing](#contributing)
36- [Development](#development)
37- [License](#license)
38
39</details>
40<!-- AUTO-GENERATED-CONTENT:END -->
41
42## Installation
43
44Netlify CLI requires [Node.js](https://nodejs.org) version 8 or above. To install, run the following command from any directory in your terminal:
45
46```bash
47npm install netlify-cli -g
48```
49
50Alternatively you may also use Homebrew: `brew install netlify-cli` (thanks [@cglong](https://github.com/netlify/cli/issues/291)).
51
52## Usage
53
54Installing the CLI globally provides access to the `netlify` command.
55
56```sh-session
57netlify [command]
58
59# Run `help` for detailed information about CLI commands
60netlify [command] help
61```
62
63## Documentation
64
65To learn how to log in to Netlify and start deploying sites, visit the [documentation on Netlify](https://www.netlify.com/docs/cli).
66
67For a full command reference, see the list below, or visit [cli.netlify.com](https://cli.netlify.com/).
68
69## Commands
70
71<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_LIST) -->
72### [addons](/docs/commands/addons.md)
73
74(Beta) Manage Netlify Add-ons
75
76| Subcommand | description |
77|:--------------------------- |:-----|
78| [`addons:auth`](/docs/commands/addons.md#addonsauth) | Login to add-on provider |
79| [`addons:config`](/docs/commands/addons.md#addonsconfig) | Configure add-on settings |
80| [`addons:create`](/docs/commands/addons.md#addonscreate) | Add an add-on extension to your site |
81| [`addons:delete`](/docs/commands/addons.md#addonsdelete) | Remove an add-on extension to your site |
82| [`addons:list`](/docs/commands/addons.md#addonslist) | List currently installed add-ons for site |
83
84
85### [api](/docs/commands/api.md)
86
87Run any Netlify API method
88
89### [build](/docs/commands/build.md)
90
91(Beta) Build on your local machine
92
93### [deploy](/docs/commands/deploy.md)
94
95Create a new deploy from the contents of a folder
96
97### [dev](/docs/commands/dev.md)
98
99Local dev server
100
101| Subcommand | description |
102|:--------------------------- |:-----|
103| [`dev:exec`](/docs/commands/dev.md#devexec) | Exec command |
104
105
106### [env](/docs/commands/env.md)
107
108(Beta) Control environment variables for the current site
109
110| Subcommand | description |
111|:--------------------------- |:-----|
112| [`env:get`](/docs/commands/env.md#envget) | Get resolved value of specified environment variable (includes netlify.toml) |
113| [`env:import`](/docs/commands/env.md#envimport) | Import and set environment variables from .env file |
114| [`env:list`](/docs/commands/env.md#envlist) | Lists resolved environment variables for site (includes netlify.toml) |
115| [`env:set`](/docs/commands/env.md#envset) | Set value of environment variable |
116| [`env:unset`](/docs/commands/env.md#envunset) | Unset an environment variable which removes it from the UI |
117
118
119### [functions](/docs/commands/functions.md)
120
121Manage netlify functions
122
123| Subcommand | description |
124|:--------------------------- |:-----|
125| [`functions:build`](/docs/commands/functions.md#functionsbuild) | Build functions locally |
126| [`functions:create`](/docs/commands/functions.md#functionscreate) | Create a new function locally |
127| [`functions:invoke`](/docs/commands/functions.md#functionsinvoke) | Trigger a function while in netlify dev with simulated data, good for testing function calls including Netlify's Event Triggered Functions |
128
129
130### [init](/docs/commands/init.md)
131
132Configure continuous deployment for a new or existing site
133
134### [link](/docs/commands/link.md)
135
136Link a local repo or project folder to an existing site on Netlify
137
138### [login](/docs/commands/login.md)
139
140Login to your Netlify account
141
142### [open](/docs/commands/open.md)
143
144Open settings for the site linked to the current folder
145
146| Subcommand | description |
147|:--------------------------- |:-----|
148| [`open:admin`](/docs/commands/open.md#openadmin) | Opens current site admin UI in Netlify |
149| [`open:site`](/docs/commands/open.md#opensite) | Opens current site url in browser |
150
151
152### [sites](/docs/commands/sites.md)
153
154Handle various site operations
155
156| Subcommand | description |
157|:--------------------------- |:-----|
158| [`sites:create`](/docs/commands/sites.md#sitescreate) | Create an empty site (advanced) |
159| [`sites:delete`](/docs/commands/sites.md#sitesdelete) | Delete a site |
160| [`sites:list`](/docs/commands/sites.md#siteslist) | List all sites you have access to |
161
162
163### [status](/docs/commands/status.md)
164
165Print status information
166
167| Subcommand | description |
168|:--------------------------- |:-----|
169| [`status:hooks`](/docs/commands/status.md#statushooks) | Print hook information of the linked site |
170
171
172### [switch](/docs/commands/switch.md)
173
174Switch your active Netlify account
175
176### [unlink](/docs/commands/unlink.md)
177
178Unlink a local folder from a Netlify site
179
180### [watch](/docs/commands/watch.md)
181
182Watch for site deploy to finish
183
184
185<!-- AUTO-GENERATED-CONTENT:END -->
186
187## Contributing
188
189See [CONTRIBUTING.md](CONTRIBUTING.md) for more info on how to make contributions to this project.
190
191## Development
192
193You'll need to follow these steps to run Netlify CLI locally:
194
195 uninstall any globally installed versions of netlify-cli
196 clone and install deps for https://github.com/netlify/cli
197 npm link from inside the cli folder
198
199Now you're both ready to start testing and to contribute to the project!
200
201## License
202
203MIT. See [LICENSE](LICENSE) for more details.
204
205[npm-img]: https://img.shields.io/npm/v/netlify-cli.svg
206[npm]: https://npmjs.org/package/netlify-cli
207[av-img]: https://ci.appveyor.com/api/projects/status/imk2qjc34ly7x11b/branch/master?svg=true
208[av]: https://ci.appveyor.com/project/netlify/cli
209[dl-img]: https://img.shields.io/npm/dm/netlify-cli.svg
210[dl]: https://npmjs.org/package/netlify-cli
211[david-img]: https://david-dm.org/netlify/cli/status.svg
212[david]: https://david-dm.org/netlify/cli
213[netlify-img]: https://api.netlify.com/api/v1/badges/d3807379-2dcf-4a43-9c00-e7e8d90ecf70/deploy-status
214[netlify]: https://app.netlify.com/sites/cli/deploys