DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on • Originally published at cli.nylas.com

Nylas CLI: Email, Calendar & Contacts from Your Terminal

Nylas CLI is a free, open-source command-line tool that gives you unified access to email, calendar, and contacts across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP. One interface, six providers, zero API plumbing.

Get started

  1. Sign up for Nylas and create an API key
  2. Connect at least one email account under Grants
  3. Install the CLI
  4. Authenticate with your API key

Install:

# macOS / Linux
brew install nylas/nylas-cli/nylas

# Or via shell script
curl -fsSL https://cli.nylas.com/install.sh | bash

# Windows
irm https://cli.nylas.com/install.ps1 | iex

# Go (any platform)
go install github.com/nylas/cli/cmd/nylas@latest
Enter fullscreen mode Exit fullscreen mode

Authenticate:

nylas auth config --api-key YOUR_API_KEY
Enter fullscreen mode Exit fullscreen mode

Full docs and guides: cli.nylas.com

What can you do with it?

Read and send email

# List your recent emails
nylas email list

# Search for specific messages
nylas email search --query "from:alice budget Q4"

# Send an email
nylas email send --to bob@company.com --subject "Meeting notes" --body "Attached."

# AI-powered email drafting
nylas email smart-compose --prompt "Follow up on yesterday's call with Lisa"
Enter fullscreen mode Exit fullscreen mode

Manage your calendar

# List upcoming events
nylas calendar list

# Create an event
nylas calendar create --title "Standup" --start "2026-03-22T09:00:00" --duration 30m

# Check free/busy availability
nylas calendar availability --email alice@company.com --date 2026-03-25
Enter fullscreen mode Exit fullscreen mode

Look up contacts

# Search contacts
nylas contacts search "Sarah Chen"

# List all contacts
nylas contacts list
Enter fullscreen mode Exit fullscreen mode

Pipe-friendly JSON output

Every command supports --output json for scripting:

# Get unread count
nylas email list --unread --output json | jq length

# Extract sender emails from recent messages
nylas email list --limit 20 --output json | jq -r '.[].from[0].email'
Enter fullscreen mode Exit fullscreen mode

Built-in MCP server for AI agents

Nylas CLI includes a Model Context Protocol (MCP) server. This means Claude Desktop, Cursor, Windsurf, and VS Code can read your email, check your calendar, and send messages directly:

nylas mcp serve
Enter fullscreen mode Exit fullscreen mode

Add it to your Claude Desktop config and your AI assistant gets full email and calendar access. No custom code needed.

More details: Give AI Agents Email Access via MCP

GPG encrypted email

Send and receive PGP/GPG encrypted email from the terminal. The CLI auto-fetches public keys from keyservers:

# Send encrypted + signed
nylas email send --to alice@company.com --subject "Confidential" --body "See attached" --gpg --sign

# Read and decrypt
nylas email read <message-id> --gpg
Enter fullscreen mode Exit fullscreen mode

Full guide: GPG Encrypted Email from the CLI

E2E email testing with Playwright

Test password reset flows, invitation emails, and verification links end-to-end:

# Poll for a specific email in your test
nylas email search --query "subject:Reset your password" --wait 30 --output json
Enter fullscreen mode Exit fullscreen mode

Pair with Playwright to verify content and click links. No Gmail API credentials in CI.

Full guide: E2E Email Testing with Playwright

Works across six providers

Provider Auth Status
Gmail OAuth2 Supported
Outlook / Microsoft 365 OAuth2 Supported
Exchange Online OAuth2 Supported
Yahoo Mail OAuth2 Supported
iCloud Mail OAuth2 Supported
Any IMAP server OAuth2 / App password Supported

You write one command. Nylas handles the provider differences.

Learn more

Top comments (0)