Concepts
File Groups
A file group is a named collection of note files matched by a glob pattern. Each group has:
- A name (e.g.,
personal,work-notes) - A path - a glob pattern (e.g.,
~/notes/**/*.md)
File groups tell Notes Vault where your notes live. Multiple groups can cover different directories.
Consumers
A consumer is a named destination for synced notes. Each consumer has:
- A name (e.g.,
claude,work-assistant) - A target - the directory where matching files are exported
- An include_queries list - regex patterns matched against file content; at least one must match for the file to be exported
- An exclude_queries list - regex patterns matched against file content; any match prevents export regardless of include matches
- A rename flag - when
true, exported files are renamed to deterministic UUIDs
Matching Logic
For each file, the consumer applies its queries in order:
- If any
exclude_queriespattern matches the file content, the file is skipped - If at least one
include_queriespattern matches the file content, the file is exported - Otherwise, the file is skipped
Exclude always wins. A file that matches both an exclude and an include query is skipped.
Empty Query Lists
A consumer with no include_queries exports nothing. Use .* as an include pattern to match all files.
Sync
nv sync exports files to consumer target directories. For each consumer:
- The target directory is deleted and recreated from scratch
- All files from configured file groups are collected
- Each file is read and tested against the consumer's exclude and include queries
- Files passing the query check are copied to the target
- If
rename: true, files are renamed to a deterministic UUID5 derived from the file path
There is no incremental update or state tracking - each sync is a full rebuild of the target directory.
UUID Renaming
When rename: true, exported files are named <uuid5><extension> where the UUID is derived from the absolute file path. The same source file always produces the same UUID across syncs, making the mapping stable while hiding the original filename from the consumer.
Storage Layout
$XDG_CONFIG_HOME/notes-vault/ (default: ~/.config/notes-vault/)
└── config.yaml # YAML configuration
Consumer target directories:
~/exports/claude/ # example consumer target
~/exports/work-assistant/ # example consumer target
The config file is the only persistent state. Consumer target directories are fully managed by nv sync and are recreated on every run.