## Global flags

Every command the CLI has, generated from the same data as `machinemail --help`, grouped as `--help` groups them. `mm` is the same binary, so every example also works with `mm` in place of `machinemail`.

```shell
machinemail <command> [args] [flags]
machinemail <resource> <action> [args] [flags]
```

Resource commands are generated from the [API reference](/content/docs/reference/api/index.html): path parameters are arguments, query parameters and body fields are flags. A route that also exists under a pod or an inbox is one command with a `--pod` or `--inbox` flag. Flag values are typed: integers are checked, booleans take `--flag`, `--flag=false` or `--no-flag`, arrays repeat the flag, objects take JSON, and `-d/--data` takes the whole body as JSON, `@file` or `-` for stdin. See [Output and scripting](/content/docs/cli/output-and-scripting/index.html) for output formats and exit codes.

## Global flags

Every command accepts these. Command flags go after `<resource> <action>`.

| Field | Description |
| --- | --- |
| `--json` | `boolean` Print raw JSON, even on a terminal. |
| `--fields <a,b.c>` | `string` Only these fields (dot paths), in JSON and tables. |
| `--profile <name>` | `string` Config profile (MACHINEMAIL_PROFILE). |
| `--api-key <key|->` | `string` API key, or - to read it from stdin. Prefer MACHINEMAIL_API_KEY or a profile: a literal key shows in ps and shell history. |
| `--base-url <url>` | `string` API origin (MACHINEMAIL_BASE_URL). |
| `-v, --verbose` | `boolean` Log requests and responses to stderr (keys redacted). |
| `-q, --quiet` | `boolean` No spinners or success lines; errors still print. |
| `-y, --yes` | `boolean` Confirm deletes without asking (needed when there is no terminal to ask on). |
| `--color` | `boolean` Color on or off (default: on for a terminal; NO_COLOR also turns it off). Default is `on for a terminal` |
| `-h, --help` | `boolean` Show help.

## Getting started

