## Usage
```sh
$ npx @doc-kit/cli --help
```
```
Usage: doc-kit [options] [command]
CLI tool to generate the Node.js API documentation
Options:
--log-level Log level (choices: "debug", "info", "warn", "error",
"fatal", default: "info")
-h, --help display help for command
Commands:
generate [options] Generate API docs
help [command] display help for command
```
### `generate`
You must provide an input and at least one target through command-line options
or a configuration file. Configuration is discovered automatically using
`cosmiconfig`, or you can select a file explicitly with `--config-file`.
Running `generate` without the required values exits with an error pointing you
to the help output.
```
Usage: doc-kit generate [options]
Generate API docs
Options:
--config-file Config file
-i, --input Input file patterns (glob)
-t, --target Target generator(s): a built-in name
(json-simple, legacy-html, legacy-html-all,
man-page, legacy-json, legacy-json-all,
addon-verify, api-links, orama-db, llms-txt,
sitemap, html) or an import specifier for a
custom generator
--ignore Ignore file patterns (glob)
-o, --output The output directory
-p, --threads Number of threads to use (minimum: 1)
--chunk-size Number of items to process per worker thread
(minimum: 1)
-v, --version Target Node.js version
-c, --changelog Changelog URL or path
--git-ref Git ref
--index index.md URL or path
--minify Minify?
--type-map Type map URL or path
-h, --help display help for command
```
## Examples
### Legacy
To generate a 1:1 match with the [legacy tooling](https://github.com/nodejs/node/tree/main/tools/doc), use the `legacy-html`, `legacy-json`, `legacy-html-all`, and `legacy-json-all` generators.
```sh
npx @doc-kit/cli generate \
-t legacy-html \
-t legacy-json \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
```
### Redesigned
To generate [our redesigned documentation pages](https://nodejs-api-docs-tooling.vercel.app), use the `html` and `orama-db` (for search) generators. These generators live in the separate [`@doc-kit/generator-react`](packages/react) package, which must be installed alongside this one.
```sh
npx @doc-kit/cli generate \
-t html \
-t orama-db \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
```
> [!TIP]
> In order to use the search functionality, you _must_ serve the output directory.
>
> ```sh
> npx serve out
> ```