CLI Quickstart
Get your agent sending email from the terminal in under two minutes.
1. Sign up
npx @molted/cli auth signup \
--name "My Agent" \
--email agent@yourapp.com \
--password your-passwordThis creates your account and saves credentials to ~/.molted/credentials.json. All future commands authenticate automatically.
2. Activate billing
Sends are blocked on trial accounts. Activate billing to unlock sending:
npx @molted/cli billing setup --plan starterOpen the returned checkout URL to complete payment.
You can skip this step during local development by activating billing directly in Postgres. See the billing docs for details.
3. Add a sending domain
npx @molted/cli domains add --domain yourapp.comYou'll get back DNS records (DKIM, SPF, DMARC) to add at your DNS provider. After adding them:
npx @molted/cli domains verify --domain yourapp.comSends from unverified domains will be blocked with no_verified_domain. Complete verification before sending.
4. Send your first email
npx @molted/cli send \
--to recipient@example.com \
--template _default \
--dedupe-key "hello-1" \
--payload '{"subject": "Hello", "body": "First email from the CLI!"}'A successful response:
{
"requestId": "req_abc123",
"status": "queued"
}5. Check delivery
npx @molted/cli trace req_abc123This shows the full request lifecycle: policy checks, provider selection, and delivery status.
Using the CLI without npx
If you prefer, install globally:
npm install -g @molted/cliThen use molted directly instead of npx @molted/cli:
molted send --to recipient@example.com --template _default ...Next steps
- Sending Email — templates, payloads, and deduplication
- Domains — DNS setup and verification
- Policy Simulation — dry-run sends before going live
- Full command reference — all CLI commands and flags