Skip to content

Commit 4c6fbcc

Browse files
author
Sun Haoran
authored
docs: refine cli documentation (#2151)
1 parent 3abe265 commit 4c6fbcc

File tree

2 files changed

+44
-16
lines changed

2 files changed

+44
-16
lines changed

packages/docs/docs/api/cli.md

+43-15
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,80 @@
1+
---
2+
sidebarDepth: 3
3+
---
4+
15
# Command-line Interface
26

7+
Currently, there are four cli commands in VuePress: [build](#build), [dev](#dev), [eject](#eject) and [info](#info).
8+
9+
If they are not enough for you, you can also create [your own commands](#more-commands).
10+
311
## Usage
412

513
```bash
6-
vuepress <command> targetDir [options]
14+
vuepress <command> [options]
15+
16+
Commands:
17+
dev [targetDir] start development server
18+
build [targetDir] build dir as static site
19+
eject [targetDir] copy the default theme into .vuepress/theme for customization.
20+
info Shows debugging information about the local environment
721
```
822

9-
## build
23+
You can always add `--help` flag for more information.
24+
25+
## Commands
26+
27+
### build
1028

1129
Build dir as a static site.
1230

13-
### -p, --port `<port>`
31+
#### -p, --port `<port>`
32+
1433
See [port](../config/README.md#port).
1534

16-
### -t, --temp `<temp>`
35+
#### -t, --temp `<temp>`
36+
1737
See [temp](../config/README.md#temp).
1838

19-
### -c, --cache `[cache]`
20-
### --no-cache
39+
#### -c, --cache `[cache]`
40+
41+
#### --no-cache
42+
2143
See [cache](../config/README.md#cache).
2244

23-
### --dest `<dest>`
45+
#### -d, --dest `<dest>`
46+
2447
See [dest](../config/README.md#dest).
2548

26-
### --debug
49+
#### --debug
50+
2751
Start development server in debug mode.
2852

29-
### --silent
53+
#### --silent
54+
3055
Start development server in silent mode.
3156

32-
## dev
57+
### dev
3358

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

36-
### --host `<host>`
61+
#### --host `<host>`
62+
3763
See [host](../config/README.md#host).
3864

39-
### --open
65+
#### --open
66+
4067
Open browser when ready.
4168

42-
### --no-clear-screen
69+
#### --no-clear-screen
70+
4371
Do not clear screen when dev server is ready. Note that dev server will not clear screen if you start it in debug mode.
4472

45-
## eject
73+
### eject
4674

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

49-
## info
77+
### info
5078

5179
Shows debugging information about the local environment.
5280

packages/vuepress/lib/checkEnv.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
const { chalk, semver } = require('@vuepress/shared-utils')
88

99
/**
10-
* Expose handleUnknownCommand function.
10+
* Check if Node version meets VuePress requirement.
1111
*/
1212

1313
module.exports = function checkEnv (pkg) {

0 commit comments

Comments
 (0)