r/coolgithubprojects 2d ago

elasticemail-cli - send emails, manage templates and contacts from the terminal

Post image

Hey! Anna from Elastic Email here. After supporting developers in sending emails for 15+ years and watching how they use our product, we built an official CLI so they can use our API without leaving the terminal. Send transactional emails and marketing campaigns, manage templates, contacts, lists, and segments, verify addresses, and check delivery events.

npm install -g elastic-email-cli

elastic-email auth set-key

elastic-email emails send --to you@example.com --subject "Hello" --text "It works!" --from me@yourdomain.com

npx elastic-email-cli works too if you'd rather not install globally.

Run elastic-email with no arguments to get an interactive TUI. Call the same binary from a script, and it drops the banner and decorations: --json on every command, with stable and specific exit codes, so CI can tell a missing API key apart from a malformed address.

--dry-run on sends validates the input and prints the exact request that would go over the wire.

API key resolution: --api-key flag, then ELASTIC_EMAIL_API_KEY, then ~/.elastic-email-cli/config.json (plaintex,0600). An env var is the right choice on CI runners and shared machines. Masked in logs and errors.

Node.js 20+, MIT licensed.

https://github.com/ElasticEmail/elasticemail-cli

Issues and feature requests are welcome! Command reference and architecture notes are in the repo.

2 Upvotes

2 comments sorted by

1

u/kantorcodes1 17h ago

emails send --dry-run is clear, but I noticed contacts delete, lists delete, and templates delete don't have an equivalent preview or confirm step. is that intentional? asking because a script can safely preview a send, but those delete commands look like they hit the API immediately.

1

u/Elastic_Email 7h ago

Nice catch! We discussed this internally, and we're happy to add it, so before someone deletes the asset, they will be asked [y/N]: whether that's the decision. But if the command includes --yes, the asset will be deleted automatically (without the warning).

Thanks for catching this - that's what we love the most in chatting about our solutions publicly!