Open-Source CLI Suite Automates WeChat Public Account Publishing End to End
WeChat publishing has long been a sink of manual drudgery, and this toolchain shows a concrete pattern for automating a closed-platform editorial flow while staying within official APIs. The proxy design is directly reusable by any developer who needs to call IP-whitelisted interfaces from a local machine or agent.
Publishing to WeChat public accounts forces creators through a batch of manual chores after the writing is done: pasting Markdown into a poor inline editor, cropping covers to two conflicting aspect ratios, and logging in and out of multiple accounts. A new open-source toolchain automates that whole flow. The core is zzhub-pipeline, a CLI task state machine that runs four stages in order: prepare, review, render, publish. It persists all state and artifacts locally, so a network timeout mid-run resumes from checkpoints instead of starting over.
The cover step is the trickiest. WeChat requires a 2.35:1 header image but center-crops it to 1:1 in feed cards, so a single image must keep text inside the square safe zone. The typeset-studio package handles this with pure algorithmic layout and native Canvas rendering, producing PNGs in milliseconds without spinning up headless Chrome. The author says this supersedes earlier attempts built on satori and satori-html, which proved too flexible for practical template use.
Safety is built in: the pipeline calls WeChat's official draft/add API, never scrapers. Because that API requires the caller's IP to be whitelisted, a lightweight proxy service, bun-wx-server, runs on a fixed-IP server. The pipeline only writes to drafts; the final broadcast requires a phone scan by the author. Multi-account switching works through per-account configuration, and the whole pipeline is agent-friendly.
The review gate treats every AI draft as untrustworthy by default, forcing an independent model pass or human check. That's a pragmatic answer to hallucination risk when AI produces content destined for public distribution.
Moving from satori-style flexible templates to a fixed algorithmic layout suggests that too much template freedom was the bottleneck; constraining the layout while varying only text and images is what makes covers reproducible across posts.
The resumable state machine design borrows from CI/CD expectations, treating a publishing workflow as a long-running job that must survive partial failures rather than as a one-shot script.
Open-sourcing a proxy to work around WeChat's IP whitelist is a reminder that even official APIs on platforms like WeChat come with network constraints that force extra infrastructure when running locally.