Skip to content

Commit

Permalink
docs: refine cli documentation (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Haoran committed Mar 6, 2020
1 parent 3abe265 commit 4c6fbcc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
58 changes: 43 additions & 15 deletions packages/docs/docs/api/cli.md
@@ -1,52 +1,80 @@
---
sidebarDepth: 3
---

# Command-line Interface

Currently, there are four cli commands in VuePress: [build](#build), [dev](#dev), [eject](#eject) and [info](#info).

If they are not enough for you, you can also create [your own commands](#more-commands).

## Usage

```bash
vuepress <command> targetDir [options]
vuepress <command> [options]

Commands:
dev [targetDir] start development server
build [targetDir] build dir as static site
eject [targetDir] copy the default theme into .vuepress/theme for customization.
info Shows debugging information about the local environment
```

## build
You can always add `--help` flag for more information.

## Commands

### build

Build dir as a static site.

### -p, --port `<port>`
#### -p, --port `<port>`

See [port](../config/README.md#port).

### -t, --temp `<temp>`
#### -t, --temp `<temp>`

See [temp](../config/README.md#temp).

### -c, --cache `[cache]`
### --no-cache
#### -c, --cache `[cache]`

#### --no-cache

See [cache](../config/README.md#cache).

### --dest `<dest>`
#### -d, --dest `<dest>`

See [dest](../config/README.md#dest).

### --debug
#### --debug

Start development server in debug mode.

### --silent
#### --silent

Start development server in silent mode.

## dev
### dev

Start a development server. All options from `vuepress build` are available. And there are several options specifically for dev:

### --host `<host>`
#### --host `<host>`

See [host](../config/README.md#host).

### --open
#### --open

Open browser when ready.

### --no-clear-screen
#### --no-clear-screen

Do not clear screen when dev server is ready. Note that dev server will not clear screen if you start it in debug mode.

## eject
### eject

Copy the default theme into `.vuepress/theme` for customization.

## info
### info

Shows debugging information about the local environment.

Expand Down
2 changes: 1 addition & 1 deletion packages/vuepress/lib/checkEnv.js
Expand Up @@ -7,7 +7,7 @@
const { chalk, semver } = require('@vuepress/shared-utils')

/**
* Expose handleUnknownCommand function.
* Check if Node version meets VuePress requirement.
*/

module.exports = function checkEnv (pkg) {
Expand Down

0 comments on commit 4c6fbcc

Please sign in to comment.