cargo-orthohelp
cargo-orthohelp is the OrthoConfig documentation generator. It turns
OrthoConfigDocs metadata into localized documentation artefacts without
adding documentation-generation code to your application binary.
The problem this solves
Documentation for configuration-heavy command-line interfaces (CLIs) can easily drift out of sync. Teams often maintain help text in multiple places (CLI help, man pages, PowerShell help, environment variable docs, file-key docs), and each source can diverge.
cargo-orthohelp solves this by generating all documentation outputs from one
intermediate representation (IR) produced by #[derive(OrthoConfig)].
How it works
- It discovers your package and root config type from Cargo metadata or CLI flags.
- It builds a tiny bridge binary that calls
OrthoConfigDocs::get_doc_metadata(). - It resolves Fluent message IDs for each requested locale.
- It emits localized IR JSON, roff man pages, PowerShell external help, or all formats.
Core features
- Single source of truth: Generate docs from OrthoConfig IR metadata.
- Localized output: Resolve Fluent IDs per locale from
locales/<locale>. - Multiple output formats: IR JSON (
ir), UNIX man pages (man), PowerShell help (ps), or all formats (all). - Cache-aware pipeline:
--cachereuses bridge IR;--no-buildenforces cache-only execution. - Cargo-native workflow: Run as
cargo orthohelpfrom your workspace.
Quick Start
-
Declare metadata in your application crate
Cargo.toml: Use the canonical example in Cargo metadata defaults. -
Generate localized IR JSON:
This writes localized IR to
target/orthohelp/ir/en-US.json. -
Generate man pages or PowerShell help when needed:
Usage
Common format-specific options:
- Man pages:
--man-section <1-8> --man-date <DATE> --man-split-subcommands - PowerShell:
--ps-module-name <NAME> --ps-split-subcommands <BOOL>--ps-include-common-parameters <BOOL> --ps-help-info-uri <URI>--ensure-en-us <BOOL>
Boolean PowerShell options take explicit values and are not bare switches. Use
--ps-split-subcommands true, --ps-include-common-parameters false, or
--ensure-en-us false.
Examples
Generate IR for two locales and reuse the bridge cache:
Generate section 5 man pages and split subcommands:
Generate PowerShell module help with explicit module name:
Generate every output format in one run:
Output layout
For --out-dir target/docs:
- IR JSON:
target/docs/ir/<locale>.json - Man pages (single locale):
target/docs/man/man<section>/<name>.<section> - Man pages (multiple locales via
--all-localesor repeated--locale):target/docs/<locale>/man/man<section>/<name>.<section> - PowerShell:
target/docs/powershell/<ModuleName>/<ModuleName>.psm1target/docs/powershell/<ModuleName>/<ModuleName>.psd1target/docs/powershell/<ModuleName>/<locale>/<ModuleName>-help.xmltarget/docs/powershell/<ModuleName>/<locale>/about_<ModuleName>.help.txt
Cargo metadata defaults
cargo-orthohelp reads defaults from package.metadata.ortho_config:
[]
= "my_app::AppConfig"
= ["en-US", "fr-FR"]
[]
= "MyApp"
= true
= false
= "https://example.com/help/MyApp"
If root_type is omitted from both CLI and metadata, generation fails with a
clear remediation message.