Installation
Install the cmdocs CLI and learn the project layout.
Installation
cmdocs ships as a single CLI for scaffolding, developing, and validating documentation sites. Production builds are handled automatically by the cmdocs Dashboard.
Requirements
- Node.js 20+ (or Bun 1.0+)
- Git (optional, used by
cmdocs initto clone the starter template)
Install the CLI
Pick whichever package manager you already use. For most projects, running through npx (no install) is enough.
Run cmdocs without installing it. Recommended for most users:
npx @cmdoss/cmdocs init my-docs
npx @cmdoss/cmdocs dev
npx @cmdoss/cmdocs checkIf you use Bun:
bunx @cmdoss/cmdocs init my-docs
bunx @cmdoss/cmdocs dev
bunx @cmdoss/cmdocs checkInstall once, use the cmdocs binary directly:
npm install -g @cmdoss/cmdocsbun install -g @cmdoss/cmdocspnpm install -g @cmdoss/cmdocsThen:
cmdocs init my-docs
cmdocs dev
cmdocs checkCLI commands
| Command | What it does |
|---|---|
cmdocs init [name] | Scaffold a new docs project in [name]/ |
cmdocs dev | Start the local dev server with hot reload (default port 3000) |
cmdocs check | Validate docs.json, navigation, MDX frontmatter, assets, and internal links |
cmdocs --help | Show help for any command |
Common options
# Run dev server on a custom port
cmdocs dev --port 4000
# Check from a specific source directory
cmdocs check --source ./my-docs
# Point dev at a different docs directory
cmdocs dev --source ./my-docsProject layout
A typical cmdocs project looks like this:
docs.json
index.mdx
quickstart.mdx
installation.mdx
setup.mdx
advanced.mdx
theme.mdx
navigation.mdx
favicon.svg
light.svg
dark.svg
architecture.png
| Path | Purpose |
|---|---|
docs.json | The single source of truth — name, theme, navigation, navbar, footer, SEO |
*.mdx | A documentation page. The file path becomes its URL |
public/ | Static assets. Anything here is served at the matching URL (public/logo/light.svg → /logo/light.svg) |
Page slugs in docs.json are file paths without the .mdx extension. For example, guides/setup.mdx is referenced as "guides/setup".
Troubleshooting
Next step
How is this guide?