skillZs
LIVE SKILL TAGS
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
REAL INSTALL DATA
← back to all skills
wecomteam/wecom-cli14k installs

wecomcli-doc

企业微信文档(doc)管理技能。提供普通文档的新建、内容读取(Markdown)、内容覆写能力。适用场景:(1) 从零新建空白文档 (2) 以 Markdown 格式读取文档完整内容 (3) 用 Markdown 覆写文档正文。支持通过 docid 或文档 URL 定位文档。当用户提到「企业微信文档」「企微文档」「创建文档」「写个文档」,或链接形如 `https://doc.weixin.qq.com/doc/xxx` 时触发该技能。注意:在线表格(`/sheet/*`)请用 `wecomcli-sheet`;智能表格(`/smartsheet/*`)请用 `wecomcli-smartsheet`;智能文档/智能主页(`/smartpage/*`)请用 `wecomcli-smartpage`。

How do I install this agent skill?

npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-doc
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides capabilities to manage WeCom documents using the wecom-cli tool. A security concern exists in the smartpage_create tool, which allows uploading local files to the vendor's cloud service. This feature presents a risk of sensitive data exposure if an attacker tricks the agent into reading unintended local files through indirect prompt injection.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 2 issues

  • ZeroLeakspass

    Score: 93/100 · 2 sections analyzed

What does this agent skill do?

企业微信文档管理

wecom-cli 是企业微信提供的命令行程序,所有操作通过执行 wecom-cli 命令完成。

资源型技能,负责普通doc文档的新建、内容读取与覆写。文档接口支持通过 docidurl 二选一定位文档。

URL 品类识别与接口路由

企业微信文档有多种品类,URL 格式不同,所用的接口/技能也不同。请通过 URL 严格区分:

URL 模式品类处理方式
https://doc.weixin.qq.com/doc/*文档本 skill
https://doc.weixin.qq.com/sheet/*在线表格参阅 wecomcli-sheet skill
https://doc.weixin.qq.com/smartsheet/*智能表格参阅 wecomcli-smartsheet skill
https://doc.weixin.qq.com/smartpage/*智能文档(原名智能主页)参阅 wecomcli-smartpage skill

调用方式

通过 wecom-cli 调用,品类为 doc

wecom-cli doc <tool_name> '<json_params>'

返回格式说明

所有接口返回 JSON 对象,包含以下公共字段:

字段类型说明
errcodeinteger返回码,0 表示成功,非 0 表示失败
errmsgstring错误信息,成功时为 "ok"

errcode 不为 0 时,说明接口调用失败,可重试 1 次;若仍失败,将 errcodeerrmsg 展示给用户。

特殊错误码

errcodeerrmsg含义处理方式
851002incompatible doc type文档品类与所调用的接口不匹配根据文档 URL 重新确认品类(参见上方「URL 品类识别与接口路由」表),然后跳转到该品类对应的 skill

接口详述

新建文档

新建一篇空白企微文档(doc_type 固定为 3)。创建成功后返回 docidurl

命令

wecom-cli doc create_doc '<JSON 参数>'

参数

参数类型必填默认值说明
doc_typeint固定传 3(文档)
doc_namestring文档标题,最多 255 个字符,超过会被截断

返回

字段类型说明
docidstring新建文档的 docid,需妥善保存
urlstring新建文档的访问链接

注意事项

  • 本接口仅创建空白文档,不携带初始内容;如需写入正文,请在创建后调用 edit_doc_content

读取完整内容

获取文档的完整内容数据,统一以 Markdown 格式返回。采用异步轮询机制:首次调用无需传 task_id,接口返回 task_id;若 task_donefalse,需携带该 task_id 再次调用,直到 task_donetrue 时返回完整内容。

命令

wecom-cli doc get_doc_content '<JSON 参数>'

参数

字段类型必填默认值语义
docidstringurl 二选一文档的 docid
urlstringdocid 二选一文档的访问链接
typeint内容返回格式,固定传 2(Markdown)
task_idstring任务 ID,首次不传,轮询时填上次返回的 task_id

返回

字段类型说明
contentstringtask_donetrue 时返回的完整 Markdown 内容
task_idstring任务 ID,未完成时用于下次轮询
task_donebool任务是否完成,false 时需携带 task_id 继续轮询

使用规则

  • 首次调用不传 task_id;若 task_donefalse,记录 task_id 后携带其再次调用,直到 task_donetruecontent

覆写文档内容

用 Markdown 内容覆写文档正文。此操作为覆写,会替换文档全部内容。

命令

wecom-cli doc edit_doc_content '<JSON 参数>'

参数

字段类型必填默认值语义
docidstringurl 二选一文档的 docid
urlstringdocid 二选一文档的访问链接
contentstring覆写的文档内容(Markdown)
content_typeint内容类型,固定传 1(Markdown)

使用规则

  • 此操作为覆写,会替换文档全部内容;建议先用 get_doc_content 了解当前内容再编辑。
  • 成功判定:以返回的 errcode == 0 为准;非 0 时按「返回格式说明」处理(可重试 1 次)。

跨技能依赖

依赖技能典型协作场景数据流向
wecomcli-msg用户要求把文档链接发给某人/某群本 skill 新建后返回 urlwecomcli-msg 发送链接

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/wecomteam/wecom-cli/wecomcli-doc">View wecomcli-doc on skillZs</a>