# allyhub mail search

> List the mail your mailbox received and sent, newest first; each option narrows it

Source: https://allyhub.com/docs/reference/cli/mail-search · AllyHub 0.10.0
Index of all docs: https://allyhub.com/llms.txt

## Usage

```bash
allyhub mail search [options]
```

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `--to` | string |  | Sent to this address (or its part before @), with or without its +tag |
| `--from` | string |  | A part of the sender's address or name |
| `--subject` | string |  | A part of the subject |
| `--text` | string |  | A part of the text |
| `--project` | string |  | Sent to an address labelled with this project |
| `--thread` | string |  | In this thread (a thread id) |
| `--direction` | `in`, `out` |  | in (received) or out (sent); both by default |
| `--since` | string |  | Received after this moment (ISO 8601, as 2026-11-05T10:00:00Z) |
| `--order` | `newest`, `oldest` | `"newest"` | newest or oldest first |
| `--limit` | integer | `20` | How many to list, at most 100 |

## Global options

`--json`: print the result as JSON.

## Output

With `--json`, the command prints an object with these fields:

| Field | Type | What it is |
| --- | --- | --- |
| `messages` | list of object |  |

## Examples

```bash
allyhub mail search --from shop.example --limit 5
allyhub mail search --to ada.acme+staging --since 2026-11-05T10:00:00Z
```

## Exit codes

`0` when it succeeds; the others are listed in [Exit codes](https://allyhub.com/docs/reference/cli/exit-codes.md).

## In the work

**mailbox**: An address of your own: signing up to a site, its codes and links, mail people send you and your answers

[`mail addresses`](https://allyhub.com/docs/reference/cli/mail-addresses.md) → [`mail alias`](https://allyhub.com/docs/reference/cli/mail-alias.md) → [`mail wait`](https://allyhub.com/docs/reference/cli/mail-wait.md) → `mail search` → [`mail read`](https://allyhub.com/docs/reference/cli/mail-read.md) → [`mail send`](https://allyhub.com/docs/reference/cli/mail-send.md) → [`mail reply`](https://allyhub.com/docs/reference/cli/mail-reply.md)
