Open Knowledge CLI Documentation
Frontmatter5 fields
Trust
UnverifiedDefault
Status
StableDefault
type
Configuration Reference
title
.openknowledge.toml
description
Strict bundle-local configuration contract shared by Open Knowledge CLI features.
timestamp

.openknowledge.toml

.openknowledge.toml is an optional configuration file in the bundle. Validation, maintenance rules, the local viewer, and static HTML publication use this file. One TOML v1-compatible typed parser decodes the complete file. Therefore, each consumer uses the same syntax and reports the same errors.

Supported configuration

[rules]
paths = ["rules", "policy-rules"]
enabled = ["docs", "changelog"]

[validation.rules]
link-target = "error"
markdown-syntax = "off"

[html.theme]
name = "landing"
stylesheet = "assets/wiki-theme.css"

[html.source]
github_base = "https://github.com/example/knowledge/blob/main"
entry = "Wiki"

[html.site]
base_url = "https://example.com/knowledge/"

[publish]
enabled = true
assets = ["assets/public/**", "whitepapers/*.pdf"]
FieldTypeBehavior
rules.pathsstring or string arrayRelative custom-rule directories. The default is rules.
rules.enabledstring or string arrayDefault canonical rule IDs for rules and review commands.
validation.rules.<rule-id>stringCanonical severity for a known validation rule. Use off, warn, or error. The CLI accepts the compatibility aliases below.
html.theme.namestringViewer or export theme contract name. The default is default.
html.theme.stylesheetstringRelative bundle CSS path or absolute HTTP(S) URL.
html.source.github_basestringAbsolute HTTP(S) repository source base URL.
html.source.entrystringOptional relative repository path prefix.
html.site.base_urlstringAbsolute HTTP(S) deployed root without query or fragment.
publish.enabledbooleanPermission to create public artifacts. The default is false. Public HTML and runtime generation require true.
publish.assetsstring or string arrayBundle-relative glob list for public non-Markdown files. ** matches path segments recursively.

rules.paths and rules.enabled accept the existing single-string shorthand. All other fields use the exact types in the table. The shared TOML parser supports standard TOML features. These features include quoted strings, escaped basic strings, comments, multiline arrays, and dotted tables.

Validation severity values normalize ignore, ignored, and none to off. The values warning and warnings normalize to warn. The values err and errors normalize to error. Use the canonical values in new configuration.

Strictness and safety

The parser reports an error for an unknown top-level section or nested field. It also reports duplicate keys, malformed TOML, and incorrect value types. Unknown validation rule IDs and invalid severity values are errors. The configuration can contain configurable rules from each supported spec profile. A command applies only rules from its selected profile. The command ignores a known rule from another profile. Quote rule IDs that contain a dot when using them as TOML keys:

[validation.rules]
"okf-0.2-metadata" = "error"

Validation with --spec 0.1 ignores this known 0.2-only rule. An unknown or fixed rule still causes an error. An explicit CLI --rule must belong to the selected profile.

A command does not ignore a typographical error in an unused section. This behavior keeps the configuration consistent between all CLI surfaces.

HTML aliases from old readers are not part of the contract. Examples are css, githubBase, and site_url. Use the canonical snake-case fields in the table.

The configuration file is private viewer metadata. Asset and raw viewer routes do not list or serve it. Bundle-root loading applies the real file system boundary. It rejects a symbolic-link .openknowledge.toml and does not follow the link outside the bundle.

The CLI loads only .openknowledge.toml. It does not load the legacy plain openknowledge.toml file. The legacy file remains private in viewer raw routes and public artifacts.

Public artifacts use an explicit list of permitted content. [publish] enabled = true gives the required bundle-level permission. The default is false. After this gate, okf_publish and optional okf_targets select Markdown. A non-Markdown file must match publish.assets. Asset patterns cannot include unpublished Markdown again. The output always excludes .git, .openknowledge, .openknowledge.toml, and legacy openknowledge.toml. A public source repository still exposes its Git content. Thus, okf_publish: false is an artifact filter and not a confidentiality control.

Per-page okf_publish permits publication only after the bundle gate succeeds. The default value permits publication after that gate. The literal value false prevents all public projections. Optional target Boolean values default to true:

okf_publish: true
okf_targets:
  viewer: true
  search: false
  mcp: false
  llms: true
  sitemap: true

An unknown target causes validation and publication to fail. A non-Boolean target or okf_publish value also causes failure. Targets route content that is already public. They are not confidentiality boundaries. Use okf_publish: false to exclude content from each public generation.

Consumer behavior

  • okn validate applies [validation.rules] against the selected OKF version. It uses [rules] for deterministic rule-catalog checks.
  • okn prompt rules uses [rules] for custom catalog paths and default selection.
  • okn prompt review rules also uses [rules].
  • okn view uses [html.theme].
  • Default okn export html uses [html.theme], [html.source], and [html.site]. It uses the same strict parser as validation. It uses [publish] for the bundle gate and public asset list.
  • Plain HTML also requires publish.enabled.
  • JSON and graph exports ignore publication filters.
  • A standalone tar export preserves the complete source, including this configuration.
Powered by OpenKnowledge.sh