Working with email from the terminal means you don't need to open Gmail or Outlook. nylas email read does the job.

The nylas email read command displays the full content of a specific email by ID, including headers, body, and attachments. If the message was GPG-encrypted, it automatically decrypts using your local keyring.

The Problem

You need the full content of an email — headers, body, attachments — in your terminal or script.

Syntax

nylas email read <message-id> [grant-id] [options]

Enter fullscreen mode

Exit fullscreen mode

How It Works

The Nylas CLI abstracts away the differences between Gmail's API, Microsoft Graph, Exchange Web Services, and raw IMAP. You write one command; it works across all providers. This matters for automation — your cron job or CI pipeline doesn't need provider-specific logic.

Examples

Read email:

nylas email read msg_abc123

Enter fullscreen mode

Exit fullscreen mode

Decrypt and verify:

nylas email read msg_xyz789 --decrypt --verify

Enter fullscreen mode

Exit fullscreen mode

Inbound inbox (with grant):

nylas email read msg_xyz123 inbox_abc123 --json

Enter fullscreen mode

Exit fullscreen mode

Key Flags

Run nylas email read --help to see all available flags. Add --json for machine-readable output — useful when piping into jq or feeding data to scripts.

nylas email read --help

Enter fullscreen mode

Exit fullscreen mode

Common Issues

Message not found
Verify the message ID. For Inbound, ensure you pass the inbox (grant) ID.


Full docs: nylas email read reference — all flags, advanced examples, and troubleshooting.

All commands: Nylas CLI Command Reference

Get started: brew install nylas/nylas-cli/nylas — other install methods