migma

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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.
借助AI创建并发送专业、符合品牌风格的电子邮件。你的Agent可以根据提示设计邮件,通过托管域名即时发送,并管理全部受众——所有操作都在终端完成。
始终添加
--json
参数以获取结构化输出。

Authentication

身份验证

bash
migma login                          # Authenticate with your API key
migma whoami --json                  # Show current user info
migma logout                         # Remove stored credentials
bash
migma login                          # 使用你的API密钥进行身份验证
migma whoami --json                  # 显示当前用户信息
migma logout                         # 删除存储的凭据

First-time setup

首次设置

If the user hasn't set up yet, run these steps once:
bash
undefined
如果用户尚未完成设置,请运行以下步骤一次:
bash
undefined

1. Create an instant sending domain (no DNS needed)

1. 创建即时发送域名(无需配置DNS)

migma domains managed create <companyname> --json
migma domains managed create <companyname> --json

→ Sends from: hello@<companyname>.migma.email

→ 发件地址:hello@<companyname>.migma.email

2. Set a default project (brand)

2. 设置默认项目(品牌)

migma projects list --json migma projects use <projectId>
undefined
migma projects list --json migma projects use <projectId>
undefined

Before creating an email

创建邮件前的准备

Before generating a new email, check if the user wants to build on existing work (series, follow-up, remix, or similar email). List recent emails to find relevant references:
bash
migma emails list --project <projectId> --limit 5 --json
If the user mentions a series, follow-up, remix, or "something similar to…", show the recent emails and ask which to use as a reference. Then pass the conversation ID with
--reference
:
bash
migma generate "Follow-up to the welcome email" --reference <conversationId> --wait --json
If the user is creating something entirely new, skip this step.
在生成新邮件之前,查看用户是否想要基于现有成果(系列邮件、跟进邮件、改版邮件或类似邮件)进行创建。列出近期邮件以找到相关参考:
bash
migma emails list --project <projectId> --limit 5 --json
如果用户提到系列邮件、跟进邮件、改版或“类似……的内容”,请展示近期邮件并询问要使用哪一个作为参考。然后通过
--reference
参数传入对话ID:
bash
migma generate "Follow-up to the welcome email" --reference <conversationId> --wait --json
如果用户要创建全新内容,请跳过此步骤。

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>
. To open the result in the browser, add
--open
.
当用户要求创建、设计或生成邮件时:
bash
migma generate "Welcome email for new subscribers" --wait --json
--wait
参数会阻塞进程直到AI完成生成。JSON响应包含
conversationId
subject
html
要将HTML保存到本地,请添加
--save ./email.html
。要包含参考图片(截图、设计原型),请添加
--image <url>
。要在浏览器中打开结果,请添加
--open

Check generation status

检查生成状态

bash
migma generate-status <conversationId> --json
bash
migma generate-status <conversationId> --json

Create an email series or remix

创建邮件系列或改版邮件

When the user wants to create a series of emails or remix an existing email:
  1. List existing emails to find the reference:
    bash
    migma emails list --project <projectId> --json
  2. Generate each email in the series using
    --reference
    to maintain consistency:
    bash
    migma generate "Email 1: Welcome to the course" --wait --json
    migma generate "Email 2: Your first lesson" --reference <email1ConversationId> --wait --json
    migma generate "Email 3: Advanced tips" --reference <email2ConversationId> --wait --json
The
--reference
flag tells MigmaAI to use the referenced email as context — matching its style, tone, and layout while generating new content.
当用户想要创建系列邮件或改版现有邮件时:
  1. 列出现有邮件以找到参考:
    bash
    migma emails list --project <projectId> --json
  2. 使用
    --reference
    参数生成系列中的每一封邮件,以保持一致性:
    bash
    migma generate "Email 1: Welcome to the course" --wait --json
    migma generate "Email 2: Your first lesson" --reference <email1ConversationId> --wait --json
    migma generate "Email 3: Advanced tips" --reference <email2ConversationId> --wait --json
--reference
参数会告知MigmaAI使用参考邮件作为上下文——在生成新内容时匹配其风格、语气和布局。

List and search emails

列出和搜索邮件

