InSpectra.Gen
0.0.29
See the version list below for details.
dotnet tool install --global InSpectra.Gen --version 0.0.29
dotnet new tool-manifest
dotnet tool install --local InSpectra.Gen --version 0.0.29
#tool dotnet:?package=InSpectra.Gen&version=0.0.29
nuke :add-package InSpectra.Gen --version 0.0.29
InSpectra
Turn an OpenCLI export into either Markdown or a relocatable HTML app bundle.
inspectra render file html mycli.json --out-dir ./docs
InSpectra is a .NET 10 tool that reads OpenCLI JSON exports, optionally enriches them with XML metadata, and renders either:
- GitHub-friendly Markdown
- an interactive HTML viewer bundle with
index.htmlplus built JS/CSS assets
Install
dotnet tool install -g InSpectra.Gen
This installs the inspectra command globally.
Why
- OpenCLI JSON stays the source of truth. Render docs directly from what the CLI exposes.
- Validation happens before rendering, so broken specs fail early.
- XML enrichment is additive. It only fills missing descriptions.
- Markdown and HTML share the same normalization and enrichment rules.
Quick Start
Prerequisites
- .NET 10 SDK
- Node.js for local frontend builds, CI, and
dotnet pack/dotnet publish
Build the viewer bundle
cd src/InSpectra.UI
npm ci
npm test
npm run build
cd ../..
Render Markdown
dotnet run --project src/InSpectra.Gen -- \
render file markdown examples/jellyfin-cli/opencli.json \
--xmldoc examples/jellyfin-cli/xmldoc.xml \
--out jellyfin-docs.md
Render HTML
dotnet run --project src/InSpectra.Gen -- \
render file html examples/jellyfin-cli/opencli.json \
--xmldoc examples/jellyfin-cli/xmldoc.xml \
--out-dir jellyfin-docs
Open jellyfin-docs/index.html in a browser. The bundle is relocatable because the viewer is built with base: "./".
Command Surface
inspectra render [file|exec] [markdown|html] [OPTIONS]
Markdown
render file markdown <OPENCLI_JSON> [OPTIONS]
render exec markdown <SOURCE> [OPTIONS]
Markdown supports:
--out <FILE>for single-file output--out-dir <DIR>with--layout tree--layout single|tree
HTML
render file html <OPENCLI_JSON> --out-dir <DIR> [OPTIONS]
render exec html <SOURCE> --out-dir <DIR> [OPTIONS]
HTML uses bundle-directory output only:
--out-dir <DIR>is required--outis rejected--layoutis rejected- machine-readable JSON reports
layout: "app"
Common Options
| Option | Description |
|---|---|
--xmldoc <PATH> |
XML enrichment file for render file ... |
--with-xmldoc |
Also invoke cli xmldoc in exec mode |
--source-arg <ARG> |
Argument passed to the source CLI |
--opencli-arg <ARG> |
Override the OpenCLI export invocation |
--xmldoc-arg <ARG> |
Override the xmldoc invocation |
--include-hidden |
Include hidden commands and options |
--include-metadata |
Include metadata sections in rendered output |
--overwrite |
Overwrite existing output |
--dry-run |
Preview output without writing files |
--json |
Emit machine-readable render results |
--timeout <SECONDS> |
Exec-mode timeout |
HTML Viewer (InSpectraUI)
The HTML renderer copies src/InSpectra.UI/dist/** and patches index.html with a bootstrap payload.
The bundled viewer supports three boot paths:
- injected inline data from the renderer
- URL-driven loading with
?opencli=...,?xmldoc=..., or?dir=... - manual import by dropping or picking
opencli.jsonand optionalxmldoc.xml
Other viewer features:
- dark mode with theme toggle and localStorage persistence
- command palette (Ctrl+K) for quick command search
- composer panel for interactively building CLI commands
- Ctrl+F to focus sidebar search
- hash routing for deep links
- hidden-item filtering and metadata toggling
- recursive option inheritance
- command-tree filtering
?dir=<url> resolves:
<dir>/opencli.json- optional
<dir>/xmldoc.xml
Missing inferred xmldoc.xml is non-fatal.
Architecture
Data flow
OpenCLI JSON ──┐
XML metadata ──┴─> validate -> enrich -> normalize -> render -> write
HTML runtime model
- v1 uses raw
opencli.jsonplus optionalxmldoc.xmlas the canonical browser input - the .NET HTML pipeline keeps the existing acquisition and validation flow
- injected HTML output defaults to inline bootstrap mode
- internal links-mode support remains available for hosted scenarios
Bundle resolution
At runtime, HTML assets are resolved in this order:
- packaged
InSpectra.UI/distbeside the installed tool - repo-local
src/InSpectra.UI/dist - repo-local
npm ciplusnpm run buildifdistis missing andnpmis available - otherwise a clear error telling you how to build the frontend
dotnet pack and dotnet publish do not run npm implicitly. They fail if src/InSpectra.UI/dist/index.html is missing.
Project Layout
src/InSpectra.Gen/ CLI tool and render services
src/InSpectra.UI/ Vite + React + TypeScript viewer app
tests/InSpectra.Gen.Tests/
docs/
examples/
Testing
cd src/InSpectra.UI
npm test
npm run build
cd ../..
dotnet test InSpectra.Gen.sln --configuration Release
Coverage includes:
- frontend bootstrap precedence and import flows
- XML enrichment and normalization behavior
- HTML output contract and bootstrap injection
- bundle resolution order
- Markdown output paths and layout handling
CI
CI builds the frontend before running the .NET test and packaging flow. Each build produces a versioned NuGet package (0.0.<build-number>) uploaded as a CI artifact. GitHub Pages publishes HTML examples as bundle directories.
Examples
The hosted HTML examples live under the Pages site as bundle directories. The repository keeps Markdown renders and source snapshots checked in.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.