Examples
mxr is a single binary with a deep command set. This page is the fast tour: one-liners grouped by what you’re trying to do, each linking to its full guide. Most read commands support --format json; other formats vary by command. The core mail mutations support --dry-run, so most of what follows composes with your shell or an agent.
For multi-step pipelines (fzf, jq, xargs, cron) see Recipes; for the per-command automation guarantees see the Automation Contract.
Get started
Section titled “Get started”Try it on seeded data before connecting anything real.
mxr demo # explore a seeded two-account inbox, safelymxr accounts add gmail # connect Gmail (OAuth) when you're readymxr accounts add imap # or any IMAP servermxr sync --wait # trigger a sync, wait for the account to go idlemxr # open the TUIFull guide → Quick Start · First Sync
Search your mailbox
Section titled “Search your mailbox”Search is the primary way you navigate — instant, local, exact.
mxr search "from:alice@example.com is:unread"mxr search "subject:\"quarterly review\" after:2026-01-01"mxr search "label:work has:attachment"mxr search "has:calendar newer_than:30d"mxr search "{from:amy@example.com from:david@example.com} subject:(dinner movie)" # grouped termsmxr search "holiday AROUND 10 vacation" # proximitymxr search "house of cards" --mode semantic # meaning, not keywordsmxr search "from:notifications@github.com is:unread" --account work --format jsonfrom:, to:, cc:, bcc: and deliveredto: match the whole address,
case-insensitively. from:alice and from:example.com match nothing.
Full guide → Search · Semantic Search
Read and triage
Section titled “Read and triage”Open in reader mode, then clear the inbox a key at a time.
mxr cat MESSAGE_ID --view reader # rendered, trackers strippedmxr snooze --until "tomorrow 9am" MESSAGE_IDmxr snooze --until "friday 5pm" MESSAGE_IDmxr star MESSAGE_IDmxr archive MESSAGE_ID --dry-run # preview firstmxr screener allow alice@example.com # first-time-sender screeningmxr screener feed newsletter@example.com --label "Newsletters"Full guide → Triage Flow · Mailbox Workflow
Compose, reply, forward
Section titled “Compose, reply, forward”Compose opens $EDITOR; the daemon handles parsing, validation, and send.
mxr compose --to alice@example.com --subject "hello"mxr compose --attach ./invoice.pdf --attach ./notes.txtmxr reply MESSAGE_ID --body "Thanks." --dry-runmxr reply-all MESSAGE_IDmxr forward MESSAGE_ID --to team@example.commxr send DRAFT_ID --check # pre-send safety checksmxr snippets set decline "Can't take this on right now." --vars ""Full guide → Compose · Pre-send Safety · Snippets
Clean up and unsubscribe
Section titled “Clean up and unsubscribe”Rank newsletters by how little you read them, then leave — preview, then confirm.
mxr subscriptions --rank --format json # who you never openmxr unsubscribe newsletter@example.com --dry-runmxr unsubscribe newsletter@example.com --yesmxr archive --search "from:noreply@example.com older_than:30d" --dry-runmxr archive --search "from:noreply@example.com older_than:30d" --yesFull guide → Unsubscribe
Never drop a thread
Section titled “Never drop a thread”Surface what you owe, what’s going cold, and what you promised.
mxr owed --since 7 --format json # you owe a replymxr stale --mine --older-than-days 7 # cooling on your sidemxr commitments --status open --format json # promises made in emailmxr remind MESSAGE_ID --when "in 5d" # nudge if no replymxr replies # your reply-later queueFull guide → Forgotten Work · Automated Follow-ups
Labels and saved searches
Section titled “Labels and saved searches”Saved searches are programmable lenses; labels are queues.
mxr labels create FollowUp --color "#ff6600"mxr label FollowUp --search "from:recruiter@example.com"mxr saved add owe-replies "is:unread label:inbox older_than:3d"mxr saved run owe-repliesmxr move Done --search "label:inbox from:billing@example.com"Full guide → Labels and Saved Searches
Schedule and follow up
Section titled “Schedule and follow up”Send later, set send-and-remind, and unsend within the window.
mxr send DRAFT_ID --at "tomorrow 9am"mxr reply MESSAGE_ID --body "On it." --yes --remind-after "in 5d"mxr unsend DRAFT_IDFull guide → Timing and Cadence · Automated Follow-ups
Understand your mail
Section titled “Understand your mail”Analytics over the local corpus — no dashboard, no upload.
mxr response-time --since-days 90 # how fast you replymxr response-time --counterparty client@example.com --theirsmxr contacts asymmetry --min-inbound 5 # one-sided relationshipsmxr contacts decay --threshold-days 60 # contacts going quietmxr storage --by label --limit 20 # what's eating diskmxr wrapped # your year in emailFull guide → Analytics
Ask, summarize, extract
Section titled “Ask, summarize, extract”Optional LLM features that read your mail and hand back structure.
mxr ask "what did Alice and I decide about pricing in Q2?"mxr summarize --search "from:team@example.com newer_than:7d" --limit 5mxr expert --query "DKIM setup" --format json # answer from your archivemxr briefing recipient alice@example.com --format json # prep before a meetingmxr draft-assist THREAD_ID "Build a 1:1 agenda, grouped by open question."Full guide → LLM Features · Briefings and Loop-in
Automate and pipe
Section titled “Automate and pipe”Most reads emit JSON, and the core mail mutations accept IDs from stdin. It’s a Unix citizen.
# archive everything from a sender — reviewed firstmxr search "from:no-reply@example.com older_than:30d" --format ids | xargs -I{} mxr archive {} --dry-run
# export a thread as markdown for your notes (or an agent)mxr export THREAD_ID --format markdown > thread.md
# every unread from one sender, as JSONLmxr search "is:unread from:billing@acme.com" --format jsonlFull guide → Recipes · Automation Contract
Drive it from an agent
Section titled “Drive it from an agent”The CLI, MCP server, and HTTP bridge all call the same daemon. Most reads return JSON, and the core mail mutations support --dry-run.
mxr mcp serve # typed tools over stdiomxr search "from:sarah@example.com after:2026-04-23" --format json | jq '.results[0]'mxr archive --search "from:newsletter@example.com" --dry-runmxr history --category mutation --limit 3 --format json # audit trailFull guide → For Agents · MCP Server
Server-side automations, validated and dry-run before they touch mail.
mxr rules add "Archive newsletters" --when "label:newsletters unread" --then archivemxr rules dry-run --allmxr rules validate --when "from:billing@example.com" --then "add-label:finance"Full guide → Rules
Multiple accounts
Section titled “Multiple accounts”One mailbox, one search, many providers.
mxr accounts add gmailmxr accounts add imapmxr search "is:unread" --account work --format jsonmxr accounts addresses add alias@example.com # register a provider-configured alias locallyFull guide → Accounts