CLI Commands
DocAnvil provides three subcommands: init, serve, and build.
Global Flags
| Flag | Description |
|---|---|
--verbose |
Enable verbose output |
--quiet |
Suppress non-error output |
docanvil init
Scaffold a new documentation project.
docanvil init <name>
| Argument | Required | Description |
|---|---|---|
name |
Yes | Directory name for the new project |
Creates a project directory with:
docanvil.toml— project configurationnav.toml— navigation structuredocs/— content directory with starter pagestheme/custom.css— empty custom stylesheet
# Create a docs project
docanvil init my-docs# Create and immediately start serving
docanvil init my-docs && cd my-docs && docanvil servedocanvil serve
Start a development server with live reload.
docanvil serve [--host <address>] [--port <port>]
| Option | Default | Description |
|---|---|---|
--host |
127.0.0.1 |
Address to bind the server to |
--port |
3000 |
Port number |
The server:
- Builds the site on startup
- Watches all project files for changes (Markdown, TOML, CSS, templates)
- Rebuilds affected pages on file change
- Notifies the browser via WebSocket at
/__docanvil_ws - The browser reloads automatically — no manual refresh needed
# Default: localhost:3000
docanvil serve# Custom host and port
docanvil serve --host 0.0.0.0 --port 8080# Verbose output to see rebuild events
docanvil serve --verbosedocanvil build
Generate the static HTML site for deployment.
docanvil build [--out <path>] [--clean]
| Option | Default | Description |
|---|---|---|
--out |
dist |
Output directory for the generated site |
--clean |
false |
Remove the output directory before building |
The build pipeline processes each page through:
- Directive expansion (components)
- Popover conversion
- Markdown rendering (comrak with GFM)
- Wiki-link resolution
- Inline attribute injection
- Template wrapping (Tera layout)
Static assets (custom CSS, images) are copied to the output directory.
# Default build to dist/
docanvil build# Clean build to a custom directory
docanvil build --out public --cleanNote
Broken wiki-links are reported as warnings during build. Check the output for any "broken link" messages to find references to pages that don't exist.
Related Pages
- Installation — install and create your first project
- Configuration —
docanvil.tomlandnav.tomlreference