Source: https://cli.nylas.com/docs/commands/otp-messages

# nylas otp messages

Show recent messages with OTP detection

Written by [Qasim Muhammad](https://cli.nylas.com/authors/qasim-muhammad) Staff SRE

Published February 13, 2026

Updated June 21, 2026

## What does nylas otp messages do?

The nylas otp messages command displays recent messages with OTP detection. It is part of the OTP (One-Time Password) commands, which retrieve OTP/verification codes from email automatically. Use --json for structured output in scripts and automation.

## Usage

```bash
nylas otp messages
```

## Flags

| Flag | Description |
| --- | --- |
| --limit int(-l) | Number of messages to fetch |
| --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 |
| --yes(-y) | Skip confirmations |

## Examples

The nylas otp messages command displays recent messages with OTP detection.

### JSON output for scripting

```bash
nylas otp messages --json
```

### Limit the number of results

```bash
nylas otp messages --limit 10 --json
```

## Troubleshooting

### Command not found or fails

Run `nylas auth config` and `nylas auth login` to authenticate first.

## Related commands

[nylas otp getGet the latest OTP and copy it to clipboard](https://cli.nylas.com/docs/commands/otp-get)

[nylas otp listList configured accounts](https://cli.nylas.com/docs/commands/otp-list)

[nylas otp watchContinuously watch for new OTP codes](https://cli.nylas.com/docs/commands/otp-watch)

## Recommended guides

[List Fastmail emails from the CLIList Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.](https://cli.nylas.com/guides/list-fastmail-emails)

[Thunderbird vs Nylas: GUI vs CLI emailThunderbird is a desktop GUI email client with OAuth and calendar built in. Compare it to a scriptable, headless CLI for servers, cron jobs, and AI agents.](https://cli.nylas.com/guides/nylas-vs-thunderbird)

[Why Cloud Servers Block SMTP PortsAWS, 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.](https://cli.nylas.com/guides/smtp-ports-blocked-on-cloud-servers)

[Send Email From a Docker ContainerCloud 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.](https://cli.nylas.com/guides/send-email-from-docker-container)

[MailerSend vs Nylas: Email ComparedMailerSend sends transactional email from verified domains. Nylas reads and syncs user inboxes across 6 providers. Compare features, pricing, and use cases.](https://cli.nylas.com/guides/mailersend-vs-nylas)

[Customer.io vs Nylas: Email ComparedCustomer.io sends lifecycle emails to your user base. Nylas reads and sends from real user inboxes via OAuth. Compare use cases, data access, and AI agents.](https://cli.nylas.com/guides/customerio-vs-nylas)

Run `nylas otp messages --help` for full help output.
