Skip to main content

obsidian-multivault-search

Command-line search for notes across multiple Obsidian vaults. Pure Python, standard library only, no dependencies (Python ≥ 3.11).

The command is available under two names: obsidian-multivault-search and the short alias obmvs. Both do exactly the same; this README uses obmvs.

Installation

[!WARNING] Not on PyPI yet. The package has not been published; a release to PyPI is only planned. Commands such as pipx install obsidian-multivault-search will therefore fail. Until then, install from a clone of this repository.

From a clone of this repository:

git clone https://github.com/saltedmatt/obsidian-multivault-search
cd obsidian-multivault-search
uv tool install .          # installs both commands
# or, without installing anything:
python -m obsidian_multivault_search TERM   # with src/ on PYTHONPATH

There are no dependencies, so plain pip install . into a virtual environment works just as well.

Once the package is published on PyPI, the following will work — these commands do not work yet:

pipx install obsidian-multivault-search
# or
uv tool install obsidian-multivault-search
# or, to try the tool without installing it:
uvx --from obsidian-multivault-search obmvs TERM

Every variant installs the two commands obsidian-multivault-search and obmvs.

Project layout

src/obsidian_multivault_search/
├── __init__.py    public API: cli(), main(), __version__
├── __main__.py    python -m obsidian_multivault_search
├── _meta.py       version and invoked program name
├── markdown.py    stripping markdown formatting off note text
├── vaults.py      finding vaults and their notes
├── search.py      matching terms, extracting context
└── cli.py         argument parsing, search run, output

Usage

obmvs TERM [TERM ...]        # searches the whole home directory
obmvs -d ~/w/vaults TERM     # searches only below that path
obmvs -L                     # list the vaults that were found
  • Vault = a directory containing an .obsidian subfolder; the vault name is the name of that directory. Only such directories are searched. If a vault lies inside another vault, its notes belong to the inner (nearest) vault.
  • Note = a .md file. Hidden folders (.obsidian, .trash, .git …) are skipped, symlinks are not followed by default.
  • Search: substring, case-insensitive. Multiple terms are ANDed together. Quote phrases containing spaces: obmvs "open invoice" 2025.
  • Exclusion: -n TERM excludes notes containing the term (repeatable). Exclusions always apply in addition to the search terms, -o included. If only -n is given, every note that contains none of the terms is listed – without a context column in that case.

Output

One line per matching note, fields separated by tabs, sorted by vault name and note name:

vault-name<TAB>note-name<TAB>context

The context shows the match with up to three words before and after it. Markdown formatting (headings, */_/`, links, wikilinks, table rules, HTML tags …) is stripped; for links the display text is kept. Only the first match per note and search term is shown; with multiple terms the contexts are separated by |.

Options

Option Meaning
-n, --not TERM term that must not occur (repeatable)
-d, --dir PATH search area (repeatable, default: $HOME)
-C, --context N words before/after the match (default: 3)
-s, --case-sensitive respect upper/lower case
-w, --word match whole words only
-e, --regex treat search terms as regular expressions
-o, --or combine with OR instead of AND
-p, --relpath print the path relative to the vault instead of the note name
-F, --sep CHAR output field separator (default: tab)
-L, --list-vaults only list the vaults that were found
--max-depth N maximum depth when looking for vaults
--follow follow symlinks
--color auto|always|never highlight matches (default: auto, terminal only)
-j, --jobs N parallel reads
-V, --version print the version and exit

Exit codes: 0 = matches, 1 = no matches / no vaults, 2 = usage error.

Examples

# notes containing both terms
obmvs kubernetes deployment

# kubernetes, but without any mention of helm or docker
obmvs kubernetes -n helm -n docker

# all notes that do not contain "status"
obmvs -n status

# whole words only, more context, readable columns
obmvs -w -C 6 backup | column -t -s $'\t'

# post-process note names only
obmvs -p invoice | cut -f1,2

License

Licensed under either of

at your option (SPDX: Apache-2.0 OR MIT).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you shall be dual licensed as above, without any additional terms or conditions.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidian_multivault_search-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidian_multivault_search-0.1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_multivault_search-0.1.0.tar.gz.

File metadata

File hashes

Hashes for obsidian_multivault_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7bb8325e007eccb3de512a87402a62451f3a7f95d38d734e057d4861a7653476
MD5 57702f911819dceabe70f263a901674d
BLAKE2b-256 766f5580fad795f97ce6fd7292eeff7e2dd20a6ec24314d772a7e6a75cbade23

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_multivault_search-0.1.0.tar.gz:

Publisher: release.yml on saltedmatt/obsidian-multivault-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obsidian_multivault_search-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_multivault_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d40de2bc2c3235706fbcee9f640b5b3d36ddd8492e07cab142d27851f2069dff
MD5 e59c38a603cd4a829490f71b67651a36
BLAKE2b-256 d0d7cb1160070039c9264cde1442019797a1ff6b488e63ca9a47bc8728fb4b77

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_multivault_search-0.1.0-py3-none-any.whl:

Publisher: release.yml on saltedmatt/obsidian-multivault-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page