okforest
The OKForest CLI: validate, inventory, and scaffold
Open Knowledge Format (OKF)
v0.2 trees.
npx okforest validate .
npx okforest validate . --format json
npx okforest inventory .
npx okforest init sales-okf --template company --name "Sales knowledge"
npx okforest rule okf/type
npx runs it without installing anything. It needs Node.js 22 or later. To
run okforest directly, install it globally; in a repository, add it as a
development dependency instead, so everyone and CI run the same version:
npm install --global okforest
npm install --save-dev okforest
To also check D2 and Mermaid diagram syntax, install the optional packages
alongside it:
npx -p okforest -p @d2lang/d2 -p mermaid okforest validate .
npm install --save-dev okforest @d2lang/d2 mermaid
In GitHub Actions, use
OKForest Validate
(uses: okforest/validate-action@v1): the same rules, with annotations on the
pull request and the diagram checks included.
Rules, options, and what counts as a concept: see the
OKForest CLI README.
Apache-2.0 · © Preneur LLC · okforest.ai