CLI Reference
Writedocs is meant to be installed globally (npm install -g writedocs, see Quickstart) — install it once, then run writedocs directly from inside any project’s own folder. No local package.json dependency, no per-project install step.
Every command takes an optional [dir] argument — the content directory containing writedocs.json and docs/. It defaults to the current directory, so you can cd into your docs project and run these with no arguments, or point them at a project elsewhere without cd-ing first:
writedocs dev # serves the current directory
writedocs dev ./my-docs # serves ./my-docs insteadSkipped the global install? Every command here also works prefixed with npx instead — npx writedocs dev — which downloads and runs Writedocs on the fly.
There’s no writedocs build here — building the static site and deploying it isn’t a step you run yourself. dev and init cover everything you need day to day.
writedocs dev
Starts a local dev server with hot reload.
writedocs dev [dir]| Flag | Description |
|---|---|
-p, --port <port> | Port to run the dev server on. |
writedocs dev --port 3000writedocs init
Scaffolds writedocs.json and a starter docs/ folder.
writedocs init [dir]Creates:
writedocs.json— a minimal config with one navigation group.docs/index.mdx— a welcome page.docs/getting-started.mdx— a short getting-started guide.
Existing files are never overwritten — init skips (and prints a message for) any file that already exists, so it’s safe to run again in a project you’ve already started customizing.