okfctl.dev
Link graph 01Try it 02What else it does 03Documentation 04GitHub v0.12.1 ↗

okfctl  /  command-line tool for Markdown knowledge bases  /  Apache-2.0

Knowledge you can move without breaking.

A Markdown knowledge base breaks the first time someone renames a file, and nothing tells you. okfctl is for the folder of notes that link to each other. Move a note with it and the links pointing at that note get rewritten to match. Put it in CI and a link left pointing into the wrong folder fails the build ahead of the merge.

curl -sSL https://okfctl.dev/install.sh | sh
Read the docs

With Homebrew: brew install cwest/tap/okfctl. For Windows, packages, and go install, see the install page.

pure Goruns offline
after bundle init + one node new✓ passes validate
mykb/
├─ index.mdfront page · okf_version 0.3
├─ log.mdchange history
└─ concepts/
   ├─ index.mdfolder listing, kept by okfctl
   └─ tannin.mda note
--- concepts/tannin.md
type: Reference
title: Tannin
created: 2026-11-28T11:58:25-05:00
modified: 2026-11-28T11:58:25-05:00
---

What OKF is

The Open Knowledge Format (OKF) is an open spec for a knowledge base kept as plain Markdown. Each note is a file that opens with a short YAML header naming its type, and notes link to each other with ordinary relative paths. Each folder can carry an index.md listing what's in it and a log.md of what changed. The result is files you can open in any editor, diff in git, and hand to an agent with no special library. okfctl writes those files for you and checks a folder against the OKF spec.

Is it for you? It is if your notes are Markdown files in a folder (a git repo works well), written by people and agents alike. okfctl isn't an editor. You go on writing in the one you use now. If you came from a wiki, note that OKF counts only [text](path.md) links. okfctl won't follow or rewrite [[wikilinks]].

01

Move a note and its links follow

Four notes link to tannin.md. Press Run node mv to move it from concepts/ to reference/ and watch the right-hand panel: each of the four links gets the relative path that works from its own folder. The move also lands in log.md.

node mv rewrites links that point at the moved note. Links written in it stay as they were. Any relative link that worked from the old folder may point at nothing from the new one. okfctl lint reports each of those as a broken-link and suggests the path that works.

bundle graph4 inbound links → concepts/tannin.md
Four nodes link to the tannin node; moving it to the reference directory rewrites all four inbound links.concepts/method/reference/aging.mdoak.mdbarrel-aging.mdtasting-notes.mdtannin.md
inbound links rewrittenbefore
concepts/aging.md
# Aging
-Oak barrels add [tannin](tannin.md) over time.
method/tasting-notes.md
# Tasting notes
-Rate grip via [tannin](../concepts/tannin.md).
log.md · change history
## 2026-11-28
* created concepts/tannin.md

Two of the four rewritten files are shown. One said tannin.md and the other said ../concepts/tannin.md. Now each says ../reference/tannin.md.

02

Try it in a terminal

Start in an empty directory. The first four tabs build one bundle in order. Run them in sequence. Under each tab is a note on what to look for. The bar beneath it shows the exit code a CI job would see.

$ okfctl bundle init mykb
Initialized OKF bundle in mykb
$ okfctl node new concepts/tannin.md --type Reference --title "Tannin" --bundle mykb
Created mykb/concepts/tannin.md
$ okfctl node list --bundle mykb
concepts/tannin.md                       Reference
$ okfctl index check mykb
OK: index.md is current
$ okfctl validate mykb
OK: bundle conforms to the OKF spec floor

You never ran an index command. node new wrote the note's header, put it in the two index.md files and added a line to log.md. By the time index check and validate ran there was nothing left for them to find.

exit 0a fresh bundle that passes validate
03

What else it does

Beyond the move, okfctl looks after a knowledge base as it grows. None of it changes how you write.

deleting

Delete a note and see what it leaves behind

node rm deletes a note and lists any note that no longer has a link pointing to it. You decide if those should stay. Links to the deleted note stay in place. lint won't call them broken: it flags a link only when the note it wanted exists at some other path, as it does after a move. okfctl analyze lists links to a note that exists nowhere, as notes still to be written.

Add --dry-run to node mv or node rm to see the changes with no file touched.

checking

Decide which problems fail the build

Only two things fail validate. One is a header that won't parse and the other is an index.md or log.md that ignores the layout the spec sets for index files and log files. Everything else is advice, reported with exit 0 until you add --strict: broken links and unlinked mentions from lint, missing sources from eval transparency, and a note whose last git commit is newer than its modified date.

One private knowledge base, 362 notes with 7,053 links between them, runs validate, index check, and lint from this list on each pull request. One finding blocks the merge.

okfctl validate --strict ./mykb
okfctl index check ./mykb
okfctl lint --strict ./mykb
okfctl eval transparency --strict ./mykb
finding

Search the notes and see how they connect

okfctl search finds notes that contain your words. Hand it a note path in place of words and you get the notes a few links out. The okfctl-search plugin goes further and searches by meaning: query "astringent mouthfeel" and the tannin note comes back on top even with neither word in it. For that it needs a Model2Vec model on disk. potion-base-8M is about 31 MB, and the search guide shows how to point okfctl at it.

okfctl serve draws the link graph in your browser. To draw it yourself, okfctl graph export --format dot writes Graphviz input.

install

Two files and nothing else to install

okfctl and okfctl-search are each one program for macOS, Linux and Windows, easy to copy onto a CI image. Neither one sends your notes anywhere. The only command that uses the network is connect. It calls git to clone or update a bundle someone else publishes.

Start with an empty directory

curl -sSL https://okfctl.dev/install.sh | sh

Then run okfctl bundle init mykb to make your first bundle. The authoring guide goes on from there to adding, renaming, and deleting notes.