Home
Commands

sourcey build

Build static HTML documentation.

Generates a complete documentation site as static HTML files. Two modes: site build (from sourcey.config.ts) and quick build (from a standalone spec).

Usage

# Site build (reads sourcey.config.ts)
sourcey build [--output <dir>] [--embed] [--quiet]

# Quick build (single spec, no config)
sourcey build <spec> [--output <dir>] [--embed] [--quiet]

Flags

FlagAliasDefaultDescription
--output-odistOutput directory
--embed-efalseEmbeddable output (no html/body wrapper)
--quiet-qfalseSuppress output

Site build

When run without a positional argument, sourcey reads sourcey.config.ts from the current directory and builds the full site.

sourcey build
Sourcey - building documentation site

  Pages:  14
  Output: dist
  Time:   1.2s

Quick build

Pass a path to an OpenAPI spec to build a standalone API reference without a config file:

sourcey build ./openapi.yaml
Sourcey - generating docs from ./openapi.yaml

  Spec:       My API v1.0.0
  Operations: 24
  Schemas:    12
  Time:       0.9s
Note

Quick mode skips sourcey.config.ts entirely. It uses default theme settings and generates only the API reference; no markdown pages.

Output

The output directory contains standalone HTML files, a CSS file, a client-side JavaScript file, and a search index:

dist/
  index.html
  introduction.html
  api/
    index.html
  sourcey.css
  sourcey.js
  search-index.json

Every HTML file is self-contained. Serve with any static file server.

AI output

Site builds emit llms.txt and llms-full.txt alongside the HTML output. These provide an LLM-friendly index and full-text reference for the generated site, following the llms.txt convention.

MCP tabs

Site builds support MCP tabs alongside OpenAPI, Markdown, and Doxygen. Add mcp: "./mcp.json" to a tab in your config. See MCP Integration for details.

Quick build mode (sourcey build <spec>) only supports OpenAPI specs.