docs/user/tools/cli.md
The foam command line tool lets you work with your Foam workspace from the terminal — search, inspect, and manage notes without opening VS Code.
npm install -g foam-cli
foam <command> [options]
Set the FOAM_WORKSPACE environment variable to avoid typing --workspace on every command:
export FOAM_WORKSPACE=/path/to/your/notes
All commands accept --format json for machine-readable output, useful for scripting.
| Command | Description |
|---|---|
| [daily] | Show or create the daily note for a date |
| [grep] | Search note content by pattern |
| [links] | Show links to and from a note |
| [lint] | Check notes for issues |
| [list] | List notes, tags, orphans, placeholders, and more |
| [note] | Show, create, move, or delete notes |
| [outline] | Show the heading structure of a note |
| [rename] | Rename notes, tags, sections, or block anchors |
| [search] | Search notes by title, tag, or frontmatter |
| [tag] | List, rename, or search tags |