CLI
The machinemail command line tool - what it covers, how to install it and sign in, and the first commands to run, from a terminal or a script.
machinemail (also installed as mm) is the MachineMail API from the terminal. It has a command for every /v0 endpoint, plus a few built for agents and shell scripts: create an inbox and print its address, send in one line, wait for a verification code, read a message with its trust verdict, and follow new mail as it arrives. It is a single binary with no runtime to install.
On a terminal it prints tables and detail panes. When its output is piped, or with --json, it prints JSON instead, so agents and scripts use the same commands people do.
Warning
The CLI is in early access. Download links are not public yet, so the install script below does not work until the first public release. You can build it from source today.
Install
The script installs machinemail and mm into ~/.local/bin for macOS or Linux on x64 or arm64. Windows, pinned versions and completions are on Installation.
Sign in
The CLI prints an 8-letter code and a link to machinemail.dev/cli. Approve the code in the dashboard and the CLI receives an API key named CLI on <your hostname>, saved in ~/.config/machinemail/config.json. In CI, set MACHINEMAIL_API_KEY instead. Both are covered in Authentication.
Check what you are signed in as:
First commands
Create an inbox. Piped, inbox new prints only the address:
Send an email from it:
Use the inbox to sign up for a service, then wait for the verification code and keep it:
List and read messages:
Follow new mail as it arrives (Ctrl-C to stop):
Every other endpoint is a machinemail <resource> <action> command, generated from the API reference. --help works at every level:
Next
Binaries per platform, building from source, and shell completions.
AuthenticationBrowser sign-in, API keys for CI, profiles, logout and where the key is stored.
Output and scriptingJSON and NDJSON output, --fields, exit codes, and using the CLI from scripts and agents.
Sign-ups with wait --otp, reading mail safely, and anonymous registration for agents.
The config file, profiles, environment variables and the API base URL.
Command referenceEvery command with its arguments, flags, examples and API route.