Skip to content

Quick Start

This walks you from a folder of headers to a generated MDX reference in about a minute. It assumes docsgen is on your PATH — see Installation if not.

The minimal invocation takes an input directory and an output directory:

Terminal window
docsgen --input ./include --output ./docs

docsgen collects every .hpp / .h under ./include (recursively), parses them with the codex C++ frontend, and writes one MDX file per public symbol into ./docs, plus catalog pages. The final line reports how many files were written:

wrote 27 MDX files to './docs'

Short flags work too: docsgen -i ./include -o ./docs. Run docsgen --help for the full list, or see the CLI Reference.

Each public class, struct, enum, function, alias, concept, operator, and macro becomes its own page. A class page carries the symbol’s doc comment, its constructors, methods, operators, and a See Also section — with types in signatures already linked to their own pages:

---
title: "Socket"
description: "Async, non-blocking socket with an RAII lifetime."
---
`Socket` wraps a single OS socket file descriptor ...
## Public Methods
### connect
​```cpp
[[nodiscard]] AsyncHandle connect(const Endpoint& endpoint, IoCallback onConnect);
​```
**Returns:** [AsyncHandle](/net_asynchandle) - Handle that can be passed to `cancel()`.

docsgen also emits catalog pages — catalog_types, catalog_functions, catalog_namespaces, catalog_files — that index the whole surface. See What It Generates and Catalog Pages.

Re-typing flags gets old. Drop a config.docsgen.yaml next to your project and docsgen discovers it automatically (from the current directory, then the input directory):

name: net
description: Async non-blocking socket library
version: "1.0.0"
license: MIT
input: "./include" # relative to this config file
output: "./docs"
extensions:
- .hpp
- .h
# Hide implementation namespaces from the output.
exclude_namespaces:
- detail
- internal

Now generation is just:

Terminal window
docsgen

CLI flags still win over config values when both are present. The full set of keys is in the Config Schema.

Add --llms-txt (or set llms_txt.enabled: true) to also emit a single plain-text bundle of your API for AI agents:

Terminal window
docsgen --llms-txt

See llms.txt for what goes in the bundle and the @llms-only escape hatch.