# The CLI

> Every mail command.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://mail.docs.sypnia.com/tools/cli/

For agents: Mail CLI: login/logout/whoami/use; domains add|ls|records|check|rm; send; templates create|ls|preview|publish|rollback|pull|push; events filters; webhooks create|ls|rm|replay; suppressions ls|add|rm; inbound add|ls|rm; keys create|ls|revoke (scopes send, smtp, read, admin); transport connect-ses|template|status; --json; SYPNIA_MAIL_KEY.

| Command                                                        | What it does                                     |
| -------------------------------------------------------------- | ------------------------------------------------ |
| `login` · `logout` · `whoami` · `use <url>`                    | Sign in (device flow) or point at an engine      |
| `domains add\|ls\|records\|check\|rm`                          | Sending domains                                  |
| `send --to --from --template --data`                           | Send one e-mail                                  |
| `templates create\|ls\|preview\|publish\|rollback\|pull\|push` | Templates                                        |
| `events [--to] [--tag] [--case] [--type] [--since]`            | Search the event log                             |
| `webhooks create\|ls\|rm\|replay`                              | Webhooks                                         |
| `suppressions ls\|add\|rm`                                     | The suppression list                             |
| `inbound add\|ls\|rm`                                          | Inbound rules                                    |
| `keys create\|ls\|revoke`                                      | Keys with scopes `send`, `smtp`, `read`, `admin` |
| `transport connect-ses\|template\|status`                      | Your own SES                                     |

`--json` on every command; `SYPNIA_MAIL_KEY` or `--key` for a key instead of the session.
