DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Star or flag an email from the Command Line

Scripts, cron jobs, and AI agents all need email access. nylas email mark-starred provides it without SMTP configuration.

The nylas email mark-starred command adds a star (Gmail) or flag (Outlook, Exchange) to a message. Use it to highlight important emails from scripts or AI agents.

Syntax

nylas email mark-starred --id MESSAGE_ID
Enter fullscreen mode Exit fullscreen mode

Examples

Star a specific email:

nylas email mark-starred --id msg_abc123
Enter fullscreen mode Exit fullscreen mode

Star all emails from a VIP sender:

nylas email list --from ceo@company.com --json | jq -r '.[].id' | xargs -I{} nylas email mark-starred --id {}
Enter fullscreen mode Exit fullscreen mode

When to Use This

Reach for nylas email mark-starred when you need to process email in shell scripts, cron jobs, CI/CD pipelines, or AI agent tool calls. Combine with --json to pipe output into other tools.

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.

Related Commands


Full docs: nylas email mark-starred 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)