Command Line Interface#

The livereload command can be used for starting a live-reloading server, that serves a directory.

$ livereload --help
usage: livereload [-h] [--host HOST] [-p PORT] [-t TARGET] [-w WAIT]
                  [-o OPEN_URL_DELAY] [-d]

Start a `livereload` server

positional arguments:
  directory             Directory to serve files from

  -h, --help            show this help message and exit
  --host HOST           Hostname to run `livereload` server on
  -p PORT, --port PORT  Port to run `livereload` server on
  -t TARGET, --target TARGET
                        File or directory to watch for changes
  -w WAIT, --wait WAIT  Time delay in seconds before reloading
  -o OPEN_URL_DELAY, --open-url-delay OPEN_URL_DELAY
                        If set, triggers browser opening <D> seconds after
  -d, --debug           Enable Tornado pretty logging

It will listen to port 35729 by default, since that’s the usual port for LiveReload browser extensions.

Changed in version 2.0.0: Guardfile is no longer supported. Write a Python script using the API instead.