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]
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
Decrypt and verify:
nylas email read msg_xyz789 --decrypt --verify
Inbound inbox (with grant):
nylas email read msg_xyz123 inbox_abc123 --json
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
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
Top comments (0)