Command
nylas email smart-compose
AI-powered email composition — generate a draft from a text prompt.
Written by Qasim Muhammad Staff SRE
What does nylas email smart-compose do?
The nylas email smart-compose command uses Nylas Smart Compose to generate an email draft from a natural language --prompt. Pass --message-id to generate a context-aware reply to an existing message instead of a brand-new email. Requires a Nylas Plus package subscription.
Usage
nylas email smart-compose --prompt PROMPT [--message-id MESSAGE_ID]Flags
| Flag | Description |
|---|---|
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --prompt | AI instruction for generating the email (required, max 1000 tokens) |
| --message-id | Message ID to reply to (optional, generates reply if provided) |
Examples
The nylas email smart-compose command uses Nylas Smart Compose to generate an email draft from a natural language --prompt.
Generate a new email draft
nylas email smart-compose --prompt "Draft a thank you email for the meeting"Generate a reply to a specific message
nylas email smart-compose --message-id msg_abc123 --prompt "Reply accepting the invitation"Output the generated draft as JSON
nylas email smart-compose --prompt "Write a follow-up email" --jsonExample output
Generated draft:
Hi Alice,
Thanks for the productive meeting today. I'll send over the Q3 roadmap by Friday as discussed.
Best,
BobTroubleshooting
Generated content is off-topic or generic
Pass --message-id to give the AI the original message as context. More specific prompts produce better results.
Command not available or returns a subscription error
Smart Compose requires a Nylas Plus package subscription. Confirm your application's plan in the Nylas dashboard.
Recommended guides
List Fastmail emails from the CLI
List Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.
Why Cloud Servers Block SMTP Ports
AWS, GCP, and Azure block outbound SMTP port 25 while ports 587 and 465 stay open. Confirm the block and send email over an HTTPS API instead.
Send Email From a Docker Container
Cloud providers block SMTP port 25 from containers. Send email over an HTTPS API on port 443 with one command and no mail daemon at all.
MailerSend vs Nylas: Email Compared
MailerSend sends transactional email from verified domains. Nylas reads and syncs user inboxes across 6 providers. Compare features, pricing, and use cases.
Customer.io vs Nylas: Email Compared
Customer.io sends lifecycle emails to your user base. Nylas reads and sends from real user inboxes via OAuth. Compare use cases, pricing, and AI agent support.
Knock vs Nylas: Notifications vs Email API
Knock delivers multi-channel product notifications via workflows; Nylas provides two-way email and calendar sync. Compare scope, pricing, and agent support.
Run nylas email smart-compose --help for full help output.