Skip to content

Foam CLI

The foam command line tool lets you work with your Foam workspace from the terminal — search, inspect, and manage notes without opening VS Code.

Terminal window
npm install -g foam-cli
foam <command> [options]

Set the FOAM_WORKSPACE environment variable to avoid typing --workspace on every command:

Terminal window
export FOAM_WORKSPACE=/path/to/your/notes

All commands accept --format json for machine-readable output, useful for scripting.

CommandDescription
foam dailyShow or create the daily note for a date
foam grepSearch note content by pattern
foam linksShow links to and from a note
foam lintCheck notes for issues
foam listList notes, tags, orphans, placeholders, and more
foam mcpExpose the workspace to AI agents via MCP
foam noteShow, create, move, or delete notes
foam outlineShow the heading structure of a note
foam renameRename notes, tags, sections, or block anchors
foam searchSearch notes by title, tag, or frontmatter
foam tagList, rename, or search tags
foam updateCheck for a newer version of foam-cli
Published with Foam