Command
nylas email list
List recent emails with optional filters.
Written by Qasim Muhammad Staff SRE
What does nylas email list do?
The nylas email list command fetches recent emails from your connected mailbox and displays them in your terminal. Filter by unread, starred, or sender. Use --json for pipe-friendly output in scripts, cron jobs, or AI agent tool calls. When the active grant is a Nylas agent account (provider=nylas), this is also the command to read its inbox — replaces the deprecated nylas inbound messages.
Usage
nylas email list [grant-id] [--unread] [--limit N]Flags
| Flag | Description |
|---|---|
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --unread | Show only unread |
| --starred | Show only starred |
| --from | Filter by sender |
| --limit | Number of messages to fetch (default 10) |
| --all(-a) | Fetch all messages (paginated) |
| --all-folders | Show messages from all folders (default: INBOX only) |
| --folder | Filter by folder (e.g., INBOX, SENT, TRASH, or folder ID) |
| --id | Show message IDs |
| --max | Maximum messages to fetch with --all (0=unlimited) |
| --metadata | Filter by metadata (format: key:value, only key1-key5 supported) |
Examples
List recent emails
nylas email list --limit 10Unread only
nylas email list --unreadJSON for scripting
nylas email list --json --limit 20Read an agent account inbox
nylas email list <agent-account-id> --unread --jsonExample output
FROM SUBJECT DATE
Alice Chen Q3 planning 2026-06-21 09:14
Bob Diaz Re: Invoice #482 2026-06-20 17:02
Newsletter Weekly digest 2026-06-20 08:30
3 messagesTroubleshooting
Migrating from nylas inbound messages <id>
There is no agent-specific messages subcommand. Use nylas email list with the agent account as the active grant (or pass <agent-account-id> positionally). Set NYLAS_AGENT_GRANT_ID for a default.
Recommended guides
List Fastmail emails from the CLI
List Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.
Why Cloud Servers Block SMTP Ports
AWS, GCP, and Azure block outbound SMTP port 25 while ports 587 and 465 stay open. Confirm the block and send email over an HTTPS API instead.
Send Email From a Docker Container
Cloud providers block SMTP port 25 from containers. Send email over an HTTPS API on port 443 with one command and no mail daemon at all.
MailerSend vs Nylas: Email Compared
MailerSend sends transactional email from verified domains. Nylas reads and syncs user inboxes across 6 providers. Compare features, pricing, and use cases.
Customer.io vs Nylas: Email Compared
Customer.io sends lifecycle emails to your user base. Nylas reads and sends from real user inboxes via OAuth. Compare use cases, pricing, and AI agent support.
Knock vs Nylas: Notifications vs Email API
Knock delivers multi-channel product notifications via workflows; Nylas provides two-way email and calendar sync. Compare scope, pricing, and agent support.
Run nylas email list --help for full help output.