Migma
Verified@AdamSEY
npx machina-cli add skill @AdamSEY/migma --openclawMigma
Create and send professional, on-brand emails with AI. Your agent can design emails from a prompt, send them instantly through a managed domain, and manage an entire audience — all from the terminal.
Always pass --json for structured output.
First-time setup
If the user hasn't set up yet, run these steps once:
# 1. Create an instant sending domain (no DNS needed)
migma domains managed create <companyname> --json
# → Sends from: hello@<companyname>.migma.email
# 2. Set a default project (brand)
migma projects list --json
migma projects use <projectId>
Create an email
When the user asks to create, design, or generate an email:
migma generate "Welcome email for new subscribers" --wait --json
The --wait flag blocks until the AI finishes. The JSON response includes conversationId, subject, and html.
To save the HTML locally, add --save ./email.html. To include a reference image (screenshot, design mockup), add --image <url>.
Send an email
When the user asks to send an email to someone:
# Send a generated email directly
migma send --to sarah@example.com --subject "Welcome!" \
--from-conversation <conversationId> \
--from hello@company.migma.email --from-name "Company" --json
# Or send from a local HTML file
migma send --to sarah@example.com --subject "Hello" \
--html ./email.html \
--from hello@company.migma.email --from-name "Company" --json
# Send to an entire segment or tag
migma send --segment <id> --subject "Big News" --html ./email.html \
--from hello@company.migma.email --from-name "Company" --json
# Personalize with template variables
migma send --to user@example.com --subject "Hi {{name}}" --html ./email.html \
--from hello@company.migma.email --from-name "Company" \
--var name=Sarah --var discount=20 --json
--from-conversation auto-exports the HTML from a generated email — no separate export step.
Validate an email
When the user wants to check an email before sending:
migma validate all --html ./email.html --json
migma validate all --conversation <conversationId> --json
Returns an overall score plus individual checks: compatibility (30+ email clients), broken links, spelling/grammar, and deliverability/spam score. Individual checks: migma validate compatibility, links, spelling, deliverability.
Export to platforms
When the user wants to export to an ESP or download a file:
migma export html <conversationId> --output ./email.html
migma export klaviyo <conversationId> --json
migma export mailchimp <conversationId> --json
migma export hubspot <conversationId> --json
migma export pdf <conversationId> --json
migma export mjml <conversationId> --json
Manage contacts
migma contacts add --email user@example.com --firstName John --json
migma contacts list --json
migma contacts import ./contacts.csv --json
migma contacts remove <id> --json
Manage tags and segments
migma tags create --name "VIP" --json
migma tags list --json
migma segments create --name "Active Users" --description "..." --json
migma segments list --json
Import a brand
When the user wants to set up a new brand from their website:
migma projects import https://yourbrand.com --wait --json
migma projects use <projectId>
This fetches logos, colors, fonts, and brand voice automatically.
Error handling
On error, --json returns:
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}
Overview
Migma is a CLI tool that lets you generate AI-powered emails from prompts, send them through a managed domain, and manage audiences entirely from the terminal. It handles creating emails, validating content, exporting to ESPs, and administering contacts, tags, segments, domains, and webhooks via the migma CLI.
How This Skill Works
Install the @migma/cli and set MIGMA_API_KEY to authorize the CLI. Use commands like migma generate, migma send, migma validate, and migma export to create, deliver, verify, and export emails; you can save HTML locally or export directly to ESPs. First-time setup creates a sending domain and a default project, with structured JSON output enabled by --json.
When to Use It
- You want to design an AI-generated email from a prompt and send it immediately from the terminal.
- You need to send a generated email to a specific contact, a segment, or a tag.
- You want to validate an HTML email before sending and review an overall score and checks.
- You need to export the composed email to ESPs like Klaviyo or Mailchimp, or download HTML/PDF/MJML.
- You manage contacts, tags, and segments from the CLI and orchestrate campaigns from your shell.
Quick Start
- Step 1: Install the CLI and set MIGMA_API_KEY in your environment.
- Step 2: Run first-time setup: create a sending domain and select a default project.
- Step 3: Generate an email, optionally wait and export, then send it or export to ESPs.
Best Practices
- Always run with --json to get structured output for automation.
- Do the first-time setup (managed domain and default project) before sending.
- Use --wait when generating to block until the AI finishes and capture conversationId, subject, and html.
- Personalize with --var variables and, when possible, include images with --image.
- Use --from-conversation to auto-export the generated HTML, reducing manual steps.
Example Use Cases
- Generate a Welcome email for new subscribers with migma generate and send it to a subscriber list or segment.
- Send a personalized promo to a segment using --segment and --var to tailor content.
- Validate an email HTML before sending and review compatibility, links, spelling, and deliverability.
- Export a generated email to Mailchimp or Klaviyo and download the HTML or JSON payload.
- Manage contacts, tags, and segments from the CLI to assemble campaigns without leaving the terminal.