cli-anything-mailchimp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-mailchimp
cli-anything-mailchimp
Identity
工具标识
An agent-native CLI for the Mailchimp Marketing API v3.0, built on the CLI-Anything framework.
一款基于CLI-Anything框架构建的、原生适配Agent的Mailchimp Marketing API v3.0 CLI工具。
What This CLI Does
该CLI的功能
- Manage audiences (lists) — create, update, delete lists; add/update/archive members; manage merge fields, segments, tags, and webhooks.
- Run campaigns — create, schedule, send, pause, replicate, and analyse email campaigns.
- Read reports — open rates, click rates, bounce stats, unsubscribes, email activity, geographic data.
- Control automations — create and manage automated email workflows.
- Manage e-commerce — stores, orders, customers, products, carts, and promo codes.
- Use templates, file manager, landing pages, SMS campaigns, surveys, and all other Marketing API resources.
- 管理受众(列表)——创建、更新、删除列表;添加、更新、归档成员;管理合并字段、细分群体、标签和Webhook。
- 运行营销活动——创建、排期、发送、暂停、复制和分析电子邮件营销活动。
- 查看报告——打开率、点击率、退信统计、退订记录、邮件活动数据、地域数据。
- 控制自动化流程——创建和管理自动化电子邮件工作流。
- 管理电商业务——店铺、订单、客户、商品、购物车和优惠码。
- 使用模板、文件管理器、着陆页、SMS营销活动、调查问卷及所有其他Marketing API资源。
Prerequisites
前置条件
- Python 3.10+
- environment variable set to your API key (including datacenter suffix, e.g.
MAILCHIMP_API_KEY)abc123-us8
- Python 3.10+
- 设置环境变量为你的API密钥(需包含数据中心后缀,例如
MAILCHIMP_API_KEY)abc123-us8
Installation
安装步骤
bash
undefinedbash
undefinedFrom the CLI-Anything repo (once merged):
从CLI-Anything仓库安装(合并后):
During development:
开发环境安装:
cd mailchimp/agent-harness && pip install -e .
undefinedcd mailchimp/agent-harness && pip install -e .
undefinedCommand Reference
命令参考
Root
根命令
| Command | Description |
|---|---|
| Health check — confirms API connectivity |
| Get account info |
| Output any command as JSON |
| Launch interactive REPL |
| 命令 | 描述 |
|---|---|
| 健康检查——确认API连通性 |
| 获取账户信息 |
| 以JSON格式输出任意命令结果 |
| 启动交互式REPL模式 |
Lists (Audiences)
列表(受众)
| Command | Description |
|---|---|
| List all audiences |
| Get audience info |
| Create audience |
| Update audience |
| Delete audience |
| List members |
| Get member by MD5 hash |
| Add member |
| List merge fields |
| Add merge field |
| List segments |
| List member tags |
| Add/remove member tags |
| List webhooks |
| Add webhook |
| 命令 | 描述 |
|---|---|
| 列出所有受众 |
| 获取受众信息 |
| 创建受众 |
| 更新受众信息 |
| 删除受众 |
| 列出受众成员 |
| 通过MD5哈希值获取成员信息 |
| 添加受众成员 |
| 列出合并字段 |
| 添加合并字段 |
| 列出细分群体 |
| 列出成员标签 |
| 添加/移除成员标签 |
| 列出Webhook |
| 添加Webhook |
Campaigns
营销活动
| Command | Description |
|---|---|
| List campaigns |
| Get campaign info |
| Create campaign |
| Update campaign settings |
| Delete campaign |
| Send campaign immediately |
| Schedule campaign |
| Cancel scheduled send |
| Pause RSS campaign |
| Resume RSS campaign |
| Duplicate campaign |
| Get campaign content |
| Pre-send checklist |
| 命令 | 描述 |
|---|---|
| 列出所有营销活动 |
| 获取营销活动信息 |
| 创建营销活动 |
| 更新营销活动设置 |
| 删除营销活动 |
| 立即发送营销活动 |
| 排期营销活动 |
| 取消已排期的发送 |
| 暂停RSS营销活动 |
| 恢复RSS营销活动 |
| 复制营销活动 |
| 获取营销活动内容 |
| 发送前检查清单 |
Reports
报告
| Command | Description |
|---|---|
| List all campaign reports |
| Get campaign summary report |
| Per-subscriber open/click activity |
| Link click breakdown |
| Per-subscriber opens |
| Unsubscribers |
| Geographic breakdown |
| Per-domain stats |
| 命令 | 描述 |
|---|---|
| 列出所有营销活动报告 |
| 获取营销活动汇总报告 |
| 单个订阅者的打开/点击活动数据 |
| 链接点击明细 |
| 单个订阅者的打开记录 |
| 退订用户列表 |
| 地域分布明细 |
| 各域名统计数据 |
Automations
自动化流程
| Command | Description |
|---|---|
| List automations |
| Get automation info |
| Create automation |
| Pause automation |
| Start automation |
| Archive automation |
| List automation emails |
| 命令 | 描述 |
|---|---|
| 列出所有自动化流程 |
| 获取自动化流程信息 |
| 创建自动化流程 |
| 暂停自动化流程 |
| 启动自动化流程 |
| 归档自动化流程 |
| 列出自动化流程中的邮件 |
E-commerce
电商业务
| Command | Description |
|---|---|
| List stores |
| Get store info |
| Add store |
| List orders |
| List products |
| List customers |
| List carts |
| List promo codes |
| 命令 | 描述 |
|---|---|
| 列出所有店铺 |
| 获取店铺信息 |
| 添加店铺 |
| 列出订单 |
| 列出商品 |
| 列出客户 |
| 列出购物车 |
| 列出优惠码 |
Other Resources
其他资源
| Group | Description |
|---|---|
| Email templates (list, get, create, update, delete) |
| Template folders |
| Campaign folders |
| Files and folders in the file manager |
| Landing pages (list, create, publish, unpublish) |
| SMS campaigns (10 operations) |
| Surveys (list, get, publish) |
| Facebook ad and landing page reporting |
| Search campaigns by query |
| Search members across all audiences |
| Batch API operations |
| Batch operation webhooks |
| Email domain verification |
| OAuth connected apps |
| Connected site integrations |
| Inbox conversations |
| Account activity feed |
| Account data exports |
| 分组 | 描述 |
|---|---|
| 电子邮件模板(列出、获取、创建、更新、删除) |
| 模板文件夹 |
| 营销活动文件夹 |
| 文件管理器中的文件和文件夹 |
| 着陆页(列出、创建、发布、下架) |
| SMS营销活动(10项操作) |
| 调查问卷(列出、获取、发布) |
| Facebook广告和着陆页报告 |
| 通过查询语句搜索营销活动 |
| 跨所有受众搜索成员 |
| 批量API操作 |
| 批量操作Webhook |
| 电子邮件域名验证 |
| OAuth授权应用 |
| 关联站点集成 |
| 收件箱对话 |
| 账户活动动态 |
| 账户数据导出 |
JSON Output
JSON输出
All commands support at the root level:
--jsonbash
undefined所有命令均支持在根级别使用参数:
--jsonbash
undefinedList all audiences as JSON
以JSON格式列出所有受众
cli-anything-mailchimp --json lists list
cli-anything-mailchimp --json lists list
Get a campaign report as JSON
以JSON格式获取营销活动报告
cli-anything-mailchimp --json reports get abc123def
cli-anything-mailchimp --json reports get abc123def
Pipe to jq — use the native Mailchimp field name for the resource
管道输出至jq——使用Mailchimp原生资源字段名
cli-anything-mailchimp --json lists list | jq '.lists[].name'
cli-anything-mailchimp --json campaigns list | jq '.campaigns[].id'
**Envelope shapes** (native Mailchimp API response — use the resource-specific key):
```json
// List endpoints — key matches the resource name (lists, campaigns, members, etc.)
{"lists": [...], "total_items": 42, "_links": [...]}
{"campaigns": [...], "total_items": 10, "_links": [...]}
// Single resource GET / POST / PATCH
{"id": "abc123", "name": "My List", ...}
// DELETE
{"ok": true, "message": "Deleted."}
// Error
{"ok": false, "message": "Resource Not Found: ...", "data": {...}}cli-anything-mailchimp --json lists list | jq '.lists[].name'
cli-anything-mailchimp --json campaigns list | jq '.campaigns[].id'
**返回结构**(Mailchimp API原生响应——使用资源特定的键):
```json
// 列表类端点——键名与资源名称匹配(lists, campaigns, members等)
{"lists": [...], "total_items": 42, "_links": [...]}
{"campaigns": [...], "total_items": 10, "_links": [...]}
// 单个资源的GET / POST / PATCH请求
{"id": "abc123", "name": "My List", ...}
// DELETE请求
{"ok": true, "message": "Deleted."}
// 错误响应
{"ok": false, "message": "Resource Not Found: ...", "data": {...}}Common Agent Patterns
常见Agent使用模式
bash
undefinedbash
undefinedGet account health
获取账户健康状态
cli-anything-mailchimp --json ping | jq '.health_status'
cli-anything-mailchimp --json ping | jq '.health_status'
List all audience IDs and names
列出所有受众ID和名称
cli-anything-mailchimp --json lists list | jq '.lists[] | {id, name}'
cli-anything-mailchimp --json lists list | jq '.lists[] | {id, name}'
Find all subscribed members in an audience
查找受众中所有已订阅成员
cli-anything-mailchimp --json lists list-lists-id-members <list_id> --status subscribed | jq '.members[].email_address'
cli-anything-mailchimp --json lists list-lists-id-members <list_id> --status subscribed | jq '.members[].email_address'
Create a campaign and get its send checklist
创建营销活动并获取发送检查清单
cli-anything-mailchimp --json campaigns create --data '{"type":"regular","settings":{"subject_line":"Hello","from_name":"Me","reply_to":"me@example.com"}}' | jq '.id'
cli-anything-mailchimp --json campaigns list-send-checklist <campaign_id> | jq '.items[] | select(.result == false)'
cli-anything-mailchimp --json campaigns create --data '{"type":"regular","settings":{"subject_line":"Hello","from_name":"Me","reply_to":"me@example.com"}}' | jq '.id'
cli-anything-mailchimp --json campaigns list-send-checklist <campaign_id> | jq '.items[] | select(.result == false)'
Get unsubscribes for a sent campaign
获取已发送营销活动的退订用户
cli-anything-mailchimp --json reports list-unsubscribed <campaign_id> | jq '.unsubscribes[].email_address'
cli-anything-mailchimp --json reports list-unsubscribed <campaign_id> | jq '.unsubscribes[].email_address'
Add a member to an audience (subscriber hash = MD5 of lowercased email)
添加成员到受众(订阅者哈希值为邮箱小写后的MD5值)
cli-anything-mailchimp --json lists create-members <list_id> --data '{"email_address":"user@example.com","status":"subscribed"}'
cli-anything-mailchimp --json lists create-members <list_id> --data '{"email_address":"user@example.com","status":"subscribed"}'
Search for a member across all audiences
跨所有受众搜索成员
cli-anything-mailchimp --json search-members list --query "user@example.com" | jq '.exact_matches.members[]'
undefinedcli-anything-mailchimp --json search-members list --query "user@example.com" | jq '.exact_matches.members[]'
undefinedInteractive REPL
交互式REPL
Run with no arguments to enter the REPL:
cli-anything-mailchimp◆ cli-anything · Mailchimp
v0.1.0
Type help for commands, quit to exit
◆ mailchimp ❯ ping
✓ {"health_status": "Everything's Chimpy!"}
◆ mailchimp ❯ --json lists list
{"lists": [...], "total_items": 3, "_links": [...]}
◆ mailchimp ❯ quit不带参数运行即可进入REPL模式:
cli-anything-mailchimp◆ cli-anything · Mailchimp
v0.1.0
Type help for commands, quit to exit
◆ mailchimp ❯ ping
✓ {"health_status": "Everything's Chimpy!"}
◆ mailchimp ❯ --json lists list
{"lists": [...], "total_items": 3, "_links": [...]}
◆ mailchimp ❯ quitNotes
注意事项
- Subscriber hash: Mailchimp identifies members by the MD5 hash of their lowercased email. Compute with .
python -c "import hashlib; email='email@example.com'; print(hashlib.md5(email.strip().lower().encode()).hexdigest())" - Body payloads: All POST/PATCH/PUT commands accept . See Mailchimp API docs for the schema of each endpoint.
--data '<json>' - Datacenter: Your API key ends in ,
-us8, etc. The CLI extracts this automatically — include it in-eu2.MAILCHIMP_API_KEY - Rate limits: The Marketing API rate-limits at 10 concurrent connections and a rolling per-account limit. For bulk operations, use the group.
batches
- 订阅者哈希值:Mailchimp通过邮箱小写后的MD5哈希值识别成员,可通过以下命令计算:。
python -c "import hashlib; email='email@example.com'; print(hashlib.md5(email.strip().lower().encode()).hexdigest())" - 请求体:所有POST/PATCH/PUT命令均接受参数,每个端点的JSON格式可参考Mailchimp API文档。
--data '<json>' - 数据中心:你的API密钥后缀为、
-us8等,CLI会自动提取该信息,请确保-eu2包含此后缀。MAILCHIMP_API_KEY - 速率限制:Marketing API限制10个并发连接,且有账户级滚动速率限制。如需批量操作,请使用分组命令。
batches