@vanmoose/truncus-cli
v1.2.0
Published
Truncus email API — command-line interface
Maintainers
Readme
@vanmoose/truncus-cli
The command-line interface for Truncus — transactional email infrastructure.
Send emails, manage domains, and check delivery status from your terminal.
Install
npm install -g @vanmoose/truncus-cliOr use with npx:
npx @vanmoose/truncus-cli send --to [email protected] --subject "Hello" --text "Sent from the terminal"Quick Start
# Set up your API key
truncus init
# Send an email
truncus send --to [email protected] --from [email protected] --subject "Hello" --text "Sent from the terminal"
# Check delivery status
truncus status
# View event logs for a message
truncus logs --email-id <message_id>Commands
| Command | Description |
|---------|-------------|
| truncus send | Send an email |
| truncus domains list | List configured sending domains |
| truncus domains add | Add a sending domain (coming soon) |
| truncus domains verify | Verify domain DNS records (coming soon) |
| truncus domains remove | Remove a sending domain (coming soon) |
| truncus status | Account overview and health check |
| truncus status <id> | Check a specific message's delivery status |
| truncus logs | View email event logs |
| truncus init | Interactive project setup |
| truncus whoami | Show current account info |
truncus send
# Basic send
truncus send --to [email protected] --from [email protected] --subject "Hello" --text "Body text"
# HTML email
truncus send --to [email protected] --from [email protected] --subject "Hello" --html "<h1>Hi</h1>"
# From a file
truncus send --to [email protected] --from [email protected] --subject "Newsletter" --html-file ./email.html
# Multiple recipients
truncus send --to [email protected],[email protected] --from [email protected] --subject "Team update" --text "Hi team"
# With reply-to
truncus send --to [email protected] --from [email protected] --reply-to [email protected] --subject "Hello" --text "Body"truncus status
# Account overview
truncus status
# Specific message
truncus status msg_abc123def456
# Change stats window
truncus status --days 7truncus logs
# Events for a specific email
truncus logs --email-id <message_id>
# Filter by event type
truncus logs --email-id <message_id> --type deliveredtruncus domains
# List all domains
truncus domains listAuthentication
API key resolution order:
--api-keyflag on any commandTRUNCUS_API_KEYenvironment variable.truncusrcfile in current directory~/.truncusrcfile in home directory
.truncusrc
Created by truncus init:
{
"apiKey": "tr_live_xxxxxxxxxxxx",
"defaultFrom": "[email protected]",
"region": "eu-west-1"
}Important: Add .truncusrc to your .gitignore to avoid committing your API key.
API Endpoints Used
The CLI calls the following Truncus API endpoints:
| Endpoint | CLI Command | Status |
|----------|-------------|--------|
| POST /api/v1/emails/send | truncus send | Live |
| GET /api/v1/emails/:id | truncus status <id> | Live |
| GET /api/v1/domains | truncus domains list | Live |
| GET /api/v1/events | truncus logs | Live |
| GET /api/v1/stats | truncus status | Live |
| GET /api/health | truncus status | Live |
| POST /api/v1/domains | truncus domains add | Coming soon |
| POST /api/v1/domains/:id/verify | truncus domains verify | Coming soon |
| DELETE /api/v1/domains/:id | truncus domains remove | Coming soon |
Links
- Website: https://truncus.co
- Dashboard: https://truncus.co/dashboard
- npm: https://npmjs.com/package/@vanmoose/truncus-cli
- Node.js SDK: https://npmjs.com/package/@truncus/email
- GitHub: https://github.com/codevanmoose/truncus-cli
Built by Van Moose BV in Amsterdam.
