DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

nylas email drafts list — What It Does and How to Use It

Working with email from the terminal means you don't need to open Gmail or Outlook. nylas email drafts list does the job.

The nylas email drafts list command shows all saved drafts across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP accounts. Use --json to pipe draft data into scripts or count drafts programmatically.

Quick Start

brew install nylas/nylas-cli/nylas
nylas init
nylas email drafts list
Enter fullscreen mode Exit fullscreen mode

Examples

List recent drafts:

nylas email drafts list --limit 10
Enter fullscreen mode Exit fullscreen mode

Count total drafts:

nylas email drafts list --json | jq length
Enter fullscreen mode Exit fullscreen mode

How It Works

The Nylas CLI abstracts away the differences between Gmail's API, Microsoft Graph, Exchange Web Services, and raw IMAP. You write one command; it works across all providers. This matters for automation — your cron job or CI pipeline doesn't need provider-specific logic.

Syntax

nylas email drafts list [--limit N] [--json]
Enter fullscreen mode Exit fullscreen mode

Related Commands


Full docs: nylas email drafts list reference — all flags, advanced examples, and troubleshooting.

All commands: Nylas CLI Command Reference

Get started: brew install nylas/nylas-cli/nylasother install methods

Top comments (0)