Skip to content

CLI

Scaffolder

bash
npm create vitepress-openapi-docs@latest [project-name]

Creates a VitePress site with the plugin configured and an example OpenAPI spec. See Quick Start for the full walkthrough.

Flags

FlagDescription
--spec <path>Path or URL to your OpenAPI spec
--title <label>Site title written into the generated VitePress config
--server <url>Override the API server base URL in the generated config
--body-inputsRender request body properties as individual inputs in the scaffolded landing
--pm <manager>Force a package manager (npm/pnpm/yarn/bun)
-y / --no-interactiveSkip prompts, use defaults
--skip-installSkip post-scaffolding install step
--no-gitDo not initialise a git repository in the scaffolded project
-f / --forceOverwrite existing directory

Examples

bash
# Use your own spec
npm create vitepress-openapi-docs@latest my-docs -- --spec ./openapi.yaml

# Non-interactive with pnpm
npm create vitepress-openapi-docs@latest my-docs -- -y --pm pnpm

# Scaffold from a remote spec
npm create vitepress-openapi-docs@latest my-docs -- --spec https://api.example.com/openapi.json

Released under the MIT License.