| Command | Summary |
| --- | --- |
| [`login`](/content/docs/cli/commands/setup#login/index.html) | Sign in with the browser (or an API key) and save the key to a profile |
| [`whoami`](/content/docs/cli/commands/setup#whoami/index.html) | Show the key, profile and API in use, and check the key |
| [`doctor`](/content/docs/cli/commands/setup#doctor/index.html) | Check the config, connectivity, key, clock and CLI version |
| [`register`](/content/docs/cli/commands/setup#register/index.html) | Register this agent (auth.md): a sandbox inbox and credentials, no human needed |
| [`claim`](/content/docs/cli/commands/setup#claim/index.html) | Get a new claim code for a registered agent, and wait for a human to claim it |
| [`logout`](/content/docs/cli/commands/setup#logout/index.html) | Remove the stored key from a profile, and optionally revoke it |

## Mail

| Command | Summary |
| --- | --- |
| [`send`](/content/docs/cli/commands/mail#send/index.html) | Send an email from an inbox |
| [`read`](/content/docs/cli/commands/mail#read/index.html) | Show a message: headers, trust verdict and agent-safe text |
| [`wait`](/content/docs/cli/commands/mail#wait/index.html) | Wait for a message to arrive (and extract a code or magic link with —otp) |
| [`tail`](/content/docs/cli/commands/mail#tail/index.html) | Follow live events (messages, deliveries, inboxes) as they happen |
| [`messages attachment`](/content/docs/cli/commands/messages#messages-attachment/index.html) | Get attachment |
| [`messages batch-get`](/content/docs/cli/commands/messages#messages-batch-get/index.html) | Batch get messages |
| [`messages batch-update`](/content/docs/cli/commands/messages#messages-batch-update/index.html) | Batch update messages |
| [`messages delete`](/content/docs/cli/commands/messages#messages-delete/index.html) | Delete message |
| [`messages download`](/content/docs/cli/commands/messages#messages-download/index.html) | Download attachment |
| [`messages forward`](/content/docs/cli/commands/messages#messages-forward/index.html) | Forward message |
| [`messages get`](/content/docs/cli/commands/messages#messages-get/index.html) | Get message |
| [`messages list`](/content/docs/cli/commands/messages#messages-list/index.html) | List messages |
| [`messages raw`](/content/docs/cli/commands/messages#messages-raw/index.html) | Get raw message |
| [`messages reply`](/content/docs/cli/commands/messages#messages-reply/index.html) | Reply to a message |
| [`messages reply-all`](/content/docs/cli/commands/messages#messages-reply-all/index.html) | Reply to all recipients of a message |
| [`messages search`](/content/docs/cli/commands/messages#messages-search/index.html) | Search messages |
| [`messages send`](/content/docs/cli/commands/messages#messages-send/index.html) | Send message |
| [`messages trust`](/content/docs/cli/commands/messages#messages-trust/index.html) | Get message trust report |
| [`messages update`](/content/docs/cli/commands/messages#messages-update/index.html) | Update message |
| [`threads delete`](/content/docs/cli/commands/threads#threads-delete/index.html) | Delete thread |
| [`threads get`](/content/docs/cli/commands/threads#threads-get/index.html) | Get thread |
| [`threads list`](/content/docs/cli/commands/threads#threads-list/index.html) | List threads |
| [`threads search`](/content/docs/cli/commands/threads#threads-search/index.html) | Search threads |
| [`threads update`](/content/docs/cli/commands/threads#threads-update/index.html) | Update thread |
| [`drafts create`](/content/docs/cli/commands/drafts#drafts-create/index.html) | Create draft |
| [`drafts delete`](/content/docs/cli/commands/drafts#drafts-delete/index.html) | Delete draft |
| [`drafts download-attachment`](/content/docs/cli/commands/drafts#drafts-download-attachment/index.html) | Download draft attachment |
| [`drafts get`](/content/docs/cli/commands/drafts#drafts-get/index.html) | Get draft |
| [`drafts list`](/content/docs/cli/commands/drafts#drafts-list/index.html) | List drafts |
| [`drafts send`](/content/docs/cli/commands/drafts#drafts-send/index.html) | Send draft |
| [`drafts update`](/content/docs/cli/commands/drafts#drafts-update/index.html) | Update draft |
| [`inbound raw`](/content/docs/cli/commands/inbound#inbound-raw/index.html) | Inject raw message |

## Inboxes

| Command | Summary |
| --- | --- |
| [`inboxes availability`](/content/docs/cli/commands/inboxes#inboxes-availability/index.html) | Check inbox availability |
| [`inboxes create`](/content/docs/cli/commands/inboxes#inboxes-create/index.html) | Create inbox |
| [`inboxes delete`](/content/docs/cli/commands/inboxes#inboxes-delete/index.html) | Delete inbox |
| [`inboxes export`](/content/docs/cli/commands/inboxes#inboxes-export/index.html) | Export inbox |
| [`inboxes get`](/content/docs/cli/commands/inboxes#inboxes-get/index.html) | Get inbox |
| [`inboxes list`](/content/docs/cli/commands/inboxes#inboxes-list/index.html) | List inboxes |
| [`inboxes new`](/content/docs/cli/commands/inboxes#inboxes-new/index.html) | Create an inbox and print its address (pipe-friendly) |
| [`inboxes search`](/content/docs/cli/commands/inboxes#inboxes-search/index.html) | Search inboxes |
| [`inboxes update`](/content/docs/cli/commands/inboxes#inboxes-update/index.html) | Update inbox |
| [`pods create`](/content/docs/cli/commands/pods#pods-create/index.html) | Create pod |
| [`pods delete`](/content/docs/cli/commands/pods#pods-delete/index.html) | Delete pod |
| [`pods get`](/content/docs/cli/commands/pods#pods-get/index.html) | Get pod |
| [`pods list`](/content/docs/cli/commands/pods#pods-list/index.html) | List pods |
| [`pods update`](/content/docs/cli/commands/pods#pods-update/index.html) | Update pod |
| [`lists create`](/content/docs/cli/commands/lists#lists-create/index.html) | Create list entry |
| [`lists delete`](/content/docs/cli/commands/lists#lists-delete/index.html) | Delete list entry |
| [`lists get`](/content/docs/cli/commands/lists#lists-get/index.html) | Get list entry |
| [`lists list`](/content/docs/cli/commands/lists#lists-list/index.html) | List the entries of an allow or block list |
| [`suppressions create`](/content/docs/cli/commands/suppressions#suppressions-create/index.html) | Add suppression |
| [`suppressions delete`](/content/docs/cli/commands/suppressions#suppressions-delete/index.html) | Remove suppression |
| [`suppressions get`](/content/docs/cli/commands/suppressions#suppressions-get/index.html) | Get suppression |
| [`suppressions list`](/content/docs/cli/commands/suppressions#suppressions-list/index.html) | List suppressions |

## Domains

| Command | Summary |
| --- | --- |
| [`domains connect`](/content/docs/cli/commands/domains#domains-connect/index.html) | Get Domain Connect setup |
| [`domains create`](/content/docs/cli/commands/domains#domains-create/index.html) | Create domain |
| [`domains delete`](/content/docs/cli/commands/domains#domains-delete/index.html) | Delete domain |
| [`domains get`](/content/docs/cli/commands/domains#domains-get/index.html) | Get domain |
| [`domains list`](/content/docs/cli/commands/domains#domains-list/index.html) | List domains |
| [`domains update`](/content/docs/cli/commands/domains#domains-update/index.html) | Update domain |
| [`domains verify`](/content/docs/cli/commands/domains#domains-verify/index.html) | Verify domain |
| [`domains zone-file`](/content/docs/cli/commands/domains#domains-zone-file/index.html) | Get zone file |

## Webhooks

| Command | Summary |
| --- | --- |
| [`webhooks create`](/content/docs/cli/commands/webhooks#webhooks-create/index.html) | Create webhook |
| [`webhooks delete`](/content/docs/cli/commands/webhooks#webhooks-delete/index.html) | Delete webhook |
| [`webhooks deliveries`](/content/docs/cli/commands/webhooks#webhooks-deliveries/index.html) | List deliveries |
| [`webhooks get`](/content/docs/cli/commands/webhooks#webhooks-get/index.html) | Get webhook |
| [`webhooks headers`](/content/docs/cli/commands/webhooks#webhooks-headers/index.html) | Get webhook headers |
| [`webhooks list`](/content/docs/cli/commands/webhooks#webhooks-list/index.html) | List webhooks |
| [`webhooks replay`](/content/docs/cli/commands/webhooks#webhooks-replay/index.html) | Replay delivery |
| [`webhooks test`](/content/docs/cli/commands/webhooks#webhooks-test/index.html) | Send test event |
| [`webhooks update`](/content/docs/cli/commands/webhooks#webhooks-update/index.html) | Update webhook |
| [`webhooks update-headers`](/content/docs/cli/commands/webhooks#webhooks-update-headers/index.html) | Update webhook headers |
| [`events get`](/content/docs/cli/commands/events#events-get/index.html) | Get event |
| [`events list`](/content/docs/cli/commands/events#events-list/index.html) | List events |
| [`events stream`](/content/docs/cli/commands/events#events-stream/index.html) | Stream events as they happen (server-sent events) |

## Admin

| Command | Summary |
| --- | --- |
| [`org get`](/content/docs/cli/commands/org#org-get/index.html) | Get organization |
| [`org members`](/content/docs/cli/commands/org#org-members/index.html) | List members |
| [`org update`](/content/docs/cli/commands/org#org-update/index.html) | Update organization |
| [`org usage`](/content/docs/cli/commands/org#org-usage/index.html) | Get plan usage |
| [`api-keys create`](/content/docs/cli/commands/api-keys#api-keys-create/index.html) | Create API key |
| [`api-keys delete`](/content/docs/cli/commands/api-keys#api-keys-delete/index.html) | Delete API key |
| [`api-keys get`](/content/docs/cli/commands/api-keys#api-keys-get/index.html) | Get API key |
| [`api-keys list`](/content/docs/cli/commands/api-keys#api-keys-list/index.html) | List API keys |
| [`api-keys update`](/content/docs/cli/commands/api-keys#api-keys-update/index.html) | Update API key |
| [`agent-registrations delete`](/content/docs/cli/commands/agent-registrations#agent-registrations-delete/index.html) | Revoke agent registration |
| [`agent-registrations get`](/content/docs/cli/commands/agent-registrations#agent-registrations-get/index.html) | Get agent registration |
| [`agent-registrations list`](/content/docs/cli/commands/agent-registrations#agent-registrations-list/index.html) | List agent registrations |
| [`metrics events`](/content/docs/cli/commands/metrics#metrics-events/index.html) | Query events |
| [`metrics rates`](/content/docs/cli/commands/metrics#metrics-rates/index.html) | Query rates |
| [`metrics usage`](/content/docs/cli/commands/metrics#metrics-usage/index.html) | Query usage |
| [`health check`](/content/docs/cli/commands/health#health-check/index.html) | Check that the API is up (liveness) |
| [`health ready`](/content/docs/cli/commands/health#health-ready/index.html) | Check that the API can serve requests (readiness) |
| [`import agentmail`](/content/docs/cli/commands/import#import-agentmail/index.html) | Copy AgentMail settings (pods, domains, inboxes, webhooks, lists) into MachineMail |

## CLI

| Command | Summary |
| --- | --- |
| [`open`](/content/docs/cli/commands/utilities#open/index.html) | Open the dashboard in a browser |
| [`completion`](/content/docs/cli/commands/utilities#completion/index.html) | Print a shell completion script (bash, zsh, fish) |
| [`version`](/content/docs/cli/commands/utilities#version/index.html) | Print the CLI version |
| [`auth login`](/content/docs/cli/commands/auth#auth-login/index.html) | Sign in with the browser (or an API key) and save the key to a profile |
| [`auth logout`](/content/docs/cli/commands/auth#auth-logout/index.html) | Remove the stored key from a profile, and optionally revoke it |
| [`auth me`](/content/docs/cli/commands/auth#auth-me/index.html) | The credential as the API reports it (GET /v0/auth/me; whoami says more) |
| [`auth status`](/content/docs/cli/commands/auth#auth-status/index.html) | Show the key, profile and API in use, and check the key |
| [`auth whoami`](/content/docs/cli/commands/auth#auth-whoami/index.html) | Show the key, profile and API in use, and check the key |
| [`config get`](/content/docs/cli/commands/config#config-get/index.html) | Print the value of a config key in effect |
| [`config list`](/content/docs/cli/commands/config#config-list/index.html) | Print the config file, keys masked |
| [`config path`](/content/docs/cli/commands/config#config-path/index.html) | Print the config file path |
| [`config set`](/content/docs/cli/commands/config#config-set/index.html) | Set a config key |
| [`config unset`](/content/docs/cli/commands/config#config-unset/index.html) | Remove a config key (back to its default) |
| [`profiles delete`](/content/docs/cli/commands/profiles#profiles-delete/index.html) | Delete a profile and its stored key |
| [`profiles list`](/content/docs/cli/commands/profiles#profiles-list/index.html) | List profiles (keys masked) |
| [`profiles use`](/content/docs/cli/commands/profiles#profiles-use/index.html) | Make a profile the current one |
