
Wecomcli Manage Doc
Create, export, and overwrite Enterprise WeChat (WeCom) docs and smart tables from your coding agent using the official wecom-cli.
Overview
wecomcli-manage-doc is an agent skill for the Build phase that creates, exports, and overwrites Enterprise WeChat documents and smart tables through wecom-cli.
Install
npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-manage-docWhat is this skill?
- Read full doc content as Markdown via async poll using docid or doc.weixin.qq.com URL
- Create WeCom documents (doc_type=3) or smart tables (doc_type=10) with returned url and docid
- Overwrite document body from Markdown through wecom-cli doc subcommands
- Uniform JSON responses with errcode/errmsg and one automatic retry on failure
- Requires wecom-cli binary; all operations use wecom-cli doc <tool> '<json>'
- Supports doc_type=3 documents and doc_type=10 smart tables
- get_doc_content uses async polling until task_done is true
Adoption & trust: 2.5k installs on skills.sh; 2.2k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent cannot read or update WeCom docs your team shares by URL unless you manually copy content or click through the WeCom UI.
Who is it for?
Indie builders and tiny teams on WeCom who want agent-driven doc sync for runbooks, weekly reports, and shared tables.
Skip if: Projects that do not use Enterprise WeChat, or anyone who cannot install and authenticate wecom-cli on the host.
When should I use this skill?
User needs to view WeCom doc content, create a new doc or smart table, or edit document body; triggered for Markdown export, create, or overwrite flows.
What do I get? / Deliverables
After the skill runs, the agent holds Markdown exports or updated doc bodies and can hand results into local specs, PR descriptions, or follow-on editing steps in your repo.
- Markdown document export
- New doc url and docid from create_doc
- Updated WeCom doc content from overwrite operations
Recommended Skills
Journey fit
Team-facing documentation lives in the build phase when specs, runbooks, and shared knowledge bases are created and maintained alongside the product. The skill maps directly to doc authoring and retrieval (Markdown export, create, full-body overwrite)—canonical docs work, not app code or deploy.
How it compares
Use this WeCom-specific CLI integration instead of generic browser scraping or unofficial WeChat APIs.
Common Questions / FAQ
Who is wecomcli-manage-doc for?
Solo and indie builders (and small squads) who document in Enterprise WeChat and want their AI coding agent to create, fetch, or overwrite those docs via wecom-cli.
When should I use wecomcli-manage-doc?
Use it in Build (docs) when you need Markdown export with polling, a new doc or smart table, or a full content overwrite; also when migrating spec text between WeCom and your git-backed docs.
Is wecomcli-manage-doc safe to install?
It shells out to wecom-cli against your org’s WeCom APIs—review the Security Audits panel on this Prism page and treat doc URLs and credentials as sensitive.
SKILL.md
READMESKILL.md - Wecomcli Manage Doc
# 企业微信文档管理 > `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 管理企业微信文档的创建、读取和编辑。所有接口支持通过 `docid` 或 `url` 二选一定位文档。 ## 调用方式 通过 `wecom-cli` 调用,品类为 `doc`: ```bash wecom-cli doc <tool_name> '<json_params>' ``` ## 返回格式说明 所有接口返回 JSON 对象,包含以下公共字段: | 字段 | 类型 | 说明 | |------|------|------| | `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 | | `errmsg` | string | 错误信息,成功时为 `"ok"` | 当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。 ### get_doc_content 获取文档完整内容数据,只能以 Markdown 格式返回。采用**异步轮询机制**:首次调用无需传 `task_id`,接口返回 `task_id`;若 `task_done` 为 false,需携带该 `task_id` 再次调用,直到 `task_done` 为 true 时返回完整内容。 - 首次调用(不传 task_id): ```bash wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2}' ``` - 轮询(携带上次返回的 task_id): ```bash wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2, "task_id": "xxx"}' ``` - 或通过 URL: ```bash wecom-cli doc get_doc_content '{"url": "https://doc.weixin.qq.com/doc/xxx", "type": 2}' ``` 参见 [API 详情](references/api-export-document.md)。 ### create_doc 新建文档(doc_type=3)或智能表格(doc_type=10)。创建成功返回 url 和 docid。 - ```bash wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "项目周报"}' ``` - ```bash wecom-cli doc create_doc '{"doc_type": 10, "doc_name": "任务跟踪表"}' ``` **注意**:docid 仅在创建时返回,需妥善保存。创建智能表格时默认包含一个子表,可通过 `smartsheet_get_sheet` 查询其 sheet_id。 参见 [API 详情](references/api-create-doc.md)。 ### edit_doc_content 用 Markdown 内容覆写文档正文。`content_type` 固定为 `1`(Markdown)。 ```bash wecom-cli doc edit_doc_content '{"docid": "DOCID", "content": "# 标题\n\n正文内容", "content_type": 1}' ``` 参见 [API 详情](references/api-edit-doc-content.md)。 ## 典型工作流 1. **读取文档** → ```bash wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2}' ``` ,若 `task_done` 为 false 则携带 `task_id` 继续轮询 2. **创建新文档** → ```bash wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "文档名"}' ``` ,保存返回的 docid 3. **编辑文档** → 先 get_doc_content 了解当前内容,再 edit_doc_content 覆写 # create_doc API 新建文档、表格或智能表格。创建成功后返回文档访问链接和 docid。 ## 技能定义 ```json { "name": "create_doc", "description": "新建文档、表格或智能表格。支持在指定空间和目录下创建,可设置文档管理员。创建成功后返回文档访问链接和 docid(docid 仅在创建时返回,需妥善保存)。注意:创建智能表格(doc_type=10)时,文档会默认包含一个子表,可通过 smartsheet_get_sheet 查询其 sheet_id,无需额外调用 smartsheet_add_sheet。", "inputSchema": { "properties": { "doc_type": { "description": "文档类型:3-文档,10-智能表格", "enum": [3, 10], "title": "Doc Type", "type": "integer" }, "doc_name": { "description": "文档名字,最多 255 个字符,超过会被截断", "title": "Doc Name", "type": "string" } }, "required": ["doc_type", "doc_name"], "title": "create_docArguments", "type": "object" } } ``` ## 请求示例 ```json { "doc_type": 3, "doc_name": "项目周报" } ``` ## 响应示例 ```json { "errcode": 0, "errmsg": "ok", "url": "https://doc.weixin.qq.com/doc/xxx", "docid": "DOCID" } ``` ## 注意事项 - `doc_type=3` 创建普通文档 - `doc_type=10` 创建智能表格,默认包含一个子表 - docid 仅在创建时返回,后续无法再获取,务必保存 # edit_doc_content API 编辑(覆写)文档内容。 ## 技能定义 ```json { "name": "edit_doc_content", "description": "编辑文档内容", "inputSchema": { "properties": { "docid": { "description": "文档 id,与 url 二选一传入", "title": "Docid", "type": "string" }, "url": { "description": "文档的访问链接,与 docid 二选一传入", "title": "URL", "type": "string" }, "content": { "description": "覆写的文档内容", "title": "Content", "type": "string" },