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.
Installation
Section titled “Installation”npm install -g foam-clifoam <command> [options]Set the FOAM_WORKSPACE environment variable to avoid typing --workspace on every command:
export FOAM_WORKSPACE=/path/to/your/notesAll commands accept --format json for machine-readable output, useful for scripting.
Commands
Section titled “Commands”| Command | Description |
|---|---|
| foam daily | Show or create the daily note for a date |
| foam grep | Search note content by pattern |
| foam links | Show links to and from a note |
| foam lint | Check notes for issues |
| foam list | List notes, tags, orphans, placeholders, and more |
| foam note | Show, create, move, or delete notes |
| foam outline | Show the heading structure of a note |
| foam rename | Rename notes, tags, sections, or block anchors |
| foam search | Search notes by title, tag, or frontmatter |
| foam tag | List, rename, or search tags |
| foam update | Check for a newer version of foam-cli |
Published with Foam