CLI commands
Overview
mxr is a single binary with subcommands. Running mxr without arguments launches the TUI.
Core commands
| Command | Purpose |
|---|---|
mxr | Launch TUI |
mxr daemon [--foreground] | Start daemon |
mxr sync [--account NAME] [--status] [--history] | Trigger or inspect sync |
mxr status [--watch] | Daemon health |
mxr doctor | Diagnostics and index/store checks |
Mail retrieval and inspection
mxr search QUERYmxr count QUERYmxr cat MESSAGE_IDmxr thread THREAD_IDmxr headers MESSAGE_IDmxr export THREAD_ID --format markdown|json|mbox|llmmxr export --search QUERY --format mboxUseful flags:
mxr search --format table|json|csv|idsmxr search --limit Nmxr cat --rawmxr cat --htmlmxr thread --format jsonmxr export --output PATH
Saved searches
mxr savedmxr saved listmxr saved add NAME QUERYmxr saved delete NAMEmxr saved run NAMECompose and drafts
mxr composemxr compose --to alice@example.com --subject "hello"mxr reply MESSAGE_IDmxr reply-all MESSAGE_IDmxr forward MESSAGE_ID --to team@example.commxr draftsmxr send DRAFT_IDUseful flags:
--body--body-stdin--attach PATHrepeatable--from ACCOUNT--yes--dry-run
Mail mutations
Single-message or search-scoped:
mxr archive MESSAGE_IDmxr trash MESSAGE_IDmxr spam MESSAGE_IDmxr star MESSAGE_IDmxr unstar MESSAGE_IDmxr read MESSAGE_IDmxr unread MESSAGE_IDmxr label LABEL MESSAGE_IDmxr unlabel LABEL MESSAGE_IDmxr move LABEL MESSAGE_IDmxr unsubscribe MESSAGE_IDmxr open MESSAGE_IDSearch-scoped examples:
mxr archive --search "label:inbox older_than:30d" --yesmxr label FollowUp --search "from:recruiter@example.com" --yesmxr move Done --search "label:inbox from:billing@example.com" --dry-runShared mutation flags:
--search QUERY--yes--dry-run
Snooze
mxr snooze MESSAGE_ID --until tomorrowmxr snooze --search "label:inbox from:alerts@example.com" --until mondaymxr unsnooze MESSAGE_IDmxr unsnooze --allmxr snoozedAccepted preset values include tomorrow, monday, weekend, tonight, or an ISO8601 timestamp.
Attachments
mxr attachments list MESSAGE_IDmxr attachments download MESSAGE_IDmxr attachments download MESSAGE_ID 1 --dir ~/Downloadsmxr attachments open MESSAGE_ID 1Labels
mxr labelsmxr labels create NAME --color "#ff6600"mxr labels rename OLD NEWmxr labels delete NAMERules
mxr rulesmxr rules show RULE_IDmxr rules add NAME --when QUERY --then ACTIONmxr rules edit RULE_ID --then ACTION --disablemxr rules validate --when QUERY --then ACTIONmxr rules enable RULE_IDmxr rules disable RULE_IDmxr rules delete RULE_IDmxr rules dry-run RULE_IDmxr rules dry-run --allmxr rules historyAccounts
mxr accountsmxr accounts add gmailmxr accounts add imapmxr accounts add smtpmxr accounts show ACCOUNTmxr accounts test ACCOUNTObservability
mxr eventsmxr events --type syncmxr notifymxr notify --watchmxr logsmxr logs --level errormxr logs --purgemxr bug-reportmxr bug-report --stdoutmxr bug-report --githubConfig and shell integration
mxr config pathmxr versionmxr completions bashmxr completions zshmxr completions fishOutput formats
Many commands support --format:
tablejsoncsvids
ids is especially useful for shell pipelines:
mxr search "label:inbox unread" --format ids