DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Build a Cross-Platform Communication Hub — Email, Slack, Contacts & Webhooks from One CLI

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
Enter fullscreen mode Exit fullscreen mode

Log into the Nylas Dashboard to manage apps and API keys:

nylas dashboard login --google
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Browse Channels

nylas slack channels list shows all channels you can access:

nylas slack channels list --json
Enter fullscreen mode Exit fullscreen mode

Read Messages

nylas slack messages list shows recent messages in a channel:

nylas slack messages list --channel general --limit 20
Enter fullscreen mode Exit fullscreen mode

Search Across Slack

nylas slack messages search finds messages workspace-wide:

nylas slack messages search --query "deploy production" --json
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

Update Your Status

nylas slack status set changes your status from the terminal:

nylas slack status set --text "In a meeting" --emoji ":calendar:"
Enter fullscreen mode Exit fullscreen mode

List Users

nylas slack users list shows workspace members:

nylas slack users list --json
Enter fullscreen mode Exit fullscreen mode

Contact Management

List Contacts

nylas contacts list displays your address book:

nylas contacts list --limit 50 --json
Enter fullscreen mode Exit fullscreen mode

Search Contacts

nylas contacts search finds people by name or email:

nylas contacts search --query "Sarah" --json
Enter fullscreen mode Exit fullscreen mode

View Contact Details

nylas contacts show shows everything — emails, phones, company, custom fields:

nylas contacts show --id contact_abc123
Enter fullscreen mode Exit fullscreen mode

Create Contacts

nylas contacts create adds to your address book:

nylas contacts create --name "Sarah Connor" --email "sarah@skynet.com" --company "Cyberdyne"
Enter fullscreen mode Exit fullscreen mode

Sync and Groups

nylas contacts sync refreshes the local cache:

nylas contacts sync
Enter fullscreen mode Exit fullscreen mode

nylas contacts groups list shows contact groups (Google) or categories (Outlook):

nylas contacts groups list --json
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

List Webhooks

nylas webhook list shows all registered hooks:

nylas webhook list --json
Enter fullscreen mode Exit fullscreen mode

Manage Webhooks

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
Enter fullscreen mode Exit fullscreen mode

nylas webhook server starts a local HTTP server for development:

nylas webhook server --port 4000
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

List Inboxes

nylas inbound list shows all your managed addresses:

nylas inbound list --json
Enter fullscreen mode Exit fullscreen mode

Read Received Messages

nylas inbound messages lists messages in an inbox:

nylas inbound messages inbox_abc123 --unread --json
Enter fullscreen mode Exit fullscreen mode

Monitor in Real Time

nylas inbound monitor streams new messages as they arrive:

nylas inbound monitor inbox_abc123
Enter fullscreen mode Exit fullscreen mode

Extract OTP Codes

nylas workflow otp list scans emails for one-time passwords — useful for automated testing:

nylas workflow otp list --limit 5
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

Full Command Reference

Every Slack, contacts, webhook, and inbound command with complete documentation: Nylas CLI Command Reference.

Top comments (0)