Skip to content

Commit f2ebf8b

Browse files
committed
feat(cli): split cli into sub commands
1 parent d92c1e7 commit f2ebf8b

File tree

5 files changed

+490
-155
lines changed

5 files changed

+490
-155
lines changed

README.md

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,61 @@
2323

2424
## Usage
2525

26-
Local invocation:
26+
### `generate`
27+
28+
Generate API documentation from Markdown files.
2729

2830
```sh
29-
$ npx api-docs-tooling --help
31+
npx api-docs-tooling generate [options]
3032
```
3133

34+
**Options:**
35+
36+
- `-i, --input <patterns...>` Input file patterns (glob)
37+
- `--ignore [patterns...]` Files to ignore
38+
- `-o, --output <dir>` Output directory
39+
- `-v, --version <semver>` Target Node.js version (default: latest)
40+
- `-c, --changelog <url>` Changelog file or URL
41+
- `--git-ref <url>` Git ref/commit URL
42+
- `-t, --target [modes...]` Generator target(s): `json-simple`, `legacy-html`, etc.
43+
- `--no-lint` Skip linting before generation
44+
45+
### `lint`
46+
47+
Run the linter on API documentation.
48+
49+
```sh
50+
npx api-docs-tooling lint [options]
51+
```
52+
53+
**Options:**
54+
55+
- `-i, --input <patterns...>` Input file patterns (glob)
56+
- `--ignore [patterns...]` Files to ignore
57+
- `--disable-rule [rules...]` Disable specific linting rules
58+
- `--lint-dry-run` Run linter without applying changes
59+
- `-r, --reporter <reporter>` Reporter format: `console`, `github`, etc.
60+
61+
### `interactive`
62+
63+
Launches a fully interactive CLI prompt to guide you through all available options.
64+
65+
```sh
66+
npx api-docs-tooling interactive
67+
```
68+
69+
### `list`
70+
71+
See available modules for each subsystem.
72+
73+
```sh
74+
npx api-docs-tooling list generators
75+
npx api-docs-tooling list rules
76+
npx api-docs-tooling list reporters
77+
```
78+
79+
### `help`
80+
3281
```sh
33-
Usage: api-docs-tooling [options]
34-
35-
CLI tool to generate API documentation of a Node.js project.
36-
37-
Options:
38-
-i, --input [patterns...] Specify input file patterns using glob syntax
39-
--ignore [patterns...] Specify which input files to ignore using glob syntax
40-
-o, --output <path> Specify the relative or absolute output directory
41-
-v, --version <semver> Specify the target version of Node.js, semver compliant (default: "v22.11.0")
42-
-c, --changelog <url> Specify the path (file: or https://) to the CHANGELOG.md file (default:
43-
"https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
44-
-t, --target [mode...] Set the processing target modes (choices: "json-simple", "legacy-html", "legacy-html-all",
45-
"man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db")
46-
--disable-rule [rule...] Disable a specific linter rule (choices: "invalid-change-version",
47-
"missing-change-version", "missing-introduced-in", default: [])
48-
--lint-dry-run Run linter in dry-run mode (default: false)
49-
--git-ref A git ref/commit URL pointing to Node.js
50-
-r, --reporter [reporter] Specify the linter reporter (choices: "console", "github", default: "console")
51-
-h, --help display help for command
82+
npx api-docs-tooling help [command]
5283
```

0 commit comments

Comments
 (0)