Skip to content
machinemail

Command reference

Every machinemail command, generated from the CLI's own command tree: usage, arguments, flags with their types and defaults, examples, and the API routes each command calls.

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: 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 for output formats and exit codes.

Global flags

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

--jsonboolean
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, --verboseboolean
Log requests and responses to stderr (keys redacted).
-q, --quietboolean
No spinners or success lines; errors still print.
-y, --yesboolean
Confirm deletes without asking (needed when there is no terminal to ask on).
--colorboolean
Color on or off (default: on for a terminal; NO_COLOR also turns it off).

Defaulton for a terminal

-h, --helpboolean
Show help.

Getting started

CommandSummary
loginSign in with the browser (or an API key) and save the key to a profile
whoamiShow the key, profile and API in use, and check the key
doctorCheck the config, connectivity, key, clock and CLI version
registerRegister this agent (auth.md): a sandbox inbox and credentials, no human needed
claimGet a new claim code for a registered agent, and wait for a human to claim it
logoutRemove the stored key from a profile, and optionally revoke it

Mail

CommandSummary
sendSend an email from an inbox
readShow a message: headers, trust verdict and agent-safe text
waitWait for a message to arrive (and extract a code or magic link with —otp)
tailFollow live events (messages, deliveries, inboxes) as they happen
messages attachmentGet attachment
messages batch-getBatch get messages
messages batch-updateBatch update messages
messages deleteDelete message
messages downloadDownload attachment
messages forwardForward message
messages getGet message
messages listList messages
messages rawGet raw message
messages replyReply to a message
messages reply-allReply to all recipients of a message
messages searchSearch messages
messages sendSend message
messages trustGet message trust report
messages updateUpdate message
threads deleteDelete thread
threads getGet thread
threads listList threads
threads searchSearch threads
threads updateUpdate thread
drafts createCreate draft
drafts deleteDelete draft
drafts getGet draft
drafts listList drafts
drafts sendSend draft
drafts updateUpdate draft
inbound rawInject raw message

Inboxes

CommandSummary
inboxes availabilityCheck inbox availability
inboxes createCreate inbox
inboxes deleteDelete inbox
inboxes exportExport inbox
inboxes getGet inbox
inboxes listList inboxes
inboxes newCreate an inbox and print its address (pipe-friendly)
inboxes searchSearch inboxes
inboxes updateUpdate inbox
pods createCreate pod
pods deleteDelete pod
pods getGet pod
pods listList pods
pods updateUpdate pod
lists createCreate list entry
lists deleteDelete list entry
lists getGet list entry
lists listList the entries of an allow or block list
suppressions createAdd suppression
suppressions deleteRemove suppression
suppressions getGet suppression
suppressions listList suppressions

Domains

CommandSummary
domains connectGet Domain Connect setup
domains createCreate domain
domains deleteDelete domain
domains getGet domain
domains listList domains
domains updateUpdate domain
domains verifyVerify domain
domains zone-fileGet zone file

Webhooks

CommandSummary
webhooks createCreate webhook
webhooks deleteDelete webhook
webhooks deliveriesList deliveries
webhooks getGet webhook
webhooks listList webhooks
webhooks replayReplay delivery
webhooks testSend test event
webhooks updateUpdate webhook
events getGet event
events listList events
events streamStream events as they happen (server-sent events)

Admin

CommandSummary
org getGet organization
org membersList members
org updateUpdate organization
api-keys createCreate API key
api-keys deleteDelete API key
api-keys getGet API key
api-keys listList API keys
api-keys updateUpdate API key
agent-registrations deleteRevoke agent registration
agent-registrations getGet agent registration
agent-registrations listList agent registrations
metrics eventsQuery events
metrics ratesQuery rates
metrics usageQuery usage
health checkCheck that the API is up (liveness)
health readyCheck that the API can serve requests (readiness)

CLI

CommandSummary
openOpen the dashboard in a browser
completionPrint a shell completion script (bash, zsh, fish)
versionPrint the CLI version
auth loginSign in with the browser (or an API key) and save the key to a profile
auth logoutRemove the stored key from a profile, and optionally revoke it
auth meThe credential as the API reports it (GET /v0/auth/me; whoami says more)
auth statusShow the key, profile and API in use, and check the key
auth whoamiShow the key, profile and API in use, and check the key
config getPrint the value of a config key in effect
config listPrint the config file, keys masked
config pathPrint the config file path
config setSet a config key
config unsetRemove a config key (back to its default)
profiles deleteDelete a profile and its stored key
profiles listList profiles (keys masked)
profiles useMake a profile the current one

More

CommandSummary
connected-apps deleteDisconnect app
connected-apps listList connected apps