Guides
CLI Commands
Barodoc CLI reference — serve, build, check, manifest, and more
Barodoc ships a CLI (barodoc) for developing, building, and validating your documentation.
The [dir] argument
Most commands accept an optional [dir] argument that specifies which directory contains your documentation content.
barodoc serve [dir]
barodoc build [dir]
barodoc preview [dir]
If omitted, Barodoc auto-detects the content directory by looking for these folders in order:
docs/content/src/content/docs/
If none are found, it defaults to docs/.
This means the following commands are equivalent when a docs/ directory exists:
barodoc serve docs
barodoc serve # auto-detects docs/
You can use any directory name for your content:
barodoc serve wiki # uses wiki/ as content directory
barodoc build knowledge # uses knowledge/ as content directory
All commands must be run from the project root — the directory containing barodoc.config.json.
serve
Start a development server with hot reload:
barodoc serve [dir]
| Flag | Description |
|---|---|
-p, --port <port> | Port to listen on (default: 4321) |
-h, --host | Expose to network |
--open | Open browser on start |
--clean | Force reinstall dependencies |
-c, --config <file> | Config file path |
build
Build the site for production:
barodoc build [dir]
| Flag | Description |
|---|---|
-o, --output <dir> | Output directory (default: dist) |
--clean | Force reinstall dependencies |
-c, --config <file> | Config file path |
preview
Preview a production build locally:
barodoc preview [dir]
| Flag | Description |
|---|---|
-p, --port <port> | Port to listen on (default: 4321) |
-o, --output <dir> | Build output directory (default: dist) |
check
Validate your documentation against the navigation config and frontmatter schema:
barodoc check [dir]
| Flag | Description |
|---|---|
--fix | Auto-fix missing files and orphan navigation entries |
-c, --config <file> | Config file path |
What it validates:
- Navigation entries that reference non-existent files
- Files on disk that are not referenced in navigation (orphans)
- Missing recommended frontmatter fields (
description) relatedfrontmatter values that point to invalid slugs
Example output:
barodoc check
Missing files (1)
Navigation references files that don't exist on disk.
✗ missing-page → docs/en/missing-page.md
Invalid related links (1)
Frontmatter 'related' references slugs not in navigation.
⚠ quickstart → invalid: non-existent-page
manifest
Generate docs-manifest.json — a structured JSON file containing all document metadata, headings, code blocks, and navigation. Designed for AI agent consumption:
barodoc manifest [dir]
| Flag | Description |
|---|---|
-o, --output <file> | Output file path (default: docs-manifest.json) |
-c, --config <file> | Config file path |
The output includes per-page: slug, title, description, tags, related, difficulty, headings, codeBlocks, wordCount, and the full navigation tree.
init
Initialize Barodoc in an existing directory:
barodoc init [dir]
create
Scaffold a new Barodoc project:
barodoc create <name>
eject
Eject from quick mode to a full Astro project:
barodoc eject [dir]