DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Working with nylas workflow otp list: List one-time password emails, extracting OTP codes from recent messages

The Nylas CLI includes utilities beyond email and calendar. nylas workflow otp list is one of them.

The nylas workflow otp list command scans your inbox for emails containing one-time passwords and verification codes. It extracts the numeric codes from subject lines and message bodies, displaying them alongside sender, subject, and timestamp.

Syntax

nylas workflow otp list [--limit N] [--json]
Enter fullscreen mode Exit fullscreen mode

Examples

Find recent OTP codes:

nylas workflow otp list
Enter fullscreen mode Exit fullscreen mode

Extract the latest OTP code for automation:

nylas workflow otp list --limit 1 --json | jq -r '.[0].code'
Enter fullscreen mode Exit fullscreen mode

Scan last 20 messages for verification codes:

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

Tips

Combine with other commands: Chain nylas workflow otp list with other Nylas CLI commands using shell pipes and variables for complex workflows.

Debug mode: Add --verbose to see the underlying API requests and responses — useful when something doesn't behave as expected.

How It Works

The Nylas CLI includes several utilities beyond the core email, calendar, and contacts commands. These are designed to complement your workflow without requiring separate tools.

Related Commands

  • nylas config reset — Reset all CLI configuration and credentials to a clean state
  • nylas ui — Start web configuration UI
  • nylas air — AI-powered email assistant. Opens an interactive REPL where you can draft, reply
  • nylas completion bash — Generate shell completion script for bash, zsh, fish, or PowerShell

Full docs: nylas workflow otp 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)