Skip to content
Jonathan D.A. Jewell edited this page Sep 15, 2026 · 1 revision

Diagnostics

berrywiki check <folder> loads the wiki and prints its tree followed by every diagnostic it found. Each diagnostic carries a dotted code and a severity.

Exit codes

Code Meaning
0 Loaded. No error-level diagnostic. Warnings may still have been printed.
1 At least one error-level diagnostic.
2 Could not get that far — the folder is missing, another writer holds the wiki's lock, or stdout could not be written.

Warnings do not fail the check. That is the point of the split: a wiki with a broken link is still a wiki, and a build should not stop for one.

Errors

These are the only two. Both mean the page tree cannot be trusted.

Code What happened
graph.duplicate-id Two pages declare the same id. Identity is the one thing the format guarantees, so this is never tolerated.
graph.cycle The parent links form a loop, so some set of pages is its own ancestor and the tree has no root.

Warnings

Code What happened
graph.missing-parent A page's parent names an id no page has. The page is still loaded — it is treated as a root — but the structure you wrote is not the structure you got.
link.broken A wiki link points at no page.
link.ambiguous A wiki link could resolve to more than one page.
metadata.missing-id The page has a metadata block with no id.
metadata.unterminated The metadata block was opened and never closed.
metadata.unparsed-line A line inside the block was not understood.
metadata.bad-position position is present but is not a number.
metadata.bad-archived archived is present but is not true or false.
store.unreadable-file A file in the folder could not be read. The rest of the wiki still loads.

Why the metadata ones are warnings

Malformed metadata never breaks a page — see Page Format. A bad position, an unterminated block or a line BerryWiki does not recognise degrades the structure while leaving the content readable, and content is what you came for. check tells you about it; it does not refuse to work.

Reading the summary line

check ends with a count of the form N error(s), M warning(s). A clean wiki prints 0 error(s), 0 warning(s) and exits 0. If you are wiring this into CI, the exit code is the contract — do not parse the line.

Clone this wiki locally