openknowledge export
August 10, 2026 ยท View on GitHub
Create a static site, normalized model, graph, or portable source archive. The source can be a local or connected knowledge base.
Targets
| Target | Output | Reference |
|---|---|---|
html | Static viewer or plain semantic HTML. | HTML |
json | Normalized parsed bundle model. | JSON |
graph | Authored link graph or derivative search graph. | Graph |
tar | Reproducible portable source archive. | Tar |
Usage
okn export html --out ./site Wiki
okn export html --no-source-archive --out ./site Wiki
okn export html --plain --out ./plain-site Wiki
okn export json Wiki
okn export json --out ./bundle.json Wiki
okn export graph Wiki
okn export graph --type search --out ./search-graph.json Wiki
okn export tar --out ./wiki.tar.gz Wiki
| Option | Applies to | Default | Description |
|---|---|---|---|
key-or-path | all | . | Registry key or bundle root. |
--spec <version> | all | latest | OKF version. |
--out <path> | all | stdout for JSON/graph | Required directory for HTML. Required file for tar. |
| `--type source | search` | graph | source |
--plain | HTML | off | Semantic HTML without viewer assets. |
--no-source-archive | HTML viewer | off | Omit the source archive and connect manifest. |
--head-file, --head-html | HTML viewer | environment | Trusted head injection. |
--script-src <src> | HTML viewer | environment | Trusted script URL. Repeatable. |
HTML and tar require zero validation errors. HTML also requires publication
permission in .openknowledge.toml.
JSON and graph print schemaVersion: "1" documents to stdout by default. Use
--out to write a file. The command replaces a machine output file only after
complete serialization.
Unknown targets or unsupported flags are usage errors with exit status 2.
Source anchors
packages/cli/cmd/openknowledge/main.gopackages/cli/internal/okf/html.gopackages/cli/internal/okf/bundle.gopackages/cli/internal/okf/graph.gopackages/cli/internal/okf/archive.goUpdate notes
Add new targets here and under
/features/exporters/.