Foam

Janitor

To store your personal knowledge graph in markdown files instead of a database, we need some additional tooling to create and maintain relationships with notes.

Foam Janitor (inspired by Andy Matuschak’s note-link-janitor) helps you migrate existing notes to Foam, and maintain your Foam’s health over time.

Currently, Foam’s Janitor helps you to:

In the future, Janitor can help you with

Using Janitor from VS Code (Experimental)

Execute the “Foam: Run Janitor” command from the command palette.

Foam Janitor demo

Using Janitor from command line (Experimental)

⚠️ Improvements to this documentation are welcome!

The Janitor can be installed from NPM and executed as a standalone CLI tool:

> npm install -g foam-cli
> foam janitor path/to/workspace

You can run the Janitor as a git hook on every commit to ensure your workspace links are up to date. This can be especially helpful if you edit your markdown documents from other apps.

You can also run the Janitor from a GitHub action to ensure that all changes coming to your workspace are up to date. This can be useful when editing your Foam notes from mobile (i.e. via GitJournal), or your Foam has multiple contributors and you want to ensure that all changes are correctly integrated.