English | 简体中文
The command-line interface for Mailly: two-way inboxes, sending, templates, campaigns, workflows, and agent drafts from your terminal or your AI agent. It wraps the Mailly HTTP API.
Requires Node.js 18+.
npm install -g mailly-cli
mailly --help# Sign in through the browser (device-code flow)
mailly login
# CI or remote machines: paste an API key instead
mailly login <api-key>
mailly whoami
mailly balance
# List your inboxes and read what arrives
mailly inbox addresses list
mailly inbox threads list
# Send an email
mailly send \
--to friend@example.com \
--subject "Hello from Mailly" \
--from-email your-inbox@mailly.site \
--html "<p>It works!</p>" \
--text "It works!"Run mailly <command> --help for every option.
In order of precedence:
--api-key <key>MAILLY_API_KEYenvironment variable~/.mailly/config.json, written bymailly loginwith mode 0600
--base-url / MAILLY_BASE_URL default to https://api.mailly.site.
| Command | What it does |
|---|---|
login, logout, whoami |
Sign in with the browser or an API key, and check the current account |
balance, logs |
Usage balance and consumption logs |
send, status |
Send email; multi-recipient sends and campaigns are queued and return a task ID |
inbox |
Inbox addresses, threads, message content, replies, attachments, and inbox webhooks |
outbox, delivery-events, webhooks |
Per-recipient sent messages, delivery events, and signed delivery webhooks |
drafts, agents |
Drafts for human review, and hosted agent profiles and skills |
templates, workflows, events |
Versioned templates and lifecycle workflows triggered by events |
contacts, audiences, campaigns |
Contacts, CSV import, suppression, audiences, and campaigns |
preferences, marketing-settings |
Recipient subscription state and marketing footer identity |
domains, dns, code |
Custom domains, DNS provider tokens, and verification codes |
The full command reference (Chinese) is in docs/commands.zh-CN.md.
Every command accepts --json. Success exits with 0; failure exits with 1 and prints {"success":false,"error":"..."}.
mailly balance --jsonskills/mailly/SKILL.md teaches Claude Code and other agents when and how to use the mailly CLI, including the checks to run before sending.
mkdir -p ~/.claude/skills/mailly
curl -fsSL https://raw.githubusercontent.com/superagents-lab/mailly-cli/main/skills/mailly/SKILL.md \
-o ~/.claude/skills/mailly/SKILL.mdMailly also provides a remote MCP server at https://api.mailly.site/mcp with OAuth sign-in. See the integration docs.
npm install
npm test
node bin/mailly.mjs --helpReport CLI issues on GitHub. For account or billing questions, email sys@mailly.site.
MIT