bash
migma emails list --project <projectId> --json
migma emails list --project <projectId> --limit 10 --status completed --json
migma emails list --project <projectId> --search "welcome" --json
Filters:
--limit <n>
(1-100, default 20),
--status <pending|processing|completed|failed>
,
--search <query>
.
bash
migma emails list --project <projectId> --json
migma emails list --project <projectId> --limit 10 --status completed --json
migma emails list --project <projectId> --search "welcome" --json
筛选条件:
--limit <n>
(1-100,默认20)、
--status <pending|processing|completed|failed>
--search <query>

Send an email

发送邮件

When the user asks to send an email to someone:
bash
undefined
当用户要求给某人发送邮件时:
bash
undefined

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

或从本地HTML文件发送

migma send --to sarah@example.com --subject "Hello"
--html ./email.html
--from hello@company.migma.email --from-name "Company" --json
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
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
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

Transactional email (bypasses subscription status and topic filters)

事务性邮件(绕过订阅状态和主题筛选)

migma send --to user@example.com --subject "Your receipt"
--html ./receipt.html --transactional
--from hello@company.migma.email --from-name "Company" --json
migma send --to user@example.com --subject "Your receipt"
--html ./receipt.html --transactional
--from hello@company.migma.email --from-name "Company" --json

Custom reply-to address

自定义回复地址

migma send --to user@example.com --subject "Hello"
--html ./email.html --reply-to support@company.com
--from hello@company.migma.email --from-name "Company" --json

`--from-conversation` auto-exports the HTML from a generated email — no separate export step.
migma send --to user@example.com --subject "Hello"
--html ./email.html --reply-to support@company.com
--from hello@company.migma.email --from-name "Company" --json

`--from-conversation`参数会自动从生成的邮件中导出HTML——无需单独的导出步骤。

Send a test email

发送测试邮件

bash
migma send-test <conversationId> --to test@company.com --json
bash
migma send-test <conversationId> --to test@company.com --json

Check batch send status

检查批量发送状态

bash
migma batch-status <batchId> --json
bash
migma batch-status <batchId> --json

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
migma validate all --html ./email.html --subject "Sale today!" --json
Returns an overall score plus individual checks: compatibility (30+ email clients), broken links, spelling/grammar, and deliverability/spam score.
Individual checks:
bash
migma validate compatibility --html ./email.html --json
migma validate links --html ./email.html --json
migma validate spelling --html ./email.html --json
migma validate deliverability --html ./email.html --subject "Sale today!" --json
migma validate deliverability --conversation <conversationId> --subject "Sale today!" --json
The
--subject
flag provides the email subject for deliverability/spam analysis.
当用户想要在发送前检查邮件时:
bash
migma validate all --html ./email.html --json
migma validate all --conversation <conversationId> --json
migma validate all --html ./email.html --subject "Sale today!" --json
返回整体评分以及各项检查结果:兼容性(支持30+邮件客户端)、失效链接、拼写/语法、可送达性/垃圾邮件评分。
单独检查项:
bash
migma validate compatibility --html ./email.html --json
migma validate links --html ./email.html --json
migma validate spelling --html ./email.html --json
migma validate deliverability --html ./email.html --subject "Sale today!" --json
migma validate deliverability --conversation <conversationId> --subject "Sale today!" --json
--subject
参数为可送达性/垃圾邮件分析提供邮件主题。

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 mjml <conversationId> --output ./email.mjml
migma export pdf <conversationId> --output ./email.pdf --json
migma export klaviyo <conversationId> --type html --json
migma export mailchimp <conversationId> --json
migma export hubspot <conversationId> --json
Klaviyo export supports
--type <html|hybrid|code>
(default: html). All export commands support
--output <file>
to save locally.
当用户想要导出到ESP(邮件服务提供商)或下载文件时:
bash
migma export html <conversationId> --output ./email.html
migma export mjml <conversationId> --output ./email.mjml
migma export pdf <conversationId> --output ./email.pdf --json
migma export klaviyo <conversationId> --type html --json
migma export mailchimp <conversationId> --json
migma export hubspot <conversationId> --json
Klaviyo导出支持
--type <html|hybrid|code>
(默认:html)。所有导出命令均支持
--output <file>
参数以保存到本地。

Manage contacts

管理联系人

bash
undefined
bash
undefined

Add a contact (full options)

添加联系人(完整选项)

migma contacts add --email user@example.com --first-name John --last-name Doe
--country US --language en --tags tag1,tag2 --json
migma contacts add --email user@example.com --first-name John --last-name Doe
--country US --language en --tags tag1,tag2 --json

