Netlify CLI


dev

Local dev server The dev command will run a local dev server with Netlify's proxy and redirect rules

Usage

netlify dev

Flags

  • command (string) - command to run
  • port (string) - port of netlify dev
  • targetPort (string) - port of target app server
  • dir (string) - dir with static files
  • functions (string) - specify a functions folder to serve
  • offline (boolean) - disables any features that require network access
  • live (boolean) - start a public live session
  • debug (boolean) - Print debugging information
  • httpProxy (string) - Proxy server address to route requests through.
  • httpProxyCertificateFilename (string) - Certificate file to use when connecting using a proxy server
Subcommanddescription
dev:execExec command
dev:traceTrace command

Examples

$ netlify dev
$ netlify dev -c "yarn start"
$ netlify dev -c hugo

dev:exec

Exec command Runs a command within the netlify dev environment, e.g. with env variables from any installed addons

Usage

netlify dev:exec

Flags

  • debug (boolean) - Print debugging information
  • httpProxy (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

dev:trace

Trace command Simulates Netlify's Edge routing logic to match specific requests. This command is designed to mimic cURL's command line, so the flags are more familiar.

Usage

netlify dev:trace

Arguments

  • url - Sets the request URL

Flags

  • request (string) - Specifies a custom request method [default: GET]
  • cookie (string) - Request cookie, this flag can be used multiple times. Example: "nf_jwt=token"
  • header (string) - Request header, this flag can be used multiple times. Example: "Host: netlify.test"
  • watch (string) - Path to the publish directory
  • debug (boolean) - Print debugging information

Examples

$ netlify dev:trace http://localhost/routing-path
$ netlify dev:trace -w dist-directory http://localhost/routing-path
$ netlify dev:trace -X POST http://localhost/routing-path
$ netlify dev:trace -H "Accept-Language es" http://localhost/routing-path
$ netlify dev:trace --cookie nf_jwt=token http://localhost/routing-path