
com.lockally/email
Stateful email for AI agents: read inboxes, reply in-thread, draft with approval.
Documentation
Lockally CLI
The official command-line interface for Lockally — send mail, manage domains, mailboxes, templates, API keys and webhooks, tail delivery logs, and run a local webhook listener, all from your terminal.
Install
Homebrew / prebuilt binaries — download the archive for your OS/arch from the
latest release and put lockally
on your PATH.
Go:
go install github.com/lockallyinc/lockally-cli@latest # installs `lockally-cli`
Authenticate
lockally login # paste your API key when prompted
lockally login --api-key lk_live_… # or pass it directly
echo $LOCKALLY_API_KEY | lockally login # or pipe it
The key is stored at ~/.config/lockally/config.json (override the location with
LOCKALLY_CONFIG_DIR). You can also skip login entirely and set LOCKALLY_API_KEY
in the environment (great for CI). lockally whoami shows the active credential.
Commands
lockally send Send an email (--from --to --subject --text/--html --attach --template --var)
lockally domains list · add · verify · check (recheck DNS) · rm
lockally mailboxes list · create · rm
lockally templates list · create · update · rm
lockally keys list · create · revoke (create prints the secret once)
lockally logs View the delivery log (--status --since --follow --download)
lockally events Live-tail delivery events
lockally webhook list · create · rm · listen
lockally init Scaffold a lockally.json
lockally deploy Apply lockally.json to your account
Send
lockally send --from alerts@yourdomain.com --to user@example.com \
--subject "Your code" --text "Code: 847291" --attach invoice.pdf
Domains & DNS
lockally domains add yourdomain.com # prints the DNS records to set
lockally domains verify yourdomain.com # checks ownership (TXT)
lockally domains check yourdomain.com # live SPF/DKIM/DMARC/MX recheck (bypasses caches)
Generate an API key
lockally keys create --label ci --scope send:write --scope send:read
Logs
lockally logs --status bounced --since 2026-08-01T00:00:00Z
lockally logs --follow # live tail
lockally logs --download messages.ndjson # export all matching rows
Local webhook listener
Receive and signature-verify webhook deliveries locally (Stripe-style):
lockally webhook listen --port 4747 --secret whsec_… \
--forward http://localhost:3000/webhooks
Point a webhook (or a tunnel like ngrok/cloudflared) at the listener. It verifies the
X-Lockally-Signature header, pretty-prints each event, and optionally relays the raw
body to your app.
Project config (init + deploy)
lockally init # writes lockally.json + templates/welcome.html
lockally deploy # reconciles it into your account (domains+verify, mailboxes, webhooks, templates)
lockally.json:
{
"domains": ["yourdomain.com"],
"mailboxes": [{ "email": "alerts@yourdomain.com", "quota_gb": 5 }],
"webhooks": [{ "url": "https://yourapp.com/webhooks/lockally", "events": ["delivery.delivered", "delivery.bounced"] }],
"templates": [{ "name": "welcome", "subject": "Welcome", "html_file": "templates/welcome.html" }]
}
deploy is additive and idempotent — it never deletes, and re-running is safe.
Notes
- A secret API key authenticates every command; treat it like a password.
- Most commands accept
--jsonfor scripting. - Lockally has no pollable events feed, so
events/logs --followpoll the message log; for true push events usewebhook listen.
License
MIT © Lockally
No installation packages available.