migma
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMigma
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 for structured output.
--json借助AI创建并发送专业、符合品牌风格的电子邮件。你的Agent可以根据提示设计邮件,通过托管域名即时发送,并管理全部受众——所有操作都在终端完成。
始终添加参数以获取结构化输出。
--jsonAuthentication
身份验证
bash
migma login # Authenticate with your API key
migma whoami --json # Show current user info
migma logout # Remove stored credentialsbash
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
undefined1. 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>
undefinedmigma projects list --json
migma projects use <projectId>
undefinedBefore 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 --jsonIf 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 :
--referencebash
migma generate "Follow-up to the welcome email" --reference <conversationId> --wait --jsonIf the user is creating something entirely new, skip this step.
在生成新邮件之前,查看用户是否想要基于现有成果(系列邮件、跟进邮件、改版邮件或类似邮件)进行创建。列出近期邮件以找到相关参考:
bash
migma emails list --project <projectId> --limit 5 --json如果用户提到系列邮件、跟进邮件、改版或“类似……的内容”,请展示近期邮件并询问要使用哪一个作为参考。然后通过参数传入对话ID:
--referencebash
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 --jsonThe flag blocks until the AI finishes. The JSON response includes , , and .
--waitconversationIdsubjecthtmlTo save the HTML locally, add . To include a reference image (screenshot, design mockup), add . To open the result in the browser, add .
--save ./email.html--image <url>--open当用户要求创建、设计或生成邮件时:
bash
migma generate "Welcome email for new subscribers" --wait --json--waitconversationIdsubjecthtml要将HTML保存到本地,请添加。要包含参考图片(截图、设计原型),请添加。要在浏览器中打开结果,请添加。
--save ./email.html--image <url>--openCheck generation status
检查生成状态
bash
migma generate-status <conversationId> --jsonbash
migma generate-status <conversationId> --jsonCreate an email series or remix
创建邮件系列或改版邮件
When the user wants to create a series of emails or remix an existing email:
-
List existing emails to find the reference:bash
migma emails list --project <projectId> --json -
Generate each email in the series usingto maintain consistency:
--referencebashmigma 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 flag tells MigmaAI to use the referenced email as context — matching its style, tone, and layout while generating new content.
--reference当用户想要创建系列邮件或改版现有邮件时:
-
列出现有邮件以找到参考:bash
migma emails list --project <projectId> --json -
使用参数生成系列中的每一封邮件,以保持一致性:
--referencebashmigma 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
--referenceList 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" --jsonFilters: (1-100, default 20), , .
--limit <n>--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筛选条件:(1-100,默认20)、、。
--limit <n>--status <pending|processing|completed|failed>--search <query>Send an email
发送邮件
When the user asks to send an email to someone:
bash
undefined当用户要求给某人发送邮件时:
bash
undefinedSend a generated email directly
直接发送生成的邮件
migma send --to sarah@example.com --subject "Welcome!"
--from-conversation <conversationId>
--from hello@company.migma.email --from-name "Company" --json
--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
--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
--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
--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
--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
--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 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
--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
--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
--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
--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
--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 --jsonbash
migma send-test <conversationId> --to test@company.com --jsonCheck batch send status
检查批量发送状态
bash
migma batch-status <batchId> --jsonbash
migma batch-status <batchId> --jsonValidate 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!" --jsonReturns 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!" --jsonThe flag provides the email subject for deliverability/spam analysis.
--subject当用户想要在发送前检查邮件时:
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--subjectExport 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> --jsonKlaviyo export supports (default: html). All export commands support to save locally.
--type <html|hybrid|code>--output <file>当用户想要导出到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> --jsonKlaviyo导出支持(默认:html)。所有导出命令均支持参数以保存到本地。
--type <html|hybrid|code>--output <file>Manage contacts
管理联系人
bash
undefinedbash
undefinedAdd 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
--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
--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> --jsonTag list options: (default 50), , .
--limit <n>--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标签列表选项:(默认50)、、。
--limit <n>--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> --jsonbash
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> --jsonManage sending domains
管理发送域名
bash
undefinedbash
undefinedList 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
undefinedmigma domains managed delete companyname.migma.email --json
undefinedManage webhooks
管理Webhook
bash
undefinedbash
undefinedList 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
--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
--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
undefinedmigma webhooks delete <webhookId> --json
undefinedImport 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, returns:
--jsonjson
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}出现错误时,参数会返回:
--jsonjson
{"error": {"message": "Not found", "code": "not_found", "statusCode": 404}}