Your communication is scattered. Email in Gmail. Messages in Slack. Contacts in Outlook. Notifications via webhooks. Testing with throwaway inboxes. Managing all of this means switching between five different tools.
The Nylas CLI unifies email, Slack, contacts, webhooks, and inbound email into a single command-line interface. Automate cross-platform workflows, build notification pipelines, and manage your entire communication stack from the terminal.
Set Up Your Hub
brew install nylas/nylas-cli/nylas
nylas init
Log into the Nylas Dashboard to manage apps and API keys:
nylas dashboard login --google
nylas dashboard login supports Google, Microsoft, and GitHub SSO. Check your session with nylas dashboard status and list apps with nylas dashboard apps list.
Slack Integration
Connect Slack by storing your bot token:
Authenticate
nylas slack auth set stores your token:
nylas slack auth set --token xoxb-your-bot-token
Browse Channels
nylas slack channels list shows all channels you can access:
nylas slack channels list --json
Read Messages
nylas slack messages list shows recent messages in a channel:
nylas slack messages list --channel general --limit 20
Search Across Slack
nylas slack messages search finds messages workspace-wide:
nylas slack messages search --query "deploy production" --json
Send Messages
nylas slack messages send posts to any channel or DM:
nylas slack messages send --channel deploys --text "v2.3.1 deployed to production"
Update Your Status
nylas slack status set changes your status from the terminal:
nylas slack status set --text "In a meeting" --emoji ":calendar:"
List Users
nylas slack users list shows workspace members:
nylas slack users list --json
Contact Management
List Contacts
nylas contacts list displays your address book:
nylas contacts list --limit 50 --json
Search Contacts
nylas contacts search finds people by name or email:
nylas contacts search --query "Sarah" --json
View Contact Details
nylas contacts show shows everything — emails, phones, company, custom fields:
nylas contacts show --id contact_abc123
Create Contacts
nylas contacts create adds to your address book:
nylas contacts create --name "Sarah Connor" --email "sarah@skynet.com" --company "Cyberdyne"
Sync and Groups
nylas contacts sync refreshes the local cache:
nylas contacts sync
nylas contacts groups list shows contact groups (Google) or categories (Outlook):
nylas contacts groups list --json
Webhooks — Real-Time Notifications
Create a Webhook
nylas webhook create registers a URL for real-time events:
nylas webhook create --url https://api.myapp.com/hooks/email --triggers message.created
List Webhooks
nylas webhook list shows all registered hooks:
nylas webhook list --json
Manage Webhooks
-
nylas webhook update— change URL or triggers -
nylas webhook delete— remove a webhook -
nylas webhook triggers— list all available trigger types
Test and Debug
nylas webhook test send fires a test event to verify your endpoint:
nylas webhook test send https://api.myapp.com/hooks/email
nylas webhook server starts a local HTTP server for development:
nylas webhook server --port 4000
Inbound Email — Receive Without a Mail Server
Need to receive email for testing or automation? Inbound gives you managed addresses — no MX records, no mail server, no OAuth.
Create an Inbox
nylas inbound create provisions a new address:
nylas inbound create test-runner
# → test-runner@yourapp.nylas.email
List Inboxes
nylas inbound list shows all your managed addresses:
nylas inbound list --json
Read Received Messages
nylas inbound messages lists messages in an inbox:
nylas inbound messages inbox_abc123 --unread --json
Monitor in Real Time
nylas inbound monitor streams new messages as they arrive:
nylas inbound monitor inbox_abc123
Extract OTP Codes
nylas workflow otp list scans emails for one-time passwords — useful for automated testing:
nylas workflow otp list --limit 5
Putting It Together: Cross-Platform Alert Pipeline
Here's a real workflow — when a webhook fires, email the team and post to Slack:
#!/bin/bash
# Triggered by webhook server
EVENT="$1"
# Email the team
nylas email send \
--to team@company.com \
--subject "Alert: $EVENT" \
--body "A new event was triggered. Check the dashboard." --yes
# Post to Slack
nylas slack messages send \
--channel alerts \
--text ":rotating_light: $EVENT triggered — check email for details"
Full Command Reference
Every Slack, contacts, webhook, and inbound command with complete documentation: Nylas CLI Command Reference.
Top comments (0)