Install
openclaw skills install @harven-droid/wechat-to-imaSave WeChat Official Account articles into IMA notes or into a named IMA knowledge base with preserved article structure. Use when the user sends an mp.weixin.qq.com link and wants to save, archive, import, collect, or store the article in IMA/笔记/知识库. Handles parsing article metadata, preserving inline body images in order, falling back to the cover image when the body has no images, then either saving to IMA notes or resolving a target knowledge base and adding the article there. When the user asks for a 知识库, route only to that knowledge base and do not create an extra user-visible IMA note.
openclaw skills install @harven-droid/wechat-to-imaSave a WeChat article into IMA with two user-facing flows:
不要把内部实现细节当成用户流程来描述。
scripts/save_wechat_to_ima.py <url> → 解析公众号文章 → 存到 IMA 笔记scripts/save_wechat_to_ima.py <url> <knowledge_base_name_or_id> → 解析公众号文章 → 查知识库 → 加入该知识库IMA_OPENAPI_CLIENTID and IMA_OPENAPI_APIKEY~/.config/ima/client_id and ~/.config/ima/api_keynpm install once inside this skill directory so the bundled extractor dependencies are available.skills/ima-skill/ima_api.cjs is used when present, so this skill stays aligned with the latest IMA OpenAPI wrapper and error handling.export IMA_OPENAPI_CLIENTID="<your_client_id>"
export IMA_OPENAPI_APIKEY="<your_api_key>"
mkdir -p ~/.config/ima
printf '%s' '<your_client_id>' > ~/.config/ima/client_id
printf '%s' '<your_api_key>' > ~/.config/ima/api_key
cd skills/wechat-to-ima
npm install
python3 scripts/save_wechat_to_ima.py "https://mp.weixin.qq.com/s/xxxxx"
python3 scripts/save_wechat_to_ima.py "https://mp.weixin.qq.com/s/xxxxx" "知识库名称"
Behavior:
missing env: ... → IMA credentials are not configured yetknowledge base not found: ... → the specified knowledge base name/ID cannot be resolvedknowledge base ambiguous: ... → multiple knowledge bases matched; use the exact name or IDnpm install in this skill directory firstThe script prints JSON with:
titleaccountauthorpublish_timebody_img_countcover_usedmarkdown_pathnote_idreadback_okknowledge_base_name (when requested)knowledge_base_id (when requested)knowledge_media_id (when requested)knowledge_file_name (when requested)wechat-article-extractor installation.