Guide
Read Email from Your Terminal
Three tools let you read email without leaving the terminal in 2026: NeoMutt (IMAP native, deeply configurable), aerc (modern Go TUI), and Nylas CLI (API-backed, multi-provider). This guide compares setup time, search, provider support, and scripting output.
Written by Pouya Sanooei Software Engineer
Command references used in this guide: nylas email list, nylas email read, nylas email search, and nylas auth login.
Why read email from the terminal?
Reading email in the terminal means checking your inbox, searching messages, and reading threads without opening a browser or GUI client. Developers who spend 6+ hours per day in a terminal (per the 2024 Stack Overflow Developer Survey, 63% of developers use the terminal as their primary interface) save context-switch time by keeping email in the same window. Three tools handle this in 2026, and each takes a different approach.
NeoMutt speaks IMAP directly, giving you full protocol access to folders, flags, and server-side search. aerc wraps IMAP in a modern Go binary with tabs, threading, and Maildir support. The Nylas CLI talks to a REST API that normalizes 6 email providers behind one interface and returns JSON. The choice depends on whether you want protocol-level control, a polished TUI, or scriptable multi-provider output.
How do NeoMutt, aerc, and Nylas CLI compare?
The table below compares the three tools across 8 dimensions that matter when you pick a terminal email client. NeoMutt has the deepest IMAP feature set. aerc is the easiest full TUI to set up. The CLI wins on provider coverage and machine-readable output. Setup time estimates assume a Gmail account with 2-factor authentication enabled.
| Feature | NeoMutt | aerc | Nylas CLI |
|---|---|---|---|
| Protocol | IMAP / POP3 / Maildir | IMAP / Maildir / notmuch | REST API (HTTPS) |
| Setup time (Gmail) | ~20 minutes | ~10 minutes | ~2 minutes |
| Provider support | Any IMAP server | Any IMAP server | Gmail, Outlook, Exchange, Yahoo, iCloud, IMAP |
| Auth method | App password / XOAUTH2 | App password / XOAUTH2 | OAuth 2.0 (browser flow) |
| Search | IMAP SEARCH / notmuch | IMAP SEARCH / notmuch | Provider-native (Gmail search syntax) |
| JSON output | No | No | Yes (--json) |
| TUI (interactive) | Yes (ncurses) | Yes (tcell) | No (command-line only) |
| First release | 2016 (fork of mutt, est. 1995) | 2019 | 2025 |
NeoMutt and aerc are traditional mail user agents (MUAs) that connect directly to your mail server over IMAP. They give you an interactive inbox you navigate with keyboard shortcuts. The CLI is not a TUI. It's a command-line tool that fetches messages over HTTPS and prints them, which makes it better suited for scripting, piping into jq, and feeding data to other programs.
How do you configure NeoMutt for Gmail?
NeoMutt is a fork of mutt that landed in 2016 with over 200 patches for features like sidebar navigation, compressed folders, and conditional date formatting. Configuring NeoMutt for Gmail requires a .neomuttrc file with IMAP credentials, an app-specific password (since Google disabled “less secure app” access in September 2024), and optional GPG encryption for the stored password. The process takes roughly 20 minutes for a first-time setup.
The configuration below connects NeoMutt to Gmail over IMAPS on port 993 and sends mail through SMTP on port 587. You need to generate an app password in your Google Account security settings first. The imap_idle option enables IMAP IDLE for push notifications, so new messages appear without manual polling. NeoMutt currently has 3,400+ stars on GitHub and is packaged in every major Linux distribution.
# ~/.neomuttrc — Gmail IMAP configuration
set imap_user = "you@gmail.com"
set imap_pass = "your-app-password"
set folder = "imaps://imap.gmail.com:993/"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent Mail"
set trash = "+[Gmail]/Trash"
set smtp_url = "smtps://you@gmail.com@smtp.gmail.com:587/"
set smtp_pass = "$imap_pass"
# Push notifications via IMAP IDLE
set imap_idle = yes
set imap_keepalive = 300
# Sidebar for folder navigation (NeoMutt-specific)
set sidebar_visible = yes
set sidebar_width = 25The main drawback: IMAP config is per-provider. Reading Gmail and Outlook from the same NeoMutt instance requires separate account blocks and manual switching. For multi-account setups, the NeoMutt configuration guide documents the account-hook mechanism.
How do you set up aerc for terminal email?
aerc is a terminal email client written in Go and released in 2019 by Drew DeVault (the creator of Sway and SourceHut). It ships as a single binary, supports IMAP, Maildir, and notmuch backends, and renders HTML email in the terminal via w3m or lynx. Setup takes about 10 minutes. The latest release, aerc 0.18 (February 2025), added tab completion for commands and improved message threading.
The configuration lives in ~/.config/aerc/accounts.conf. Unlike NeoMutt, aerc uses a declarative config format without the Strstrm-style macro language. Install it from your package manager (it's in Homebrew, Arch AUR, Fedora, and Alpine repos), create the accounts file below, and run aerc. The source line points to your IMAP server; the outgoing line points to SMTP.
# ~/.config/aerc/accounts.conf
[Gmail]
source = imaps://you@gmail.com@imap.gmail.com:993
outgoing = smtps://you@gmail.com@smtp.gmail.com:587
default = INBOX
from = Your Name <you@gmail.com>
copy-to = Sentaerc has 2,800+ stars on SourceHut (its primary host) and is also mirrored on GitHub. Its key differentiator from NeoMutt is the notmuch integration: if you sync mail to a local Maildir with mbsync or offlineimap and index it with notmuch, aerc gives you full-text search across your entire archive. IMAP SEARCH alone is limited to server-side capabilities, which vary by provider.
How do you read email with Nylas CLI?
The Nylas CLI reads email from Gmail, Outlook, Exchange, Yahoo, iCloud, and any IMAP provider with a single command. There's no IMAP configuration, no app passwords, and no per-provider config files. Authentication happens through OAuth 2.0 in a browser window, and tokens refresh automatically every 3,600 seconds. Setup takes about 2 minutes: install, run nylas init, authenticate, and list your inbox.
The nylas email list command fetches your most recent messages and prints them to stdout. It returns 10 messages by default, sorted newest-first. Adding --json gives you structured output that pipes cleanly into jq, Python scripts, or AI agent toolchains. The --unread flag filters to unread messages only, and --limit controls how many results come back.
# Install (macOS or Linux)
brew install nylas/nylas-cli/nylas
# Authenticate and connect a mailbox
nylas init
# List 10 most recent emails
nylas email list
# List unread messages as JSON
nylas email list --unread --json
# List emails from a specific sender
nylas email list --from boss@company.com --limit 5 --jsonTo read a full message body, use nylas email read with a message ID. The command returns the full HTML and plain text content, headers, and attachment metadata. Pipe it through jq to extract specific fields. This is where the CLI diverges from NeoMutt and aerc: instead of an interactive TUI, you get structured data you can process programmatically.
# Read a specific message by ID
nylas email read MESSAGE_ID
# Read as JSON and extract the subject and sender
nylas email read MESSAGE_ID --json | jq '{subject: .subject, from: .from}'How does search work in each tool?
Email search is where the three tools differ most. NeoMutt and aerc rely on IMAP SEARCH, which runs server-side with limited operators (FROM, SUBJECT, BODY, SINCE, BEFORE). Gmail's IMAP implementation supports only 5 of the 28 IMAP SEARCH keys defined in RFC 3501. For local full-text search, both tools integrate with notmuch, which indexes a Maildir and supports Boolean queries across 100,000+ messages in under 200ms.
The CLI's search command uses the provider's native search engine. For Gmail accounts, that means full Gmail search syntax (operators like from:, has:attachment, after:, label:). For Outlook, it uses Microsoft's search API. The advantage is zero local indexing and access to provider-specific operators. The tradeoff is that you need a network connection and the search capabilities vary by provider.
# Search across your inbox
nylas email search "quarterly report"
# Search with sender filter
nylas email search "invoice" --from billing@stripe.com --limit 10 --json
# Search with date filter
nylas email search "deploy" --after 2026-05-01 --jsonNeoMutt users who need fast local search typically run notmuch alongside mbsync (for IMAP-to-Maildir sync). That setup takes an additional 15-20 minutes to configure but gives you sub-second full-text search over years of archived mail. aerc supports notmuch natively as a backend, so you can switch between IMAP and notmuch views in the same session.
How do you script email reading in the terminal?
Scripting is the main reason to read email from a CLI rather than a TUI. NeoMutt and aerc are designed for interactive use: they render messages in a curses interface. Extracting data from them programmatically requires parsing human-readable output or using external tools like notmuch show --format=json. The CLI outputs JSON natively, which means every field is accessible with jq in a single pipeline.
The example below counts unread messages per sender, which is useful for building an inbox triage dashboard or feeding data to an AI agent. This pipeline runs in 2-3 seconds for 50 messages because the API returns structured data directly. Doing the same with NeoMutt would require parsing IMAP output or writing a custom script against the IMAP library.
# Count unread messages per sender
nylas email list --unread --json --limit 50 | \
jq -r '.[].from[0].email' | \
sort | uniq -c | sort -rn | head -10
# Export subject lines from the last 20 messages to CSV
nylas email list --json --limit 20 | \
jq -r '.[] | [.date, .from[0].email, .subject] | @csv'
# Check for messages from a specific domain
nylas email list --json --limit 100 | \
jq '[.[] | select(.from[0].email | test("@company\.com$"))] | length'For monitoring scripts, cron jobs, or AI pipelines, JSON output avoids fragile text parsing. A NeoMutt-based approach would need offlineimap + notmuch + custom Python to reach the same result. That's a valid stack, but it's 4 moving parts instead of 1 command.
Which terminal email reader should you choose?
Pick NeoMutt if you want a deeply customizable IMAP client you'll use as your primary email interface. Pick aerc if you want a modern TUI without NeoMutt's 30-year configuration legacy. Pick the CLI if you need structured output, multi-provider access, or email data in scripts and AI agent workflows. The decision tree below covers the 4 most common scenarios.
- Interactive inbox browsing: aerc. It installs in 1 command, has a clean tab interface, and supports threading. NeoMutt is equally capable but takes longer to configure.
- Deep IMAP customization: NeoMutt. Its
.neomuttrcsupports macros, hooks, regex header matching, and GPG integration. Over 200 configuration variables documented on neomutt.org. - Scripting and data extraction: Nylas CLI. The
--jsonflag on every command means no parsing. One pipeline gives you sender counts, CSV exports, or filtered message lists across Gmail, Outlook, and 4 other providers. - Multiple email providers: Nylas CLI. NeoMutt and aerc each need separate IMAP config blocks per provider and separate app passwords. The CLI authenticates each provider once via OAuth and unifies them under the same commands.
The tools aren't mutually exclusive. You can use aerc for daily inbox reading and pipe the CLI's JSON output into scripts that process messages across multiple accounts. Check the full email CLI tools comparison for a broader look at 7 tools including msmtp, mailx, and swaks.
Next steps
- Getting started — install, authenticate, and run your first command in under 2 minutes
- Send email from terminal — the other half of terminal email: sending without SMTP
- Email CLI tools compared — 7-tool comparison including Himalaya, msmtp, mailx, and swaks
- Full command reference — every flag and subcommand documented