Mailinator CLI
The Mailinator CLI lets developers, testers, CI jobs, and AI-agent workflows interact with Mailinator from the command line.
Use the CLI when you want to:
- Check inboxes from a terminal.
- Retrieve messages during local development.
- Inspect email or SMS workflow output without opening the Mailinator UI.
- Script Mailinator checks in CI/CD.
- Provide a command-line bridge for agent workflows.
Common workflows
Use the CLI for workflows such as:
- Listing messages in an inbox.
- Reading the latest message.
- Retrieving a message as text, HTML, JSON, or full message data.
- Extracting links from an email.
- Debugging email workflows from a shell or automation script.
- Working with Public Mailinator inboxes for non-sensitive checks.
- Working with Private Domains for automated and sensitive workflows.
Install the CLI
Install the CLI globally with npm:
npm install -g mailinator-cli
Public inboxes
Public Mailinator inboxes do not require authentication. List emails in any public inbox by passing the inbox name and public domain mode:
mailinator-cli inbox testuser public
Private domains
Use a Mailinator Private Domain for workflows that involve OTP codes, password reset links, magic links, private test users, or other sensitive data.
Set your API token before accessing private email:
export MAILINATOR_API_KEY=your_token_here
Then list messages in a private inbox:
mailinator-cli inbox myinbox private
Retrieve email content
After listing an inbox, retrieve a specific email by message number and output format.
Get a specific email as plain text:
mailinator-cli email 1 text
Extract links from an email:
mailinator-cli email 1 links
Get full email data:
mailinator-cli email 1 full
Output formats
The CLI supports multiple output formats for AI, scripts, and manual debugging:
- Plain text.
- HTML.
- JSON.
- Headers.
- Links.
- Full message data.
Debugging
Use verbose mode when you need more detail about CLI behavior or API requests.
Public inboxes are public and should only be used for quick, non-sensitive experiments. For private automation, CI/CD, OTP, magic-link, or agent workflows, use a Private Domain with MAILINATOR_API_KEY.
Related resources
Learn more about Mailinator MCP, Agent Safety and Privacy, Agent Recipes, and the Mailinator + AI page.
If you need help getting started, contact support@manybrain.com.