Command-line client
@mailkite/cli is a wrangler-style terminal tool for MailKite —
sign in, add domains, set DNS + webhooks, send mail, and tail inbound
messages. It's a thin layer over the Node SDK,
so it speaks the exact same API as every other client.
Install
# No install needed
npx @mailkite/cli --help
# …or install the `mailkite` binary globally
npm i -g @mailkite/cli Quick start
Create an account, point a domain, set its DNS, register a webhook, and send — each step is one command:
mailkite signup --email you@example.com --password ••••• # or: login
mailkite domains add mail.myapp.ai # prints the DNS records
# …add those records at your DNS provider, then:
mailkite domains verify <domainId> # MX / SPF / DKIM / DMARC
mailkite webhook set <domainId> https://myapp.ai/hooks/mailkite
mailkite send --from hello@mail.myapp.ai --to you@example.com \
--subject "It works" --html "<p>Hi from MailKite</p>"
mailkite messages tail # watch inbound arrive Or run the whole flow at once with the setup wizard:
mailkite init --email you@example.com --password ••••• \
--domain mail.myapp.ai --provider cloudflare \
--webhook https://myapp.ai/hooks/mailkite --to you@example.com --verify Built for scripts and agents
- Fully non-interactive. Every command works from flags + env; prompts only appear as a fallback on an interactive TTY.
--jsoneverywhere for machine-readable output.- Snappy. Commands exit the moment the work is done.
# Every command takes --json and exits immediately — built for scripts & agents
ID=$(mailkite domains add mail.app.com --json | jq -r .domain.id)
mailkite domains verify "$ID" --json | jq -e '.status == "verified"' Commands
| Auth | login · signup · logout · whoami |
| Send | send (--from --to --subject [--html|--text|--file] [--cc --bcc --reply-to --in-reply-to]) |
| Domains | domains list | add | get | verify | rm · dns <id> [--provider] |
| Webhooks | webhook set | rm | test | show · secret get | rotate · verify-webhook |
| Receiving | messages list | get | tail · routes list | create · deliveries retry |
| Workflow | init (setup wizard) · mcp (run the MCP server) |
Run mailkite <command> --help (or just mailkite) for the full reference.
Auth & config
The CLI uses one bearer token for everything — the account
token from login/signup. Resolution order:
--token <t>flagMAILKITE_API_KEY/MAILKITE_TOKENenv~/.mailkite/config.json(written bylogin/signup, mode600)
Override the endpoint with --base-url or
MAILKITE_BASE_URL (default https://api.mailkite.dev).
Receiving without a public URL
messages tail polls the stored-messages API and prints new
arrivals — so you can confirm an inbound round-trip with no tunnel:
# Confirm a send→receive round-trip with no public tunnel:
mailkite messages tail --once --subject "test" --timeout 120 --json
To verify webhook signatures locally (no network), use
mailkite verify-webhook or the SDK's verifyWebhook
helper — see Verifying signatures.
The CLI can also launch the MCP server
(mailkite mcp) and is the backbone of the
agent skill. Next: the full
API reference.