mxr

July 19, 2026 · View on GitHub

A local-first, open-source, keyboard-native email client for terminal users, built around a daemon, a clean provider-agnostic model, and a programmable core.

Document Index

#DocumentWhat it covers
00OverviewProject identity, pitch, core principles, differentiators, language choice, name
01ArchitectureDaemon design, crate map, dependency rules, external crate choices
02Data ModelInternal types, SQLite schema, identity/capability seams, typed IDs, UnsubscribeMethod, Snooze
03ProvidersSplit traits, Gmail, IMAP, SMTP, fake provider, adapter kit, adapter strategy
04SyncSync lifecycle, delta sync, eager body fetch, snooze wake loop, error handling, diagnostics
05SearchTantivy BM25, semantic profiles, search modes, RRF hybrid search, saved searches, operator notes
06Compose$EDITOR flow, YAML frontmatter, context block, markdown→multipart, draft management
07RenderingPlain text first, reader mode, HTML conversion, unsubscribe feature, distraction-free philosophy
08TUILayout, vim motions, keybinding system, command palette, action dispatch, daemon events
09CLISubcommands, semantic/profile commands, output formats, shell integration
10Rules EngineDeterministic rules, conditions/actions, dry-run, shell hooks, phasing
11ExportThread export formats: Markdown, JSON, Mbox, LLM Context
12ConfigTOML structure, semantic search config, model cache, keybindings, credential storage
13Open SourceContributor experience, adapter kit, licensing, CI, repo structure
14RoadmapPhased milestones with checklists: Phase 0-4 + future ideas
15Decision LogEvery "we considered X, chose Y because Z" decision, including hybrid-search model and delivery choices
16AddendumPost-blueprint amendments (A001-A009): inline CLI compose, full CLI surface, vim+Gmail keybindings, daemon observability, TUI batch ops, IMAP first-party, bug reporting
17Release PipelineCI/CD pipeline: PR checks, release automation, scoped binaries, Homebrew, changelog, docs build checks, v1 unsigned macOS policy (D066-D071)
18aOAuth AddendumGmail BYOC-first OAuth guidance, bundled fallback posture, credential storage, redirect flow, and provider scopes
18bBug Reportingmxr bug-report command, log sanitization, log retention, diagnostic capture workflow (D072-D074)
20TransportsTransport-adapter system: frozen protocol + byte-stream adapters + HTTP gateway, trait reference, per-transport security policy, the token gate, the community adapter kit + conformance, and the backlog (D052-D057)
Internal Model AuditKeep/document/tighten/adjust judgment on the current provider-agnostic mail model
IPC AuditCurrent protocol inventory classified into core-mail, mxr-platform, admin-maintenance, and client-specific
Sync / Index Lifecycle AuditCode-truth audit of sync guarantees, lexical freshness, semantic chunk persistence, and repair behavior
Semantic Search AuditCode-truth audit of semantic ingestion, profiles, OCR removal, and hybrid query semantics

For coding agents

This blueprint is designed to be consumed by a coding agent. Every feature is specified in detail. Every design decision includes context on what was considered and rejected. The decision log (15) exists specifically so that an agent doesn't re-debate settled decisions.

Start with 00 (overview) and 14 (roadmap) for the big picture. Use 15 (decision log) as a reference when making implementation choices. Check 16 (addendum) for post-blueprint amendments that override or extend the main docs. Check 17 (release pipeline) for CI/CD and release automation. Consult the specific domain docs (02-13) for detailed specifications.

When blueprint docs conflict with the current repo, prefer code as source of truth. The IPC audit exists specifically to document current implemented contract boundaries.

Core stack summary

ComponentTechnologyCrate
LanguageRust
Async runtimeTokiotokio
DatabaseSQLitesqlx
Search engineTantivytantivy
TUI frameworkRatatuiratatui + crossterm
Email parsingStalwart mail-parsermail-parser
SMTPLettrelettre
Gmail APIDirect RESTreqwest + oauth2
Markdown → HTMLComrakcomrak
Fuzzy matchingNucleo (from Helix)nucleo
CredentialsSystem keyringkeyring
HTML → texthtml2texthtml2text