CLI Reference
Reference for the Docyard command-line tool.
CLI Reference
The docyard binary extracts API documentation from source code into JSON files consumed by the Nuxt theme.
docyard extract all
Extract all APIs listed in a config file.
docyard extract all [--config <path>]
Flags
| Flag | Description |
|---|---|
--config | Path to docyard.config.json. Auto-discovered by walking up from $PWD if omitted. |
Config format
{
"out": "public/docyard",
"apis": [
{ "language": "python", "name": "mylib", "src": "/abs/path/to/src/mylib" },
{ "language": "rust", "name": "mylib", "crate": "/abs/path/to/crate" }
]
}
All paths in the config must be absolute. The flake module generates this file at runtime with absolute paths derived from $PWD.
docyard extract python
Extract a single Python package's API.
docyard extract python --src <dir> [--name <name>] [--out <dir>]
Flags
| Flag | Description |
|---|---|
--src (required) | Directory containing the Python package |
--name | API name (default: basename of --src) |
--out | Output directory (default: docyard) |
Requires griffe on $PYTHONPATH. The flake module auto-provides it via python3.withPackages.
docyard extract typescript
Extract a single TypeScript (or JSDoc-annotated JavaScript) module's API.
docyard extract typescript --src <entry.ts | dir> [--name <name>] [--out <dir>]
Flags
| Flag | Description |
|---|---|
--src (required) | Entry .ts file, or a directory containing index.ts |
--name | API name (default: entry basename) |
--out | Output directory (default: docyard) |
Requires node on $PATH. The typescript compiler package is resolved from
the target project's node_modules, the working directory, or a tsc on
$PATH (the flake module provides one automatically).
docyard extract rust
Extract a single Rust crate's API.
docyard extract rust --crate <dir> [--name <name>] [--out <dir>]
Flags
| Flag | Description |
|---|---|
--crate (required) | Directory containing Cargo.toml |
--name | API name (default: crate package name) |
--out | Output directory (default: docyard) |
Requires a Rust toolchain with cargo on $PATH. The crate must compile successfully.
docyard pypi build
Build the Python distributions listed under packages in
docyard.config.json with uv build and write a
PEP 503
"simple" repository index for them.
docyard pypi build [--config <path>] [--out <dir>]
Flags
| Flag | Description |
|---|---|
--config | Path to docyard.config.json (default: auto-discover) |
--out | Output directory for the index tree (default: simple) |
For each package it builds an sdist and a wheel, copies them under
<out>/<normalized-name>/, and generates <out>/index.html plus a
per-project <out>/<normalized-name>/index.html linking each file with its
#sha256= hash. Requires uv on $PATH. The flake module runs this
automatically for docyard.site.python.packages during docs-build.
Output format
Each extractor writes a <name>.docs.json file:
{
"docyard": "0.1.0",
"language": "python",
"name": "mylib",
"version": "0.1.0",
"items": [
{
"kind": "function",
"name": "mylib.greet",
"doc": "Return a greeting message.",
"signature": "(name: str) -> str",
"parameters": [...],
"returns": {...}
}
]
}
The theme renders these files as browsable API reference pages under /api/<name>.