Skip to main content

WeChat Official Account Publishing

Publish long-form articles from your workspace vault to the WeChat Official Account draft box — without giving the Agent a one-click publish tool. This workflow is file-centric: Markdown lives in the vault, the formatter writes .wechat.html beside it, you preview in WebUI, then you click Push to WeChat Draft when ready.
WeChat (iLink) is your personal WeChat via QR login. WeChat Official uses AppID + AppSecret and the Official Account draft API. They are separate channels.

Prerequisites

  1. A WeChat Official Account (subscription or service account) with API access enabled.
  2. AppID and AppSecret from mp.weixin.qq.com → Settings → Basic configuration.
  3. Server public IP whitelisted on the same page (required for uploadimg and draft/add).
  4. Optional: bind the WeChat Official channel in Settings → Channels for inbound messages (draft push works with credentials alone).

Configure credentials

  1. Open Settings → Channels → WeChat Official.
  2. Enter AppID and AppSecret.
  3. Click Test connection — fix IP whitelist if the test fails.
  4. Save. Credentials are stored as wechatOfficialCredentials.

Workflow: vault → HTML → draft

Step 1 — Write Markdown in the vault

Author in Typora, Obsidian, or any editor. Save under the workspace vault, e.g. articles/my-post.md. Use relative images:

Step 2 — Format with the prebuilt skill

Ask the Agent (or run Kanban with the WeChat (微信公众号) branch):
“Convert articles/my-post.md to WeChat Official HTML.”
The wechat-article-formatter skill runs md_to_wechat_html.py and produces articles/my-post.wechat.html with block-level inline CSS (headings, paragraphs, code blocks, tables, images).

Step 3 — Preview the HTML artifact

Open the HTML artifact in chat. ArtifactCard renders it inline. Confirm layout and images.

Step 4 — HITL push to draft box

  1. On the HTML artifact card, click Push to WeChat Draft.
  2. Set the title (required).
  3. Cover image: auto-filled from the first inline <img> when present; or pick from workspace image suggestions; or enter a workspace-relative path manually.
  4. Confirm push.
The server:
  • Validates paths with relative_to (workspace unknown → 503 fail-closed).
  • Uploads inline images to WeChat CDN (uploadimg) before the cover thumb.
  • Calls draft/add with body HTML + embedded styles.

Step 5 — Publish on WeChat (manual)

Open mp.weixin.qq.comDraft box, review the article, then publish or schedule. Myrm does not auto-publish — by design (HITL).

Security and design choices

Troubleshooting

  • Multi-Channel — all messaging channels including WeChat iLink vs Official
  • Prebuilt skill: myrm-agent-server/assets/prebuilt_skills/wechat-article-formatter/SKILL.md