Pp mailchimp

From mvanhorn/printing-press-library · View interactive version

Pp mailchimp is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Every Mailchimp endpoint plus the workflow commands the API forces you to compose yourself. Trigger phrases: `subscribe to mailchimp`, `add a contact to mailchimp`, `send a mailchimp campaign`, `mailchimp campaign performance`, `import contacts to mailchimp`, `audit mailchimp segments`, `mailchimp d

How to use this skill

Skill file

<!-- GENERATED FILE — DO NOT EDIT.

This file is a verbatim mirror of library/marketing/mailchimp/SKILL.md,

regenerated post-merge by tools/generate-skills/. Hand-edits here are

silently overwritten on the next regen. Edit the library/ source instead.

See the repository agent guide, section "Generated artifacts: registry.json, cli-skills/". -->

Mailchimp — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the mailchimp-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install mailchimp --cli-only

```

  1. Verify: mailchimp-pp-cli --version
  2. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/marketing/mailchimp/cmd/mailchimp-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

When to Use This CLI

Reach for this CLI when you need to drive Mailchimp from a terminal or agent and the workflow spans more than one endpoint: subscribing a contact with tags, importing a CSV through the batch endpoint, measuring whether a campaign worked, or auditing segment hygiene. The local SQLite cache makes the audience SQL-queryable, which is impossible through the dashboard or the SDK. The MCP surface uses code orchestration over 291 endpoints in ~1K tokens, so an agent can reach any Mailchimp endpoint without bloating its tool list.

Unique Capabilities

These capabilities aren't available in any other tool for this API.

Workflow composition

_When an agent needs to add a contact with tags, this is one call instead of three with MD5 hashing in the middle._

```bash

mailchimp-pp-cli subscribe alice@example.com --list a1b2c3d4e5 --tags vip,onboarding --merge FNAME=Alice

```

_When an agent needs to subscribe more than ~50 contacts at once, this is the only safe path that respects rate limits and gives back actionable per-row results._

```bash

mailchimp-pp-cli bulk-subscribe --csv contacts.csv --list a1b2c3d4e5 --tags newsletter --watch

```

Local joins that compound

_Use digest <id> for per-campaign analysis; use digest --last N for a weekly rollup. --md is the paste-into-doc shape both personas need._

```bash

mailchimp-pp-cli digest --last 5 --md

```

_When cleaning up an audience or auditing segmentation hygiene, this surfaces what's dead in one call._

```bash

mailchimp-pp-cli segments audit --list a1b2c3d4e5 --json

```

_When measuring whether a campaign drove revenue, this is the single command._

```bash

mailchimp-pp-cli attribution 7f8a9b0c1d --store mystore --json

```

_When investigating a deliverability dip, this shows you which inbox providers are degrading without clicking through 10 separate report pages._

```bash

mailchimp-pp-cli deliverability --last 10 --json

```

_When you ask 'which campaign won?' or 'did the change work?', this is the single command. The --md mode pastes into a weekly review doc._

```bash

mailchimp-pp-cli compare 7f8a9b0c1d 8c9d0e1f2a --md

```

Operational safety

_When sending campaigns from a pipeline, this is the safe default — broken campaigns don't ship silently._

```bash

mailchimp-pp-cli send-checked 7f8a9b0c1d

```

Command Reference

account-exports — Manage account exports

activity-feed — Manage activity feed

audiences — Manage audiences

authorized-apps — Manage authorized apps

automations — Manage automations

batch-webhooks — Manage batch webhooks

batches — Manage batches

campaign-folders — Manage campaign folders

campaigns — Manage campaigns

connected-sites — Manage connected sites

conversations — Manage conversations

customer-journeys — Manage customer journeys

ecommerce — Manage ecommerce

facebook-ads — Manage facebook ads

file-manager — Manage file manager

landing-pages — Manage landing pages

lists — Manage lists

ping — Manage ping

reporting — Manage reporting

reports — Manage reports

search-campaigns — Manage search campaigns

search-members — Manage search members

sms-campaigns — Manage sms campaigns

template-folders — Manage template folders

templates — Manage templates

verified-domains — Manage verified domains

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

mailchimp-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Recipes

Add a subscriber with tags in one call

mailchimp-pp-cli subscribe alice@example.com --list LIST_ID --tags vip,onboarding --merge FNAME=Alice --merge LNAME=Smith

Composes PUT /lists/{id}/members/{md5} + POST /lists/{id}/members/{md5}/tags with the MD5 hash computed for you.

Import 5,000 contacts from CSV via the batch endpoint

mailchimp-pp-cli bulk-subscribe --csv contacts.csv --list LIST_ID --tags newsletter --watch

Posts to /batches, polls until done, decompresses the tar.gz JSONL within the 10-minute expiring URL window, returns per-row outcomes.

Check whether a campaign succeeded

mailchimp-pp-cli digest CAMPAIGN_ID --json --select campaign_id,open_rate,click_rate,top_links,top_products

Joins four report endpoints and lets --select dotted paths narrow the response to the fields an agent actually needs (Mailchimp's reports run >10KB each).

Find stale segments to clean up

mailchimp-pp-cli segments audit --list LIST_ID --json

Surfaces empty segments, segments with no member growth in 90 days, and segments not used by any recent campaign.

Gate a campaign send on the official checklist

mailchimp-pp-cli send-checked CAMPAIGN_ID

Runs /send-checklist first; if any item is type=error, exits 2 with the failing items printed and does not send. Use in CI to prevent broken campaigns shipping silently.

Compare two campaigns head-to-head for a Monday review doc

mailchimp-pp-cli compare CAMPAIGN_A CAMPAIGN_B --md

Renders a side-by-side diff of open rate, CTR, revenue, and unsubscribes with the winner per metric. The --md output pastes into Notion or Slack.

Weekly campaign rollup for a founder review

mailchimp-pp-cli digest --last 5 --md

Renders a multi-campaign summary table with aggregate stats. Marcus's Monday founder doc shape.

Auth Setup

Mailchimp encodes the datacenter in the API key suffix. The key 'abc...xyz-us6' tells the CLI to route requests to 'us6.api.mailchimp.com.' Set MAILCHIMP_API_KEY and the CLI parses the suffix at startup. For OAuth tokens (no embedded suffix), set MAILCHIMP_DC=us1 explicitly or let 'mailchimp auth dc-lookup' resolve it from the metadata endpoint.

Run mailchimp-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

mailchimp-pp-cli account-exports get --agent --select id,name,status

```

Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

mailchimp-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
mailchimp-pp-cli feedback --stdin < notes.txt
mailchimp-pp-cli feedback list --json --limit 10

Entries are stored locally at ~/.mailchimp-pp-cli/feedback.jsonl. They are never POSTed unless MAILCHIMP_FEEDBACK_ENDPOINT is set AND either --send is passed or MAILCHIMP_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

mailchimp-pp-cli profile save briefing --json
mailchimp-pp-cli --profile briefing account-exports get
mailchimp-pp-cli profile list --json
mailchimp-pp-cli profile show briefing
mailchimp-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 4 | Authentication required |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show mailchimp-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

claude mcp add mailchimp-pp-mcp -- mailchimp-pp-mcp

Verify: claude mcp list

Direct Use

  1. Check if installed: which mailchimp-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

mailchimp-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: mailchimp-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.