@molted/cli
v1.22.0
Published
CLI for the Molted Email platform
Readme
@molted/cli
Command-line interface for the Molted Email platform. Handles auth, headers, and tenant ID injection automatically so agents can interact with the API using simple commands instead of raw HTTP calls.
Install
npm install -g @molted/cliQuick Start
# 1. Create an account (stores credentials automatically)
molted auth signup --name "My Agent" --email [email protected] --password s3cret
# 2. Activate billing (sends are blocked until billing is active)
molted billing setup --plan starter
# → open the returned checkout URL
# 3. Send your first email (interactive mode)
molted send -i
# Or with flags
molted send --to [email protected] --template _default \
--dedupe-key "welcome-alice-1" --payload '{"subject": "Hello", "html": "Hello from my agent!", "text": "Hello from my agent!"}'Commands
molted
├── auth signup|login|logout|login-link
│ └── keys list|create|revoke
├── send [-i] --to --template --dedupe-key --payload
│ ├── batch --template --recipients|--stdin
│ ├── simulate --to --template
│ ├── simulate-batch --template --recipients
│ └── propose --to [--context]
├── mailboxes create|list|get|update
├── templates create|list|get|add-version|publish|approve|reject|render
├── threads list|get|reply|update|archive|unarchive|trash|restore|delete|followup
├── domains add|list|get|verify|dns-check|remove
├── contacts list|get|sync
├── billing status|setup
├── budget
├── analytics fatigue|velocity|deliverability|segment-check
├── journeys create|list|get|update|add-step|runs|trigger
├── segments create|list|get|update|archive|compute|members|contact
├── outcomes ingest|list|get|dashboard|journey-impact
├── suppressions add|list|remove|add-domain|list-domains|remove-domain
├── consent record|check
├── safety get|update
├── humanizer get|update
├── classify --subject --body
│ └── batch --emails|--stdin
├── next-action --contact
│ └── batch --contacts|--stdin
├── record-inbound --from --to
├── trace <requestId>
└── timeline <requestId>Run molted <command> --help for detailed flag info on any command.
Configuration
Credentials are stored in ~/.molted/credentials.json (mode 0600) after signup or login. The CLI resolves settings in this order:
| Setting | Flag | Env var | Credentials file |
|---------|------|---------|-----------------|
| Base URL | --base-url | MOLTED_BASE_URL | base_url |
| API key | — | MOLTED_API_KEY | raw_key |
| Config dir | — | MOLTED_CONFIG_DIR | — |
Default base URL: https://api.molted.email
Output
- Success (exit 0): JSON to stdout
- Error (exit 1): JSON to stderr
A policy-blocked send returns exit 0 with "status": "blocked" — always check the status field.
Agent Reference
For the full CLI skill reference (all flags, common patterns, error handling), see cli-skill.md.
License
MIT
