MOLTED EMAIL
CLI Reference

CLI Reference

Every molted command, generated from the CLI itself: arguments, options and the agent context each command prints with --help.

@molted/cli is the agent-facing command line for Molted. It wraps the API: it stores credentials, adds the Authorization header and your tenant ID to every request, and prints JSON.

npm install -g @molted/cli
molted --version

Every page in this section is generated from the CLI's own help text (molted <command> --help), so it matches the published package built from the same source. For a guided first run, see CLI Quickstart.

Global options

Global options go before the command (molted --profile work send ...).

OptionDescriptionDefault
-V, --versionoutput the version number
--base-url <url>Override API base URL
--mailbox-url <url>Override mailbox gateway URL (for agent endpoints)
--profile <name>Use a named profile for credentials
--skillPrint the full agent skill reference (skill.md) and exit

Agent context

Molted Email is an agent-native email control plane. The molted CLI handles authentication, headers, and tenant ID injection automatically so you can interact with the API using simple commands instead of raw HTTP calls.

After install (npm install -g @molted/cli), the molted binary is available in your PATH. Verify with: molted --version

Quick start (3 steps)

molted auth signup --name "My Agent" --email agent@example.com --password <password>
# → credentials stored in ~/.molted/profiles/default.json automatically

molted billing setup --plan solo
# → returns { "url": "https://checkout.stripe.com/...", "plan": "solo" }
# → sends are blocked until billing is active (trial_not_activated)

molted send --to alice@example.com --template _default \
  --dedupe-key "hello-alice-1" --payload '{"subject":"Hello","html":"Hi!","text":"Hi!"}'
# → { "status": "queued", "requestId": "..." }

If you already have an API key (mm_live_...), skip signup

molted auth init --key mm_live_xxx

To join an existing tenant as a new agent

molted adopt claim <token>       # if you have an invite token (ma_inv_...)
molted adopt request             # device flow (owner approves in the portal)

Output format

  • Success (exit 0): JSON to stdout
  • Error (exit 1): JSON to stderr, { "error": "message", "detail"?: ... }
  • Policy-blocked sends return exit 0 with "status": "blocked", so always check status
  • molted doctor has its own exit codes (0 ready, 1 blocker found, 2 not fully verified)
  • Credentials: ~/.molted/profiles/<profile>.json (auto-created, mode 0600)
  • Config dir override: MOLTED_CONFIG_DIR env var
  • API key override: MOLTED_API_KEY env var (with MOLTED_TENANT_ID also set, the credentials file is not read at all)
  • Tenant override: MOLTED_TENANT_ID env var
  • Profile override: --profile flag > MOLTED_PROFILE env var > active_profile file > "default"
  • Base URL override: --base-url flag > MOLTED_BASE_URL env var > credentials file > https://api.molted.email
  • Mailbox URL override: --mailbox-url flag > MOLTED_MAILBOX_URL env var > credentials file > base URL

Requests go to the mailbox URL, except auth signup, auth login, auth init, adopt claim and adopt request, which call the base URL.

Run molted <command> --help for detailed context on any command. Run molted --skill to print the full agent skill reference.
Full reference: https://molted.email/cli-skill.md

Commands

CommandDescription
molted adoptAgent adoption flows (invite & device)
molted agentsMulti-agent coordination
molted alertsManage alert destinations
molted analyticsSending analytics and contact insights
molted approvalsRead-only view of pending and decided send approvals
molted attachmentsManage email attachments
molted authAuthentication commands
molted billingBilling and plan management
molted budgetCheck remaining send quota across monthly, daily and hourly windows
molted captureCapture an email address - upsert contact, subscribe to list, and optionally send confirmation
molted classifyClassify an inbound email the way the inbound pipeline would (platform label, safety verdict, route)
molted consentManage recipient consent records
molted contactsManage contacts
molted doctorCan this key send yet, and why isn't mail flowing? Renders GET /v1/agent/setup plus the after-send checks. Exit code: 1 if any blocker is found (not ready to send); otherwise 2 if any check could not be fully verified; otherwise 0 -- 0 means ready to send and every check fully verified, safe to gate a script on.
molted domainsManage sending domains
molted eventsView message event timelines
molted experimentsRun A/B or holdout experiments on journey steps
molted humanizerManage email humanizer configuration
molted inbound-hooksManage inbound webhook mappings for zero-code integrations
molted incidentsList and acknowledge/resolve ops incidents
molted journeysManage journey orchestration
molted labelsDefine labels and apply them to threads (your own business categories, per mailbox)
molted listenConnect to the SSE event stream — persistent event loop for agents
molted listsManage email lists and send broadcasts
molted mailboxesManage mailboxes
molted messagesRetrieve message data
molted next-actionGet the next best action for a contact
molted outcomesTrack and query outcomes
molted overridesHuman-in-the-loop overrides
molted pausePause your entire account (blocks all sends across every mailbox)
molted record-inboundRecord an inbound email
molted resumeResume a paused account (usually a human decision)
molted rulesManage mailbox rules for automated thread routing
molted safetyManage tenant safety settings
molted searchSearch your threads by subject, the other party's address or name, an attachment filename (fuzzy, typo tolerant), or whole words in the messages
molted segmentsManage audience segments
molted sendSend an email via the agent API
molted settingsManage tenant settings (cooldown, consent enforcement, etc.)
molted suppressionsManage email suppressions and suppressed domains
molted team-addressesList, add and remove verified team addresses (sends to them are free)
molted templatesManage email templates
molted threadsManage email threads
molted timelineGet the delivery event timeline for a send request
molted traceGet the full decision trace for a send request
molted updateUpdate the Molted CLI to the latest version
molted webhooksManage webhook endpoints for real-time event notifications