Commands CLI reference • 5 min read | Copy as Markdown| View as Markdown
DocsLit provides a set of CLI commands for creating, developing, building, and deploying documentation sites.
Usage
npx docslit <command> [options]
Or if installed globally:
docslit <command> [options]
Global options
Display help information for any command.
Print the DocsLit version number.
init
Scaffold a new documentation project with starter pages and configuration.
npx docslit init my-docs
Creates a project directory with docslit.json, three starter pages in docs/, and a components/ directory.
The directory name for the new project.
dev
Start a development server with hot reload.
npx docslit dev
npx docslit dev --port 4000
The server watches docs/, components/, and docslit.json for changes. The browser reloads automatically via WebSocket when any file is saved.
The port number for the dev server.
build
Generate a static site for deployment.
npx docslit build
npx docslit build --offline
npx docslit build --out public
Produces HTML pages, search index, sitemap, and AI discovery files in the output directory.
The output directory for the built site.
Build a single HTML file with all content inlined. No server needed to view.
validate
Check your project for errors and warnings.
npx docslit validate
npx docslit validate --strict
See validation for details on what gets checked.
Treat warnings as errors. Exits with code 1 if any warnings are found.
import
Migrate documentation from another platform.
npx docslit import ./my-mintlify-docs
npx docslit import ./my-fern-docs --out converted
npx docslit import ./my-gitbook --dry-run
Automatically detects the source platform (Mintlify, Fern, GitBook, or generic Markdown).
Custom output directory. Defaults to {source-dir}-docslit.
Scan and report without writing any files.
Cloud commands
These commands require authentication. Run docslit login first.
Authenticate with DocsLit Cloud via browser OAuth.
Build and deploy your site to DocsLit Cloud.
List all published documentation projects.
Display the authenticated user.
" type="command">
Remove a project from DocsLit Cloud.
See DocsLit Cloud for details.