Quick start
Five commands to go from zero to a sent email:Authentication
MIGMA_API_KEY environment variable — the CLI checks it first, then falls back to the stored config.
| Command | Description |
|---|---|
migma login | Save your API key (interactive prompt) |
migma logout | Remove stored credentials |
migma whoami | Show current key and default project |
Generate
Create on-brand emails with AI from a single command.| Flag | Effect |
|---|---|
--wait | Block until generation completes |
--save <file> | Save the finished HTML locally (requires --wait) |
--open | Open the result in your browser (requires --wait) |
--image <url> | Attach a reference image to the prompt |
Send
Send to an individual, a segment, or a tag.--from-conversation exports the HTML automatically — no manual export step needed.
| Command | Description |
|---|---|
migma send test <conversationId> --to <email> | Send a test email |
migma send batch-status <batchId> | Check batch delivery progress |
Validate
Run preflight checks before you send.| Check | What it does |
|---|---|
migma validate all | Run every check, show overall score |
migma validate compatibility | Test across 30+ email clients (score/100) |
migma validate links | Find broken links |
migma validate spelling | AI-powered grammar and spelling |
migma validate deliverability | Spam score and inbox prediction |
--html <file> or --conversation <id>.
Export
Export generated emails to files or platforms.| Format | Command |
|---|---|
| HTML | migma export html <id> |
| MJML | migma export mjml <id> |
migma export pdf <id> | |
| Klaviyo | migma export klaviyo <id> |
| Mailchimp | migma export mailchimp <id> |
| HubSpot | migma export hubspot <id> |
--output <file> to download the result locally.
Audience
Contacts
Contacts
| Command | Description |
|---|---|
migma contacts list | List contacts (paginated) |
migma contacts add --email <email> | Create a contact |
migma contacts get <id> | Get contact details |
migma contacts update <id> --firstName Jane | Update a contact |
migma contacts remove <id> | Delete a contact |
migma contacts import ./file.csv | Bulk import from CSV |
email, firstName, first_name, First Name, etc.). Any unrecognized columns become custom fields.Tags
Tags
Segments
Segments
| Command | Description |
|---|---|
migma segments list | List all segments |
migma segments create --name "Active" --description "..." | Create a segment |
migma segments get <id> | Get segment details |
migma segments delete <id> | Delete a segment |
Infrastructure
Projects
Projects
| Command | Description |
|---|---|
migma projects list | List all projects (--all for every page) |
migma projects get <id> | Get project details |
migma projects import <url> | Import brand from URL (--wait to block) |
migma projects use <id> | Set default project |
Domains
Domains
| Command | Description |
|---|---|
migma domains list | List sending domains |
migma domains add <domain> | Add a custom domain |
migma domains verify <domain> | Verify DNS records |
migma domains managed create <prefix> | Create instant subdomain |
migma domains managed delete <domain> | Delete managed subdomain |
Webhooks
Webhooks
| Command | Description |
|---|---|
migma webhooks list | List all webhooks |
migma webhooks create --url <url> --events <events...> | Create a webhook |
migma webhooks test <id> | Send a test event |
migma webhooks delete <id> | Delete a webhook |
Global options
Every command supports these flags:| Flag | Description |
|---|---|
--json | Machine-readable JSON output |
--project <id> | Override the default project for this command |
--help | Show help for any command |
Configuration
The CLI stores config in~/.migma/config.json:
| Setting | Priority |
|---|---|
| API key | MIGMA_API_KEY env var → config file |
| Project ID | --project flag → MIGMA_PROJECT_ID env var → config file |