
Wecomcli Doc
Create or edit WeCom (企业微信) docs and smart spreadsheets from an agent via documented create_doc and edit_doc_content APIs.
Overview
wecomcli-doc is an agent skill for the Build phase that creates and overwrites WeCom documents and smart spreadsheets using create_doc and edit_doc_content API schemas.
Install
npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-docWhat is this skill?
- create_doc supports doc_type 3 (document) and 10 (smart spreadsheet) with optional space and admin fields
- docid returned only at creation time—readme stresses saving it immediately
- Smart tables (type 10) ship with a default sub-sheet queryable via smartsheet_get_sheet without extra add_sheet
- edit_doc_content overwrites document body using docid or url
- JSON inputSchema fragments document errcode/errmsg response shape for agents
- doc_type enum: 3 document, 10 smart spreadsheet
- doc_name max 255 characters before truncation
- docid returned only at create time
Adoption & trust: 9.5k installs on skills.sh; 2.2k GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+200% hot-view momentum).
What problem does it solve?
You need your agent to spin up or update 企业微信 docs programmatically but lack a concise, tool-ready API contract in the repo.
Who is it for?
Indie builders and micro-teams integrating WeCom document automation into agents or internal SaaS with existing WeCom app credentials.
Skip if: Teams outside WeCom, users who only need Google Docs or Notion APIs, or workflows that require rich incremental edits instead of full content overwrite.
When should I use this skill?
User or workflow needs to create WeCom docs/spreadsheets or overwrite document content via wecom-cli create_doc or edit_doc_content.
What do I get? / Deliverables
The agent calls create_doc or edit_doc_content with valid doc_type and identifiers and you get a doc URL plus a saved docid when creating new files.
- New doc URL and docid from create_doc
- Updated document content after edit_doc_content
Recommended Skills
Journey fit
WeCom document automation is backend integration work while wiring team workflows into your product or internal ops stack. Agent-tooling and enterprise API calls fit Build integrations—returning docid, URLs, and structured doc types rather than launch or growth tactics.
How it compares
WeCom-specific doc API skill—not a cross-platform office MCP or markdown publishing pipeline.
Common Questions / FAQ
Who is wecomcli-doc for?
Developers using Claude Code, Cursor, or Codex who deploy on 企业微信 and want agent-callable create and edit document operations.
When should I use wecomcli-doc?
During Build integrations when provisioning project docs, weekly reports (项目周报), or smart tables tied to your WeCom space and directory structure.
Is wecomcli-doc safe to install?
It describes APIs that use enterprise credentials and network calls; review the Security Audits panel on this page and scope WeCom tokens and doc admin permissions carefully.
SKILL.md
READMESKILL.md - Wecomcli Doc
# 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" }, "content_type": { "description": "内容类型格式。1:markdown", "enum": [1], "title": "Content Type", "type": "integer" } }, "oneOf": [ { "required": ["docid", "content", "content_type"] }, { "required": ["url", "content", "content_type"] } ], "title": "edit_doc_contentArguments", "type": "object" } } ``` ## 请求示例 ```json { "docid": "DOCID", "content": "# 标题\n\n正文内容", "content_type": 1 } ``` ## 响应示例 ```json { "errcode": 0, "errmsg": "ok" } ``` ## 注意事项 - `content_type` 当前仅支持 `1`(Markdown 格式) - 此操作为**覆写**,会替换文档全部内容 - 建议先调用 `get_doc_content` 了解当前内容再编辑 # get_doc_content API 获取企业微信文档、表格的完整内容数据,以 Markdown 格式返回。该接口采用异步轮询机制:首次调用无需传 task_id,接口会返回 task_id;若 task_done 为 false,需携带该 task_id 再次调用,直到 task_done 为 true 时返回完整内容。 ## 技能定义 ```json { "name": "get_doc_content", "description": "获取企业微信文档的完整内容数据,以 Markdown 格式返回。该接口采用异步轮询机制:首次调用无需传 task_id,接口会返回 task_id;若 task_done 为 false,需携带该 task_id 再次调用,直到 task_done 为 true 时返回完整内容。", "inputSchema": { "properties": { "docid": { "description": "文档的 docid,与 url 二选一传入", "title": "Doc ID", "type": "string" }, "url": { "description": "文档的访问链接,与 docid 二选一传入", "title": "URL", "type": "string" }, "type": { "description": "内容返回格式。2: Markdown 格式", "enum": [2], "title": "Type", "type": "integer" }, "task_id": { "description": "任务 ID,用于异步轮询。初次调用时不填,后续轮询时填写上次返回的 task_id", "title": "Task ID", "type": "string" } }, "oneOf": [ { "required": ["docid", "type"] }, { "required": ["url", "type"] } ], "title": "get_doc_contentArguments", "type": "object" } } ``` ## 参数说明 | 参数 | 类型 | 必填 | 说明 | |---|---|---|---| | docid | string | 与 url 二选一 | 文档的 docid | | url | string | 与 docid 二选一 | 文档的访问链接 | | type | integer | 是 | 内容返回格式,固定传 `2`(