Commands
DocsLit provides a set of CLI commands for creating, developing, building, and deploying documentation sites.
Usage
Or if installed globally:
Global options
init
Scaffold a new documentation project with starter pages and configuration.
Creates a project directory with docslit.json, three starter pages in docs/, and a components/ directory.
dev
Start a development server with hot reload.
The server watches docs/, components/, docslit.json, and your brand theme file (if configured) for changes. The browser reloads automatically via WebSocket when any file is saved.
build
Generate a static site for deployment.
Produces HTML pages, search index, sitemap, and AI discovery files in the output directory. With --pdf, also generates chapter, page, and full documentation PDFs in dist/pdf/. See Chapter PDF export.
new
Create a new Markdown page and optionally append it to the sidebar.
deploy
Write hosting recipe files (does not upload). Keep docslit publish for DocsLit Cloud.
For GitHub project pages, set "basePath": "/your-repo" in docslit.json first. See Site chrome and Static hosting.
validate
Check your project for errors and warnings.
See validation for details on what gets checked.
import
Migrate documentation from another platform.
Automatically detects the source platform (Mintlify, Fern, GitBook, or generic Markdown).
theme
Manage color presets and corporate brand themes.
theme init scaffolds a brand-theme.json file with starter brand colors and fonts, and wires it into docslit.json when no theme is set. theme list prints built-in presets and overridable theme variables.
See Theming for the full guide.
openapi scaffold
Generate API reference pages from an OpenAPI 3.x specification.
Creates a Markdown page per endpoint in docs/api/, an introduction.md from the spec's info block, and updates docslit.json with the OpenAPI config and sidebar structure. Tags and x-tagGroups in the spec are used to build sidebar hierarchy with method badges.
See OpenAPI integration for the full guide.
Cloud commands
These commands require authentication. Run docslit login first.
See DocsLit Cloud for details.