Skip to content

foam tag

List, rename, or search tags.

foam tag <subcommand> [options]

List all tags in the workspace.

Terminal window
foam tag list [options]

This is an alias for foam list tags. Accepts the same filtering and sorting options.

OptionDescription
--prefix <str>Filter by tag prefix
--sort <count|name>Sort order (default: name)
--limit <n>Maximum number of results

Example:

Terminal window
foam tag list
# #daily (12 notes)
# #project (8 notes)
# #project/active (3 notes)

Rename a tag across the entire workspace, including its hierarchical children.

Terminal window
foam tag rename <old> <new>
OptionDescription
--forceSkip confirmation if the rename would merge two existing tags

Example:

Terminal window
foam tag rename todo in-progress
# Renamed: #todo → #in-progress (5 notes updated)

Renaming a parent tag also renames its children. Renaming project to work will also rename project/active to work/active.

Find all notes with a given tag.

Terminal window
foam tag search <tag>

This is an alias for foam search --tag <tag>.

Example:

Terminal window
foam tag search project
# notes/alpha.md:1: # Project Alpha
# notes/beta.md:1: # Project Beta
OptionDescription
--workspace <dir>Workspace root (default: FOAM_WORKSPACE env var, then current directory)
--format <fmt>Output format: text (default) or json

See also Tags for tag management in VS Code.

Published with Foam