Skip to content
GitHub stars

Searching

Basic Usage

Terminal window
msgvault search <query>

Search Operators

OperatorDescriptionExample
from:Sender addressfrom:alice@example.com
to:Recipient addressto:bob@example.com
cc:CC recipientcc:team@example.com
bcc:BCC recipientbcc:admin@example.com
subject:Subject textsubject:meeting
label:Gmail labellabel:INBOX, label:SENT
has:attachmentHas attachmentshas:attachment
before:Before datebefore:2024-06-01
after:After dateafter:2024-01-01
older_than:Relative dateolder_than:7d, 2w, 1m, 1y
newer_than:Relative datenewer_than:30d
larger:Minimum sizelarger:5M, 100K
smaller:Maximum sizesmaller:1M

Bare words and "quoted phrases" perform full-text search across message subjects and bodies.

The from:, to:, cc:, and bcc: operators recognize bare domain names with common TLDs. For example, from:example.com automatically matches all messages from the example.com domain. For uncommon TLDs, use the explicit @ prefix: from:@brand.pizza.

Examples

Terminal window
# Search by sender
msgvault search from:alice@example.com
# Search by domain (bare domain with common TLD)
msgvault search from:example.com
# Uncommon TLD requires explicit @ prefix
msgvault search "from:@brand.pizza"
# Subject search
msgvault search subject:meeting
# Date range
msgvault search "after:2024-01-01 before:2024-06-01"
# Messages with attachments
msgvault search has:attachment
# By label
msgvault search label:INBOX
# Combined filters
msgvault search "from:boss@company.com has:attachment after:2024-01-01"
# Full-text search
msgvault search "quarterly report"

Account Filter

In multi-account archives, use --account to limit results to a specific account:

Terminal window
msgvault search "quarterly report" --account work@company.com
# List all messages for an account (no search query needed)
msgvault search --account work@company.com

JSON Output

Add --json for machine-readable output:

Terminal window
msgvault search from:alice@example.com --json

The same msgvault search command supports semantic search in local mode when [vector] is configured with an embedding endpoint. Pass --mode vector for pure semantic search, or --mode hybrid to fuse BM25 and vector ranking. See Vector Search for setup, initial embedding, and incremental update workflows.

When [remote].url is configured, CLI remote search currently uses the FTS API path only; --mode vector and --mode hybrid are local CLI modes. Use the remote server’s HTTP /api/v1/search?mode=... endpoint directly for remote semantic search.