UNPKG

6.13 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]
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 * [deploy](#deploy)
22 * [dev](#dev)
23 * [functions](#functions)
24 * [init](#init)
25 * [link](#link)
26 * [login](#login)
27 * [open](#open)
28 * [sites](#sites)
29 * [status](#status)
30 * [switch](#switch)
31 * [unlink](#unlink)
32 * [watch](#watch)
33- [Contributing](#contributing)
34- [Development](#development)
35- [License](#license)
36
37</details>
38<!-- AUTO-GENERATED-CONTENT:END -->
39
40## Installation
41
42Netlify CLI requires [Node.js](https://nodejs.org) version 8 or above. To install, run the following command from any directory in your terminal:
43
44```bash
45npm install netlify-cli -g
46```
47
48Alternatively you may also use Homebrew: `brew install netlify-cli` (thanks [@cglong](https://github.com/netlify/cli/issues/291)).
49
50## Usage
51
52Installing the CLI globally provides access to the `netlify` command.
53
54```sh-session
55netlify [command]
56
57# Run `help` for detailed information about CLI commands
58netlify [command] help
59```
60
61## Documentation
62
63To learn how to log in to Netlify and start deploying sites, visit the [documentation on Netlify](https://www.netlify.com/docs/cli).
64
65For a full command reference, see the list below, or visit [cli.netlify.com](https://cli.netlify.com/).
66
67## Commands
68
69<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_LIST) -->
70### [addons](/docs/commands/addons.md)
71
72(Beta) Manage Netlify Add-ons
73
74| Subcommand | description |
75|:--------------------------- |:-----|
76| [`addons:auth`](/docs/commands/addons.md#addonsauth) | Login to add-on provider |
77| [`addons:config`](/docs/commands/addons.md#addonsconfig) | Configure add-on settings |
78| [`addons:create`](/docs/commands/addons.md#addonscreate) | Add an add-on extension to your site |
79| [`addons:delete`](/docs/commands/addons.md#addonsdelete) | Remove an add-on extension to your site |
80| [`addons:list`](/docs/commands/addons.md#addonslist) | List currently installed add-ons for site |
81
82
83### [api](/docs/commands/api.md)
84
85Run any Netlify API method
86
87### [deploy](/docs/commands/deploy.md)
88
89Create a new deploy from the contents of a folder
90
91### [dev](/docs/commands/dev.md)
92
93Local dev server
94
95| Subcommand | description |
96|:--------------------------- |:-----|
97| [`dev:exec`](/docs/commands/dev.md#devexec) | Exec command |
98
99
100### [functions](/docs/commands/functions.md)
101
102Manage netlify functions
103
104| Subcommand | description |
105|:--------------------------- |:-----|
106| [`functions:build`](/docs/commands/functions.md#functionsbuild) | Build functions locally |
107| [`functions:create`](/docs/commands/functions.md#functionscreate) | Create a new function locally |
108| [`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 |
109
110
111### [init](/docs/commands/init.md)
112
113Configure continuous deployment for a new or existing site
114
115### [link](/docs/commands/link.md)
116
117Link a local repo or project folder to an existing site on Netlify
118
119### [login](/docs/commands/login.md)
120
121Login to your Netlify account
122
123### [open](/docs/commands/open.md)
124
125Open settings for the site linked to the current folder
126
127| Subcommand | description |
128|:--------------------------- |:-----|
129| [`open:admin`](/docs/commands/open.md#openadmin) | Opens current site admin UI in Netlify |
130| [`open:site`](/docs/commands/open.md#opensite) | Opens current site url in browser |
131
132
133### [sites](/docs/commands/sites.md)
134
135Handle various site operations
136
137| Subcommand | description |
138|:--------------------------- |:-----|
139| [`sites:create`](/docs/commands/sites.md#sitescreate) | Create an empty site (advanced) |
140| [`sites:delete`](/docs/commands/sites.md#sitesdelete) | Delete a site |
141| [`sites:list`](/docs/commands/sites.md#siteslist) | List all sites you have access to |
142
143
144### [status](/docs/commands/status.md)
145
146Print status information
147
148| Subcommand | description |
149|:--------------------------- |:-----|
150| [`status:hooks`](/docs/commands/status.md#statushooks) | Print hook information of the linked site |
151
152
153### [switch](/docs/commands/switch.md)
154
155Switch your active Netlify account
156
157### [unlink](/docs/commands/unlink.md)
158
159Unlink a local folder from a Netlify site
160
161### [watch](/docs/commands/watch.md)
162
163Watch for site deploy to finish
164
165
166<!-- AUTO-GENERATED-CONTENT:END -->
167
168## Contributing
169
170See [CONTRIBUTING.md](CONTRIBUTING.md) for more info on how to make contributions to this project.
171
172## Development
173
174You'll need to follow these steps to run Netlify CLI locally:
175
176 uninstall any globally installed versions of netlify-cli
177 clone and install deps for https://github.com/netlify/cli
178 npm link from inside the cli folder
179
180Now you're both ready to start testing and to contribute to the project!
181
182## License
183
184MIT. See [LICENSE](LICENSE) for more details.
185
186[npm-img]: https://img.shields.io/npm/v/netlify-cli.svg
187[npm]: https://npmjs.org/package/netlify-cli
188[av-img]: https://ci.appveyor.com/api/projects/status/imk2qjc34ly7x11b/branch/master?svg=true
189[av]: https://ci.appveyor.com/project/netlify/cli
190[dl-img]: https://img.shields.io/npm/dm/netlify-cli.svg
191[dl]: https://npmjs.org/package/netlify-cli
192[david-img]: https://david-dm.org/netlify/cli/status.svg
193[david]: https://david-dm.org/netlify/cli
194[netlify-img]: https://api.netlify.com/api/v1/badges/d3807379-2dcf-4a43-9c00-e7e8d90ecf70/deploy-status
195[netlify]: https://app.netlify.com/sites/cli/deploys