You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+27-5
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,49 @@ Netlify CLI plugin for local dev experience.
4
4
5
5
## What is Netlify Dev?
6
6
7
-
Netlify Dev brings the power of Netlify's Edge Logic layer, serverless functions and [add-on ecosystem](#using-add-ons) to your local laptop. It runs Netlify's production routing engine in a local dev server to make all redirects, proxy rules, function routes or add-on routes available locally and injects the correct environment variables from your site environment, installed add-ons or your netlify.toml file into your build and function environment.
7
+
Netlify Dev brings the power of Netlify's Edge Logic layer, [serverless functions](#netlify-functions) and [add-on ecosystem](#using-add-ons) to your local machine. It runs Netlify's production routing engine in a local dev server to make all redirects, proxy rules, function routes or add-on routes available locally and injects the correct environment variables from your site environment, installed add-ons or your netlify.toml file into your build and function environment.
8
8
9
9
It automatically detects common tools like Gatsby, Hugo, React Static, Eleventy, and more, to give a zero config setup for your local dev server and can help scaffolding new functions as you work on them.
10
10
11
+
## Prerequisites
12
+
13
+
There are just two:
14
+
15
+
- You should be [logged in on Netlify CLI](https://www.netlify.com/docs/cli/#authentication)
16
+
- Your project should be linked to a `siteID` on Netlify (using [netlify init](https://www.netlify.com/docs/cli/#continuous-deployment) or [netlify link](https://www.netlify.com/docs/cli/#linking-and-unlinking-sites)). You can confirm this has been done if you have a `.netlify` folder with a `state.json` file containing your `siteID`.
17
+
18
+
This is how we pull down your build environment variables and manage your addons on your local machine.
19
+
11
20
## Usage
12
21
13
22
-`netlify dev` start a local dev server for the build tool you're using
14
23
-`netlify dev:exec <command>` runs a shell command within the netlify dev environment
15
24
-`netlify functions:create` bootstrap a new function
16
25
26
+
As these commands are expected to be frequently used, it may be helpful to define aliases in your terminal (Mac: [bash](https://jonsuh.com/blog/bash-command-line-shortcuts/), [zsh](https://askubuntu.com/questions/758496/how-to-make-a-permanent-alias-in-oh-my-zsh), Windows: [doskey](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt), [registry](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt)) to your personal preference. For example:
27
+
28
+
```bash
29
+
## ~/.zshrc
30
+
alias ndeploy="netlify deploy --prod"
31
+
alias nd="netlify dev"
32
+
alias ndl="netlify dev --live"
33
+
alias nfc="netlify functions:create"
34
+
alias ndx="netlify dev:exec "
35
+
```
36
+
17
37
## Using the beta
18
38
19
39
Currently the Netlify dev plugin is in private beta. You'll need to follow these steps to enable it:
20
40
21
41
Make sure Netlify CLI is installed and up to date:
@@ -161,7 +181,7 @@ Add-ons are a way for Netlify users to extend the functionality of their Jamstac
161
181
162
182
To try out an add-on with Netlify dev, run the `netlify addons:create` command:
163
183
164
-
```
184
+
```bash
165
185
netlify addons:create fauna
166
186
```
167
187
@@ -175,8 +195,10 @@ After you have installed an add-on, it will be visible with the `netlify addons:
175
195
176
196
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
177
197
178
-
```
198
+
```bash
179
199
netlify dev --live
180
200
```
181
201
182
202
You will get a URL that looks like `https://clever-cray-2aa156-6639f3.netlify.live/`. This can be accessed by anyone as long as you keep your session open.
203
+
204
+
> Note: there are currently known issues with ending the live session alongside your webdevserver. We are working on fixing it. In the mean time you can run `ps aux | grep live-tunnel` and kill these sessions manually.
0 commit comments