coolbreezecoin/dsh-wechat-mp
it never broadcasts.
Turns markdown into a typeset WeChat Official Account draft. The WeChat editor discards <style> blocks and class names and filters every image not hosted on mmbiz.qpic.cn, so the plugin does the two error-prone parts: it inlines every style onto its element and routes every image through WeChat's own upload endpoint. Tools are mp_render (markdown in, inline-styled HTML plus a standalone preview page out), mp_upload_image (a local jpg/png under 1 MB in, its mmbiz.qpic.cn URL out), mp_create_draft (refuses before touching the API if any image token is unresolved, and requires exactly one cover form) and mp_list_drafts. A one-click 发公众号 button on every assistant reply does the same rendering into the draft box.
Install
dsh plugin --profile web add dsh-wechat-mpREADME install (into the web profile), then start dsh as usual — the mp_render typesetting tool is available immediately. npm package dsh-wechat-mp 0.3.0 (registry-verified 2026-09-10; registry repository field -> github.com/coolbreezecoin/dsh-wechat-mp). Credentials are two references (WECHAT_MP_APPID, WECHAT_MP_SECRET) resolved by dsh's credential provider (process env, project .env, $DSH_HOME/.env or $DSH_HOME/.credentials.yaml); both come from the WeChat Official Account console (公众平台 → 设置与开发 → 基本配置).
Compatibility
Two layers: the typesetting layer (mp_render) needs no credentials, while the API layer (mp_upload_image, mp_create_draft, mp_list_drafts) needs the AppID/AppSecret. Every API call must originate from an IP listed in the account's IP allowlist — a rotated home-broadband address produces errcode 40164. Write tools run without prompting by default; setting requireApproval: true routes them through dsh's approval seam (tools/pre-execute) and fails closed with no approval channel.
Details
- Repo: coolbreezecoin/dsh-wechat-mp
- Category: Tools & Capabilities
- Stars: 1
- Version: npm dsh-wechat-mp 0.3.0 (registry-verified 2026-09-10)
- Last push: 2026-08-16
- First seen: 2026-08-15
Recent updates
README documents the delivery stance: the write tools never publish — a draft still needs a human to press send in the Official Account console — so an unattended run leaves a draft to delete rather than a post readers already saw; it also warns that deleting a draft does not return the permanent-material slot its cover consumed.
FAQ
- How do I install dsh-wechat-mp?
- Run: dsh plugin --profile web add dsh-wechat-mp, then start dsh as usual. The mp_render typesetting tool works immediately; the API tools additionally need WECHAT_MP_APPID and WECHAT_MP_SECRET.
- Do I need a verified WeChat Official Account?
- Not for typesetting — mp_render needs no credentials and returns inline-styled HTML plus a preview page you can paste into the console by hand. The API tools need account credentials, and even an unverified personal subscription account can reach the draft API per the README.
- Why does an API call fail with errcode 40164?
- Every call must originate from an IP listed in 公众平台 → 基本配置 → IP白名单. Home broadband rotates its address, so a working setup can fail the next day; the error message says so explicitly — update the allowlist.