Commands
docforge.cli.commands
build
build(mcp: bool, mkdocs: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None
Build documentation (MkDocs site or MCP resources).
This command orchestrates the full build process: 1. Introspects the code (Griffe) 2. Renders sources (MkDocs Markdown or MCP JSON) 3. (MkDocs only) Generates config and runs the final site build.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp |
bool
|
Use the MCP documentation builder. |
required |
mkdocs |
bool
|
Use the MkDocs documentation builder. |
required |
module |
Optional[str]
|
The dotted path of the module to document. |
required |
project_name |
Optional[str]
|
Optional override for the project name. |
required |
site_name |
Optional[str]
|
(MkDocs) The site display name. Defaults to module name. |
required |
docs_dir |
Path
|
(MkDocs) Target directory for Markdown sources. |
required |
nav_file |
Path
|
(MkDocs) Path to the docforge.nav.yml specification. |
required |
template |
Optional[Path]
|
(MkDocs) Optional custom mkdocs.yml template. |
required |
mkdocs_yml |
Path
|
(MkDocs) Target path for the generated mkdocs.yml. |
required |
out_dir |
Path
|
(MCP) Target directory for MCP JSON resources. |
required |
serve
serve(mcp: bool, mkdocs: bool, mkdocs_yml: Path, out_dir: Path) -> None
Serve documentation (MkDocs or MCP).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp |
bool
|
Serve MCP resources via an MCP server. |
required |
mkdocs |
bool
|
Serve the MkDocs site using the built-in development server. |
required |
mkdocs_yml |
Path
|
(MkDocs) Path to the mkdocs.yml configuration. |
required |
out_dir |
Path
|
(MCP) Path to the mcp_docs/ directory. |
required |
tree
tree(modules: Sequence[str], project_name: Optional[str]) -> None
Visualize the project structure in the terminal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modules |
Sequence[str]
|
List of module import paths to recursively introspect. |
required |
project_name |
Optional[str]
|
Optional override for the project name shown at the root. |
required |