| name | nylas |
| description | Nylas CLI for unified email, calendar, and contacts via IMAP/SMTP, Google, and Microsoft 365. Use when reading, searching, composing, sending, or managing email from terminal, scheduling calendar events, managing contacts, extracting OTP codes, running MCP server for AI agents, or using the interactive TUI. |
Nylas CLI — Unified Email, Calendar & Contacts
Quick Start
nylas email list
nylas email send --to recipient@example.com --subject "Hello" --body "Hi there!" -y
nylas email search "invoice"
nylas email read <message-id>
nylas doctor
nylas tui
Setup & Authentication
Install
brew install nylas/nylas-cli/nylas
First-time setup
nylas init
nylas auth config --api-key nyl_xxx
nylas auth login --provider google
nylas auth login --provider microsoft
nylas auth login --provider imap
IMAP setup (non-interactive)
expect -c '
set timeout 60
spawn nylas auth login --provider imap
expect "IMAP username" ; send "user@example.com\r"
expect "IMAP password" ; send "YOUR_PASSWORD\r"
expect "IMAP host" ; send "mail.example.com\r"
expect "IMAP port" ; send "993\r"
expect "Add SMTP" ; send "Y\r"
expect "SMTP host" ; send "mail.example.com\r"
expect "SMTP port" ; send "465\r"
expect eof
'
Verify setup
nylas auth status
nylas auth list
nylas doctor
Core Email Commands
List emails
nylas email list
nylas email list --limit 50
nylas email list --unread
nylas email list --from boss@company.com
nylas email list --folder SENT
nylas email list --folder TRASH
nylas email list --all-folders
nylas email list --all --max 500
nylas email list --json
nylas email list --json --limit 50 | jq '.[].subject'
Read email
nylas email read <message-id>
nylas email read <message-id> --headers
nylas email read <message-id> --raw
nylas email read <message-id> --mark-read
Search emails
nylas email search "quarterly report"
nylas email search "from:alice@example.com"
nylas email search "subject:urgent"
nylas email search "after:2026-01-01 before:2026-03-01"
nylas email search "is:unread"
nylas email search "is:starred"
nylas email search "has:attachment"
Send email
nylas email send --to user@example.com --subject "Hello" --body "Hi there!" -y
nylas email send --to a@example.com --to b@example.com --subject "Team update" --body "..." -y
nylas email send --to user@example.com --cc boss@example.com --bcc archive@example.com \
--subject "FYI" --body "See attached" -y
nylas email send --to user@example.com --subject "Newsletter" \
--body "<h1>Hello</h1><p>HTML content</p>" -y
nylas email send --to user@example.com --subject "Reminder" --body "..." --schedule "2h" -y
nylas email send --to user@example.com --subject "Morning" --body "..." --schedule "tomorrow 9am" -y
nylas email send --to user@example.com --subject "Proposal" --body "..." \
--track-opens --track-links -y
nylas email send --to user@example.com --subject "Secure" --body "..." --sign -y
nylas email send --to bob@example.com --subject "Confidential" --body "..." --encrypt -y
nylas email send --to user@example.com --subject "Draft" -i
Mark, move, delete
nylas email mark read <message-id>
nylas email mark unread <message-id>
nylas email mark starred <message-id>
nylas email mark unstarred <message-id>
nylas email delete <message-id>
nylas email move <message-id> --folder Archive
Calendar Commands
Note: Calendar requires Google or Microsoft 365 provider. IMAP does not support calendar.
nylas calendar calendars list
nylas calendar events list
nylas calendar events create --title "Team standup" --when "tomorrow 9am" --duration 30m
nylas calendar events create --title "1:1" --when "friday 2pm" --duration 45m \
--attendees alice@example.com,bob@example.com
nylas calendar events show <event-id>
nylas calendar events delete <event-id>
Contact Commands
nylas contacts list
nylas contacts list --query "john"
nylas contacts list --json
Folder Management
nylas email folders list
nylas email folders list --id
nylas email folders create --name "Projects"
nylas email folders rename --folder <folder-id> --name "Renamed"
nylas email folders delete --folder <folder-id>
OTP Extraction
nylas otp get
nylas otp watch
MCP Server (AI Integration)
nylas mcp
nylas mcp --transport stdio
nylas mcp --transport sse --port 8080
TUI (Interactive Mode)
nylas tui
Global Flags
| Flag | Description |
|---|
--config <path> | Custom config file path |
--format <fmt> | Output format: table, json, yaml |
--json | Shorthand for --format json |
--no-color | Disable color output |
-q, --quiet | Only output essential data (IDs) |
-v, --verbose | Enable verbose output |
-w, --wide | Show full IDs without truncation |
Provider Support
| Provider | Email | Calendar | Contacts | Auth |
|---|
| Google (Gmail) | ✅ | ✅ | ✅ | OAuth |
| Microsoft 365 (Outlook) | ✅ | ✅ | ✅ | OAuth |
| Exchange (EWS) | ✅ | ✅ | ✅ | OAuth |
| iCloud | ✅ | ✅ | ✅ | App password |
| Yahoo | ✅ | ✅ | ✅ | App password |
| IMAP/SMTP | ✅ | ❌ | ❌ | Credentials |
Important Notes
- IMAP provider supports email only — no calendar or contacts
- Send uses
--to, --subject, --body flags (unlike himalaya which takes raw RFC 5322)
- Use
-y flag to skip confirmation prompts in scripts
- Use
--json for scripting — all commands support JSON output
- API key stored in system keyring — config at
~/.config/nylas/config.yaml
- Free tier (Sandbox) has rate limits — 1 grant, limited API calls
- Nylas routes email through its servers — not a direct IMAP client like himalaya
- Demo mode available —
nylas demo email list works without any account
References