| title | Netlify CLI dev command |
|---|---|
| description | Run netlify dev locally |
Local dev server The dev command will run a local dev server with Netlify's proxy and redirect rules
Usage
netlify devFlags
command(string) - command to runcontext(string) - Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")country(string) - Two-letter country code (https://ntl.fyi/country-codes) to use as mock geolocation (enables --geo=mock automatically)dir(string) - dir with static filesedgeInspect(string) - enable the V8 Inspector Protocol for Edge Functions, with an optional address in the host:port formatedgeInspectBrk(string) - enable the V8 Inspector Protocol for Edge Functions and pause execution on the first line of code, with an optional address in the host:port formatframework(string) - framework to use. Defaults to #auto which automatically detects a frameworkfunctions(string) - specify a functions folder to servefunctionsPort(string) - port of functions servergeo(cache | mock | update) - force geolocation data to be updated, use cached data from the last 24h if found, or use a mock locationlive(boolean) - start a public live sessionoffline(boolean) - disables any features that require network accessport(string) - port of netlify devsessionId(string) - (Graph) connect to cloud session with ID [sessionId]targetPort(string) - port of target app serverdebug(boolean) - Print debugging informationhttpProxy(string) - Proxy server address to route requests through.httpProxyCertificateFilename(string) - Certificate file to use when connecting using a proxy server
| Subcommand | description |
|---|---|
dev:exec |
Exec command |
Examples
netlify dev
netlify dev -d public
netlify dev -c "hugo server -w" --targetPort 1313
netlify dev --context production
netlify dev --graph
netlify dev --edgeInspect
netlify dev --edgeInspect=127.0.0.1:9229
netlify dev --edgeInspectBrk
netlify dev --edgeInspectBrk=127.0.0.1:9229
BROWSER=none netlify dev # disable browser auto openingExec command Runs a command within the netlify dev environment, e.g. with env variables from any installed addons
Usage
netlify dev:execArguments
- ...cmd - the command that should be executed
Flags
context(string) - Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")debug(boolean) - Print debugging informationhttpProxy(string) - Proxy server address to route requests through.httpProxyCertificateFilename(string) - Certificate file to use when connecting using a proxy server
Examples
netlify dev:exec npm run bootstrap