Write the wiki
Edit the files
A local wiki is a folder of plain markdown files you own, so you can read, edit, diff and commit it with any tool.
Every page is an ordinary file in your project, with no database behind it. You can edit pages in the browser view, in any text editor, or by asking an agent, and all of them see the same files.
Where the wiki lives
When you start a wiki the agent asks where to put it:
- Private (the default): a folder in your project that git ignores, so it stays on your machine and in this checkout.
- Checked in: a folder you choose, such as
docs/wiki, which you commit and share through git like code.
The folder is saved in a small settings file at the project root. Git worktrees of the same repository share one wiki.
Folder layout
docs/wiki/
Home.md
How we write this wiki.md
Strategy.md
Strategy/ a page's children live in a folder of the same name
Pricing.md
Go-to-market flow.excalidraw
Competitors/
Acme.md a typed page
Acme.activity.jsonl its change log
Partners.csv a table type: one row per item
.trash/ deleted pages, restorable
| Pages | <Title>.md. The file name follows the title, and renaming a page renames its file and its child folder. |
| Children | Live in a folder named after the page. A folder with no matching .md is a page with an empty body. |
| Drawings and sheets | Keep their own extension (.excalidraw, .mindmap, .csv, .calc.md, .mockup.html, .canvas, .html, .prisma), with their metadata in a hidden sidecar file beside them. |
| Attachments | Images and files added to a page go in a hidden .assets/ folder inside the page’s child folder. |
| Trash | Deleting moves a page to .trash/, from where it can be restored. Nothing is removed until the trash entry is purged. |
Frontmatter
A page starts with flat YAML frontmatter:
---
id: 01J9Z3K6V4C2W8N5QX7R1T0BHM
order: 3000
status: current
owner: dana@example.com
summary: How we price the three plans
tags: [pricing, plans]
---
Body text starts here.
idnever changes, even when the page moves or is renamed. A file without one is given one the next time a tool writes to the wiki.ordersets the page’s position among its siblings.typemakes the page a typed page, and its fields sit beside it.- Any other key is a field. Unknown keys are kept on every write.
export: falseleaves the page and everything under it out of a static site.
Links between pages
A link is a relative markdown path whose title carries the target’s id:
[Acme](../Competitors/Acme.md "id=01J9Z3K6V4C2W8N5QX7R1T0BHM")
The path works on GitHub, in editors and for agents. When a page moves or is renamed through the browser view, the agent or nim, every link to it is rewritten. If you move a file by hand, links that carry its id are repointed on the next scan.
Editing by hand safely
- Read before you edit, and save the whole file. Tools check a page’s version before writing, so a stale write from an agent is refused rather than overwriting your edit.
- Keep the frontmatter flat: one key per line, lists in
[a, b]form. - Move pages with the browser view, the agent or
nim wiki movewhen you can, so the child folder moves with the page. - Run
nim wiki listto see the page tree the tools read from your files.
Agents can edit the files directly too. The wiki tools and nim add what plain edits do not: ids, ordering, link rewriting on moves, type fields, table rows and the trash.