temp-mail-cli
v1.0.0
Published
A CLI and npm module for temp email powered by mail.tm
Readme
temp-mail-cli
A CLI tool and npm module for generating and managing temporary email addresses powered by mail.tm.
Use it in your shell, automation scripts, or integrate as a module with your Node.js projects and AI agents.
Features
- Generate a new temporary email address
- Show the current temporary email address in use
- List inbox messages
- Read message details
- Delete messages
- Usable as both CLI and npm module
Installation
As a CLI
npm install -g .
# Or, if published to npm:
npm install -g temp-mail-cliAs a Module
npm install temp-mail-cliCLI Usage
temp-mail new # Generate a new temp email address
temp-mail show # Show the current email address
temp-mail inbox # List received messages
temp-mail read <id> # Read message details by ID
temp-mail delete <id> # Delete a message by IDExample
temp-mail new
# Output: New temp email: [email protected]
temp-mail inbox
# Output: [message-id] From: [email protected] | Subject: Welcome!
temp-mail read <message-id>
# Output: From: [email protected]
# Subject: Welcome!
# Text: Welcome to the service!
temp-mail delete <message-id>
# Output: Deleted message: <message-id>API Usage (As a Module)
import TempEmail from 'temp-mail-cli';
const tempEmail = new TempEmail();
await tempEmail.register(); // Generates a new temp email
const messages = await tempEmail.getMessages(); // Lists inbox messages
const msg = await tempEmail.getMessage(messages[0].id); // Reads first messageConfiguration
The CLI stores your temp email address and token in .temp-mail.json in the current working directory.
To reset, simply delete this file and run temp-mail new again.
License
MIT © jmswalihu-stack
