Inspecting and repairing nodes
Besides new, mv, and rm, okfctl has four node commands: two that show
what a bundle holds and two that repair a node. node list
prints every node in a bundle with its type, and node show prints one node’s
type and body. node refresh sets a stale modified date to the day git last
committed the file. node promote moves a note written as a folder’s
index.md, where OKF tools can’t see it, to a file of its own. The first two
only read. The last two rewrite files, and each has a --dry-run flag that
lists the changes and writes nothing.
Run everything below in an empty directory. If bundles and nodes are new to you, read Concepts first.
See what a bundle holds with node list
Section titled “See what a bundle holds with node list”Make a bundle with two notes and a README:
$ okfctl bundle init cellarInitialized OKF bundle in cellar$ okfctl node new wine/tannin --type Concept --title Tannin --bundle cellarCreated cellar/wine/tannin.md$ okfctl node new grape/sangiovese --type "Grape Variety" --title Sangiovese --bundle cellarCreated cellar/grape/sangiovese.md$ printf 'Notes for whoever edits this bundle.\n' > cellar/README.md$ okfctl node list --bundle cellargrape/sangiovese.md Grape Varietywine/tannin.md ConceptYou get one line per node, sorted by path, with the type in the second
column. The README isn’t listed, and neither are the index.md and log.md
files bundle init and node new wrote. The
OKF spec
decides that. Its “Concepts, assets, and other files” section says a
Markdown file counts only when its header has a non-empty
type. index.md and log.md are reserved names that never count, whatever
they hold. Files and folders whose names start with a dot aren’t part of the
bundle at all. node list prints the set the spec defines, the quickest way
to see what another OKF tool will find in your bundle.
The type column is plain text. Filter it with grep:
$ okfctl node list --bundle cellar | grep 'Grape Variety'grape/sangiovese.md Grape Variety--bundle defaults to the current directory. An empty bundle prints
nothing and exits 0.
Read one node with node show
Section titled “Read one node with node show”Add a sentence to tannin, then print it:
$ printf '\nThe drying grip in red wine.\n' >> cellar/wine/tannin.md$ okfctl node show wine/tannin --bundle cellarpath: wine/tannin.mdtype: Concept
# Tannin
The drying grip in red wine.show prints the path, the type, and the body. The rest of the header
(title, timestamps, sources) stays out of the way. When you want it, cat
the file. You can leave .md off the path.
The reserved files and the README aren’t nodes, and show won’t print them:
$ okfctl node show index --bundle cellarokfctl: node not found: index.md$ okfctl node show README --bundle cellarokfctl: node not found: README.mdFix stale modified dates with node refresh
Section titled “Fix stale modified dates with node refresh”node new writes created and modified timestamps into every header.
Both keys are okfctl’s. The OKF spec has no modified field (it uses
generated.at for the last change of substance), and it lets any tool add
keys of its own as long as other tools carry them through. okfctl uses
modified for one check: do the header and git agree on when this file
last changed? When they don’t, validate warns, and node refresh fixes
the header.
Put the bundle in git with a commit made today. Then write a note by hand
with a modified date of March 2, and commit it on April 10. cat shows
the file as it stands, and validate names the note and both dates:
$ git -C cellar init -q$ git -C cellar add -A$ git -C cellar commit -q -m "Start the cellar"$ printf -- '---\ntype: Concept\ntitle: Acidity\ncreated: 2026-03-02\nmodified: 2026-03-02\ntags: [taste] # how it feels on the tongue\n---\n\n# Acidity\n\nWhy a wine tastes fresh.\n' > cellar/wine/acidity.md$ git -C cellar add -A$ GIT_COMMITTER_DATE=2026-04-10T12:00:00Z git -C cellar commit -q --date=2026-04-10T12:00:00Z -m "Add acidity"$ cat cellar/wine/acidity.md---type: Concepttitle: Aciditycreated: 2026-03-02modified: 2026-03-02tags: [taste] # how it feels on the tongue---
# Acidity
Why a wine tastes fresh.$ okfctl validate cellarwarning README.md: not a concept (no frontmatter); skipped, does not affect conformance (OKF spec, "Concepts, assets, and other files")warning wine/acidity.md: modified 2026-03-02 disagrees with git last-commit 2026-04-10; run `okfctl node refresh` to fix it (or `okfctl node edit` per node)1 drift warning(s)The other two notes, tannin and Sangiovese, don’t drift. Both got today’s
modified from node new and went into today’s commit. --dry-run shows
what refresh would write:
$ okfctl node refresh --dry-run cellarwould refresh wine/acidity.md: 2026-03-02 -> 2026-04-101 node(s) would be refreshed (dry run; nothing written)Run it and look at the file after:
$ okfctl node refresh cellarrefreshed wine/acidity.md: 2026-03-02 -> 2026-04-101 node(s) refreshed$ cat cellar/wine/acidity.md---type: Concepttitle: Aciditycreated: 2026-03-02modified: 2026-04-10T00:00:00Ztags: [taste] # how it feels on the tongue---
# Acidity
Why a wine tastes fresh.$ head -n 4 cellar/log.md# Change Log
## <DATE>* refreshed wine/acidity.mdOne line changed. modified holds the commit day now, written as midnight
UTC. created, the comment on tags, and the body match the old file byte
for byte. refresh also added a line to log.md (dated the day you ran it)
and rebuilt index.md at the end. Name a path after the bundle to fix just
that note: okfctl node refresh cellar wine/acidity.
Outside a git repository there’s no history to compare with. Nothing
drifts, and refresh prints No drift and exits 0.
Commit the refresh without starting the drift again
Section titled “Commit the refresh without starting the drift again”You’ll commit the refresh like any other edit. Do that on a later day and the note’s last commit is now the refresh. Its header looks stale again:
$ git -C cellar add -A$ GIT_COMMITTER_DATE=2026-05-01T12:00:00Z git -C cellar commit -q --date=2026-05-01T12:00:00Z -m "Refresh modified dates"$ okfctl validate cellarwarning README.md: not a concept (no frontmatter); skipped, does not affect conformance (OKF spec, "Concepts, assets, and other files")warning wine/acidity.md: modified 2026-04-10 disagrees with git last-commit 2026-05-01; run `okfctl node refresh` to fix it (or `okfctl node edit` per node)1 drift warning(s)Running refresh again would stamp May 1 on acidity. Its text didn’t change
that day. List the refresh commit in .okf-drift-ignore-revs at the top
of the bundle. The drift check skips any commit on that list and
compares against the commit under it:
$ git -C cellar rev-parse HEAD >> cellar/.okf-drift-ignore-revs$ okfctl validate cellarwarning README.md: not a concept (no frontmatter); skipped, does not affect conformance (OKF spec, "Concepts, assets, and other files")OK: bundle conforms to the OKF spec floorBig mechanical commits (reformats, migrations) belong in the same file.
Leave one off and a single refresh would flatten every note it touched to
one day. refresh won’t run when one
commit accounts for half or more of 10 or more planned changes. It prints
that commit’s SHA and the line to add, and --yes overrides the refusal. The
index and freshness guide walks through that case.
Turn a folder’s index.md into a node with node promote
Section titled “Turn a folder’s index.md into a node with node promote”A Hugo page bundle
puts a page’s text in its folder’s index.md. Import notes from a Hugo site
and they land in index.md files too. The spec forbids that twice. Subdirectory
index.md files have no frontmatter, and a reader never counts any
index.md as a concept, whatever header it carries. OKF tools skip the note
(okfctl too), and validate fails the bundle. Swap the Sangiovese note for
one written that way, and add a Chianti note that links to it with both
spellings of a folder link:
$ okfctl node rm grape/sangiovese --bundle cellarRemoved grape/sangiovese.md$ printf -- '---\ntype: Grape Variety\ntitle: Sangiovese\ndescription: The red grape of Tuscany.\n---\n\n# Sangiovese\n\nThin skins and high acid.\n' > cellar/grape/index.md$ printf -- '---\ntype: Concept\ntitle: Chianti\n---\n\n# Chianti\n\nMostly [Sangiovese](../grape/), so read up on [its skins](../grape/index.md#skins).\n' > cellar/wine/chianti.md$ okfctl node list --bundle cellarwine/acidity.md Conceptwine/chianti.md Conceptwine/tannin.md Concept$ okfctl validate cellarFAIL grape/index.md: index files contain no frontmatter; only the bundle-root index may carry frontmatter (OKF spec, "Index files")warning README.md: not a concept (no frontmatter); skipped, does not affect conformance (OKF spec, "Concepts, assets, and other files")okfctl: 1 conformance finding(s)node list skips Sangiovese because index.md is a reserved name, and no
file called that counts as a node, header or not. The spec names the problem
but offers no fix, and node promote is okfctl’s. It moves the note to a file
named after its folder, grape/grape.md, and rewrites every link to the
folder. ls shows the folder today, then --dry-run previews the change:
$ ls cellar/grapeindex.md$ okfctl node promote --dry-run cellarwould promote grape/index.md -> grape/grape.md rewrite wine/chianti.md: ../grape/ -> ../grape/grape.md rewrite wine/chianti.md: ../grape/index.md#skins -> ../grape/grape.md#skins1 index(es) would be promoted (dry run; nothing written)Apply it and look at the folder and the note after:
$ okfctl node promote cellarpromoted grape/index.md -> grape/grape.md (2 inbound link(s) rewritten)1 index(es) promoted$ ls cellar/grapegrape.mdindex.md$ cat cellar/grape/grape.md---type: Grape Varietytitle: Sangiovesedescription: The red grape of Tuscany.---
# Sangiovese
Thin skins and high acid.$ cat cellar/grape/index.md# Grape
## Concepts
* [Sangiovese](grape.md) - The red grape of Tuscany.$ tail -n 1 cellar/wine/chianti.mdMostly [Sangiovese](../grape/grape.md), so read up on [its skins](../grape/grape.md#skins).$ okfctl node list --bundle cellargrape/grape.md Grape Varietywine/acidity.md Conceptwine/chianti.md Conceptwine/tannin.md Concept$ okfctl node promote cellarNo directory-as-concept indexes to promote.The note moved whole, header and body, and both link spellings now point at
the new file with the #skins anchor intact. What’s left in grape/index.md
is the plain generated listing the spec expects, and log.md got a
promoted line. Run promote again and it finds nothing to do.
The bundle-root index.md never gets promoted. The spec lets that one file
carry bundle metadata in its header.
To name every promoted file something other than its folder, pass
--name. okfctl node promote --name overview cellar would have written
grape/overview.md. The one name applies to every folder in the run.
Limits and edge cases
Section titled “Limits and edge cases”promote stops with nothing written if a target name is taken. With a
vine/vine.md in place, the vine/index.md note can’t move there:
$ mkdir cellar/vine$ printf -- '---\ntype: Concept\ntitle: Vine\n---\n\n# Vine\n' > cellar/vine/index.md$ printf -- '---\ntype: Concept\ntitle: Vine care\n---\n\n# Vine care\n' > cellar/vine/vine.md$ okfctl node promote cellarokfctl: cannot promote vine/index.md: destination vine/vine.md already exists as a node$ ls cellar/vineindex.mdvine.mdRename the existing file with node mv or rerun with --name, then
promote. Leave it unpromoted and you get a warning about vine/index.md from
index build and from every node command that rebuilds the index. okfctl
never overwrites an index.md it didn’t write.
index build --overwrite-hand-written does, and that deletes the Vine note.
refresh trusts the commit date git recorded. If the laptop that made the
commit had its clock set a week off, modified lands a week off too, and
okfctl has no way to notice.
show doesn’t print the header, and list doesn’t print titles. Neither
one ever writes a file.
- Index & freshness adds
validate --strictto CI and shows the bulk-commit guard onrefresh. - Starting and authoring a bundle walks through
node new,mv,rm, andedit. - The command reference lists every flag on
node list,node show,node refresh, andnode promote.