home / skills / openclaw / skills / migma

migma skill

/skills/adamsey/migma

This skill helps you craft, validate, and send AI-generated emails from the terminal, manage audiences, and export to platforms with structured output.

npx playbooks add skill openclaw/skills --skill migma

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
3.9 KB
---
name: migma
description: Generate, send, validate, and export AI-powered emails from the terminal; manage contacts, segments, tags, domains, and webhooks with Migma CLI.
metadata:
  openclaw:
    requires:
      env:
        - MIGMA_API_KEY
      bins:
        - migma
    primaryEnv: MIGMA_API_KEY
    emoji: "\u2709"
    homepage: https://migma.ai
    install:
      - kind: node
        package: "@migma/cli"
        bins: [migma]
---

# Migma

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:

```bash
# 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:

```bash
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:

```bash
# Send a generated email directly
migma send --to [email protected] --subject "Welcome!" \
  --from-conversation <conversationId> \
  --from [email protected] --from-name "Company" --json

# Or send from a local HTML file
migma send --to [email protected] --subject "Hello" \
  --html ./email.html \
  --from [email protected] --from-name "Company" --json

# Send to an entire segment or tag
migma send --segment <id> --subject "Big News" --html ./email.html \
  --from [email protected] --from-name "Company" --json

# Personalize with template variables
migma send --to [email protected] --subject "Hi {{name}}" --html ./email.html \
  --from [email protected] --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:

```bash
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:

```bash
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

```bash
migma contacts add --email [email protected] --firstName John --json
migma contacts list --json
migma contacts import ./contacts.csv --json
migma contacts remove <id> --json
```

## Manage tags and segments

```bash
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:

```bash
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:

```json
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}
```

Overview

This skill provides a terminal-first CLI for generating, sending, validating, and exporting AI-crafted emails. It combines AI-powered email design with audience management (contacts, tags, segments), domain handling, and platform exports — all operable from the command line with structured JSON output.

How this skill works

Use the migma CLI to generate emails from natural-language prompts or local HTML, then send directly via managed domains or export to ESPs. The tool returns structured JSON for automation, supports saving generated HTML, validates emails across clients and deliverability checks, and manages audience data and webhook integrations from the terminal.

When to use it

  • Create on-brand marketing or transactional emails quickly from a prompt or reference image.
  • Send personalized campaigns or one-off messages directly from scripts or CI with JSON output.
  • Validate email compatibility, links, spelling, and deliverability before sending.
  • Export generated emails to Mailchimp, Klaviyo, HubSpot, MJML, or PDF for downstream workflows.
  • Manage contacts, tags, segments, domains, and webhooks in a single CLI for automation and backups.

Best practices

  • Always pass --json for predictable, machine-readable output when integrating with scripts.
  • Use managed domains for instant sending in tests; configure custom DNS for production deliverability.
  • Run migma validate all before large sends to catch rendering, link, and spam issues.
  • Save generated HTML (--save) for versioning or to reuse in exports and A/B tests.
  • Personalize with --var variables or segments to boost engagement while keeping templates reusable.

Example use cases

  • Automate welcome sequences: generate emails with migma generate and send via a scheduled job.
  • CI pipelines: validate new email templates programmatically and block deployment on low scores.
  • Marketing exports: design in CLI then export to Mailchimp or Klaviyo for campaign management.
  • Small teams: use managed instant domains to send branded emails without DNS setup during onboarding.
  • Contact imports and segmentation: bulk import CSVs, tag VIPs, and target segments in automated sends.

FAQ

Do I need DNS to start sending?

No — you can create an instant managed domain that sends immediately; add custom DNS later for higher deliverability.

How do I get HTML from a generated email?

Use --wait with migma generate to receive HTML in the JSON response or use --save ./email.html to store it locally.