Getting Started
This page walks through installing Writedocs, creating a project, and running it locally, end to end.
Prerequisites
Youβll need:
- Node.js 20.3 or newer
- A package manager (
npm,pnpm, oryarnall work)
Writedocs is currently distributed as a package you install directly into a project, not a global CLI. Thatβs why every command below is run through npm run or npx, not a bare writedocs command.
Installation
Using npm
npm install writedocsUsing pnpm
pnpm add writedocsEither way, you end up with the writedocs CLI available in your projectβs node_modules/.bin, and callable via npm run scripts or npx writedocs.
Project structure
A Writedocs project only needs two things: a writedocs.json and a docs/ folder.
my-docs/
βββ writedocs.json
βββ docs/
βββ index.mdx
βββ getting-started.mdx
βββ guides/
βββ components.mdxRun the scaffolder to generate a starting point automatically instead of creating these by hand:
npx writedocs init ./my-docsConfiguration
Every Writedocs site is configured through writedocs.json. The fields youβll touch first:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Site name, shown in the browser tab and topbar. |
navigation | array | yes | The sidebar structure β see Configuration for the full shape. |
styles.colors.primary | string | no | Accent color used for links, active nav items, and step markers. |
topbar.links | array | no | Links shown in the top-right of every page. |
See the Configuration guide for every field in detail.
Running the dev server
Install
Run npm install if you havenβt already β this installs Writedocs and its dependencies (Astro, MDX support, and so on) into node_modules.
Configure
Create a writedocs.json and a docs/ folder, or run npx writedocs init to scaffold one.
Preview
Run npx writedocs dev to start a local dev server with hot reload, and open the URL it prints (http://localhost:4321 by default).
Once the dev server is running, edits to any .mdx file or to writedocs.json itself are picked up automatically β no restart required for content changes.
Building for production
When youβre ready to deploy:
npx writedocs buildThis writes a fully static site into dist/ inside your content directory. The output is plain HTML, CSS, and JS β it can be served by any static host, with no Writedocs-specific runtime required.
Deploying
dist/is exactly like deploying any other static site: point your host (Netlify, Cloudflare Pages, an S3 bucket, nginx, whatever you already use) at that folder.