coolbreezecoin/dsh-wechat-mp
dsh-wechat-mp
DeepSeek Harness plugin: turn markdown into a typeset WeChat Official Account draft
Install
npx @deepseek-ai/dsh plugin --profile web add dsh-wechat-mpRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-wechat-mp)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from coolbreezecoin/dsh-wechat-mp, cleaned of badges and images.
dsh-wechat-mp
English | 中文
A DeepSeek Harness plugin that turns markdown into a typeset WeChat Official Account (微信公众号) draft.
"Put
~/posts/why-inline-css.mdin the draft box with the grace theme."
The agent renders the article, uploads each image, and creates the draft. It never broadcasts: sending is left to a human in the Official Account console.
Why it exists
The WeChat editor throws away <style> blocks and class names, and filters every image not hosted on mmbiz.qpic.cn. So "paste your HTML in" does not work, and neither does an article that references your own CDN. This plugin does the two boring, error-prone parts: inline every style onto its element, and route every image through WeChat's own upload endpoint.
Two layers, and only one needs an account
| Layer | Needs credentials? | What you get |
|---|---|---|
Typesetting (mp_render) | No | Inline-styled HTML + a local preview page. Paste it into the console by hand. |
API (mp_upload_image, mp_create_draft, mp_list_drafts) | Yes | The agent creates the draft for you. |
Even an unverified personal subscription account can reach the draft API — see Account types. And if yours cannot, the typesetting layer still works on its own.
Install
dsh plugin --profile web add dsh-wechat-mp
Then start dsh as usual. mp_render is available immediately.
Credentials
The API tools read two credential references. Configuration holds the names; the values live with dsh's credential provider, so your config stays safe to commit.
| Reference | What it is |
|---|---|
WECHAT_MP_APPID | The Official Account's AppID |
WECHAT_MP_SECRET | The Official Account's AppSecret |
Supply them any way dsh resolves credentials — process environment, a project .env, $DSH_HOME/.env, or $DSH_HOME/.credentials.yaml:
export WECHAT_MP_APPID=wx...
export WECHAT_MP_SECRET=...
Both come from 公众平台 → 设置与开发 → 基本配置. The AppSecret is shown once; regenerating it invalidates any token other systems hold.
Without them, the API tools are still registered but every call fails with a message telling you what is missing. mp_render is unaffected.
Tools
mp_render — read-only
Markdown in, WeChat-ready HTML out. Writes the article body and a standalone preview page, and returns their paths.
Image sources come back as placeholder tokens (dsh-mp-image-0, …), not URLs — they are filled in after upload.
| Parameter | |
|---|---|
path / markdown | Exactly one: a markdown file, or the source text. |
theme | default, grace, simple. |
code_theme | github, github-dark, atom-one-light, atom-one-dark, vs, monokai. |
primary_color | Accent hex, e.g. #0F4C81. |
font_size | e.g. 15px. |
indent | Indent each paragraph 2em, as Chinese print does. |
line_numbers | Line numbers in code blocks. |
mp_upload_image — write
Uploads one local jpg/png (under 1 MB) and returns its mmbiz.qpic.cn URL.
mp_create_draft — write
Takes the htmlPath from mp_render, the token→URL map from the uploads, a title and a cover, and creates the draft.
…

