Command Line Interface

VuePress CLI is provided by @vuepress/cliCommand Line Interface - 图1open in new window package. It is a dependency of the vuepressCommand Line Interface - 图2open in new window package, and you can also install it separately.

Run vuepress --help to get following help messages:

  1. Usage:
  2. $ vuepress <command> [options]
  3. Commands:
  4. dev [sourceDir] Start development server
  5. build [sourceDir] Build to static site
  6. info Display environment information
  7. For more info, run any command with the `--help` flag:
  8. $ vuepress dev --help
  9. $ vuepress build --help
  10. $ vuepress info --help
  11. Options:
  12. -v, --version Display version number
  13. -h, --help Display this message

TIP

VuePress is using debugCommand Line Interface - 图3open in new window module.

Set environment variable DEBUG=vuepress* to enable debug logs.

dev

Start a development server to develop your VuePress site locally.

  1. Usage:
  2. $ vuepress dev [sourceDir]
  3. Options:
  4. -c, --config <config> Set path to config file
  5. -p, --port <port> Use specified port (default: 8080)
  6. -t, --temp <temp> Set the directory of the temporary files
  7. --host <host> Use specified host (default: 0.0.0.0)
  8. --cache <cache> Set the directory of the cache files
  9. --clean-temp Clean the temporary files before dev
  10. --clean-cache Clean the cache files before dev
  11. --open Open browser when ready
  12. --debug Enable debug mode
  13. --no-watch Disable watching page and config files (default: true)
  14. -v, --version Display version number
  15. -h, --help Display this message

TIP

Options set by CLI will override those options with the same name in your config file.

build

Build your VuePress site to static files, which are ready for deployment.

  1. Usage:
  2. $ vuepress build [sourceDir]
  3. Options:
  4. -c, --config <config> Set path to config file
  5. -d, --dest <dest> Set the directory build output (default: .vuepress/dist)
  6. -t, --temp <temp> Set the directory of the temporary files
  7. --cache <cache> Set the directory of the cache files
  8. --clean-temp Clean the temporary files before build
  9. --clean-cache Clean the cache files before build
  10. --debug Enable debug mode
  11. -v, --version Display version number
  12. -h, --help Display this message

TIP

Options set by CLI will override those options with the same name in your config file.

info

Outputs information about your system and dependencies.

This command would be helpful when you want to check your environment or report an issue.