List contacts with filters

带筛选条件列出联系人

migma contacts list --json migma contacts list --status subscribed --tags tagId1,tagId2 --search "john" --json migma contacts list --limit 50 --page 2 --json
migma contacts list --json migma contacts list --status subscribed --tags tagId1,tagId2 --search "john" --json migma contacts list --limit 50 --page 2 --json

Get, update, remove

获取、更新、删除联系人

migma contacts get <id> --json migma contacts update <id> --first-name Jane --status subscribed --json migma contacts remove <id> --json
migma contacts get <id> --json migma contacts update <id> --first-name Jane --status subscribed --json migma contacts remove <id> --json

Bulk import from CSV

从CSV批量导入

migma contacts import ./contacts.csv --json

Contact list filters: `--limit <n>` (default 20), `--page <n>`, `--status <status>`, `--tags <comma-separated>`, `--search <query>`.
migma contacts import ./contacts.csv --json

联系人列表筛选条件:`--limit <n>`(默认20)、`--page <n>`、`--status <status>`、`--tags <逗号分隔>`、`--search <query>`。

Manage tags

管理标签

bash
migma tags create --name "VIP" --color "#FF5733" --description "High-value customers" --json
migma tags list --json
migma tags list --search "vip" --sort-by name --json
migma tags delete <id> --json
Tag list options:
--limit <n>
(default 50),
--search <query>
,
--sort-by <createdAt|name>
.
bash
migma tags create --name "VIP" --color "#FF5733" --description "High-value customers" --json
migma tags list --json
migma tags list --search "vip" --sort-by name --json
migma tags delete <id> --json
标签列表选项:
--limit <n>
(默认50)、
--search <query>
--sort-by <createdAt|name>

Manage segments

管理细分受众

bash
migma segments create --name "Active Users" --description "Users active in last 30 days" --json
migma segments create --name "VIP Subscribers" --tags tagId1,tagId2 --status subscribed --json
migma segments list --json
migma segments get <id> --json
migma segments delete <id> --json
bash
migma segments create --name "Active Users" --description "Users active in last 30 days" --json
migma segments create --name "VIP Subscribers" --tags tagId1,tagId2 --status subscribed --json
migma segments list --json
migma segments get <id> --json
migma segments delete <id> --json

Manage sending domains

管理发送域名

bash
undefined
bash
undefined

List all domains

列出所有域名

migma domains list --json
migma domains list --json

Add a custom domain (requires DNS setup)

添加自定义域名(需配置DNS)

migma domains add yourdomain.com --json migma domains add yourdomain.com --region eu-west-1 --json
migma domains add yourdomain.com --json migma domains add yourdomain.com --region eu-west-1 --json

Verify DNS records

验证DNS记录

migma domains verify yourdomain.com --json
migma domains verify yourdomain.com --json

Instant managed domain (no DNS needed)

即时托管域名(无需DNS配置)

migma domains managed create companyname --json
migma domains managed create companyname --json

hello@companyname.migma.email is ready immediately

hello@companyname.migma.email 可立即使用

Remove a managed domain

删除托管域名

migma domains managed delete companyname.migma.email --json
undefined
migma domains managed delete companyname.migma.email --json
undefined

Manage webhooks

管理Webhook

bash
undefined
bash
undefined

List webhooks

列出Webhook

migma webhooks list --json
migma webhooks list --json

Create a webhook

创建Webhook

migma webhooks create
--url https://yourserver.com/webhook
--events email.sent,email.delivered,email.bounced
--description "Production webhook" --json
migma webhooks create
--url https://yourserver.com/webhook
--events email.sent,email.delivered,email.bounced
--description "Production webhook" --json

Test a webhook (sends a test payload)

测试Webhook(发送测试负载)

migma webhooks test <webhookId> --json
migma webhooks test <webhookId> --json

Delete a webhook

删除Webhook

migma webhooks delete <webhookId> --json
undefined
migma webhooks delete <webhookId> --json
undefined

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.
当用户想要从其网站设置新品牌时:
bash
migma projects import https://yourbrand.com --wait --json
migma projects use <projectId>
此操作会自动获取标志、颜色、字体和品牌语气。

Error handling

错误处理

On error,
--json
returns:
json
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}
出现错误时,
--json
参数会返回:
json
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}