CLI
camelmailer-cli puts CamelMailer in your terminal for sending and inspecting transactional email, with a compact table by default and --json for piping into jq. Works against the cloud or any self-hosted instance.
Install
terminal
npm install -g camelmailer-cli
Quickstart
terminal
camelmailer login # stores the key in ~/.config/camelmailer/config.json (600) camelmailer ping # validate the key camelmailer emails send \ --from billing@acme.com \ --to ada@example.com \ --subject "Your receipt" \ --html "<p>Thanks for your purchase.</p>"
Credentials resolve flags → environment (CAMELMAILER_API_KEY) → config file.
Send with a template
terminal
camelmailer emails send --from billing@acme.com --to ada@example.com \
--template welcome --model '{"name":"Ada"}'Inspect and query
terminal
camelmailer emails list --scope outgoing --status HardFail --page 2
camelmailer emails get 42
camelmailer templates render welcome --model '{"name":"Ada"}' # preview, no send
camelmailer stats --from 2026-07-01 --to 2026-07-11
camelmailer dmarc summary --domain acme.com
# raw payload for jq
camelmailer --json emails list --status HardFail | jq '.messages[].rcpt_to'Errors & exit codes
Failures print Error [Code]: message to stderr and exit non-zero. Codes are the stable API codes plus CLI-local ones (MissingApiKey, MissingBody, InvalidJson).
terminal
camelmailer emails get 999999 || echo "exit $?" # Error [NotFound]: no such message # exit 1
Self-hosted instances
Set CAMELMAILER_BASE_URL or pass --base-url (defaults to the cloud):
terminal
export CAMELMAILER_API_KEY=cm_xxxx export CAMELMAILER_BASE_URL=https://mail.example.com # or per invocation: camelmailer --api-key cm_xxxx --base-url https://mail.example.com ping
Full field reference: Messages API.
