wecomcli-smartpage
WeCom Smart Document (formerly known as Smart Homepage, smartpage) management skill. Provides capabilities for creating Smart Documents (publishing local Markdown files as Smart Documents) and exporting content (asynchronously exporting to Markdown). Applicable scenarios: (1) Create one or more local Markdown files as Smart Documents (2) Asynchronously export Smart Document content to Markdown. Supports locating documents via docid or document URL. This skill is triggered when the user explicitly mentions "Smart Document" or "Smart Homepage", or when the link is in the format `https://doc.weixin.qq.com/smartpage/xxx`. Note: For regular documents (`/doc/*`), use `wecomcli-doc`; for online spreadsheets (`/sheet/*`), use `wecomcli-sheet`; for smart spreadsheets (`/smartsheet/*`), use `wecomcli-smartsheet`.
NPX Install
npx skill4agent add wecomteam/wecom-cli wecomcli-smartpageTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →WeCom Smart Document Management
is a command-line program provided by WeCom, and all operations are completed by executing thewecom-clicommand.wecom-cli
/smartpage/*Calling Method
wecom-clidocwecom-cli doc <tool_name> '<json_params>'Return Format Description
| Field | Type | Description |
|---|---|---|
| integer | Return code, |
| string | Error message, |
errcode0errcodeerrmsgSpecial Error Codes
| errcode | errmsg | Meaning | Handling Method |
|---|---|---|---|
| | The document category does not match the called interface | Confirm that the target URL is |
Interface Details
Create Smart Document
docidurlSpecial Syntax: This command must use(with the+smartpage_createprefix), the plus sign cannot be omitted; this+only applies to this command, do not generalize it to other+subcommands.doc
wecom-cli doc +smartpage_create '<JSON parameters>'| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| string | No | — | Smart Document title |
| array | Yes | — | List of subpages |
| string | No | — | Subpage title |
| int | No | 1 | Content type: 1-Markdown, 0-Text (plain text) |
| string | No | — | Local file path corresponding to the subpage content |
- must match the actual content of the file:
content_typefiles or content containing Markdown syntax must pass.md, only plain text should pass1.0should be used in most scenarios.1 - is only returned during creation, please save it properly.
docid - The size of each subpage's Markdown file must not exceed 10MB, otherwise creation will fail; if the file is too large, split it into multiple subpages before creation.
- Smart Documents also support extended syntax such as background blocks () and columns (
<card>), see references/smartpage-create.md for details.<grid>
Export Smart Document Content
smartpage_export_tasktask_idsmartpage_get_export_resulttask_donetruecontent# Via docid
wecom-cli doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}'
# Via url
wecom-cli doc smartpage_export_task '{"url": "https://doc.weixin.qq.com/smartpage/xxx", "content_type": 1}'| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| string | Either | — | docid of the Smart Document |
| string | Either | — | Access link of the Smart Document |
| int | Yes | — | Export content format, currently only supports |
wecom-cli doc smartpage_get_export_result '{"task_id": "TASK_ID"}'| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| string | Yes | — | Task ID returned by |
- After obtaining in the first step, call the second step with it; if
task_idistask_done, continue polling untilfalseistask_done, and the returnedtruefield is the complete Markdown content.content
Cross-Skill Dependencies
| Dependent Skill | Typical Collaboration Scenario | Data Flow |
|---|---|---|
| User requests to send the Smart Document link to someone/some group | This skill returns |