WeCom Disk
Before executing any
command, you must first read and complete the public pre-checks in the
skill.
This is a resource-type skill responsible for listing, searching, reading information, uploading, downloading, renaming files, and creating new folders in WeCom Disk.
Scope of Application
Applicable Scenarios
- List recently viewed files in WeCom Disk
- Search for files or folders in WeCom Disk by keywords/type/creator/shared space
- Read basic information of WeCom Disk files
- Upload local files to a specified folder in WeCom Disk
- Download WeCom Disk files to local device
- Rename WeCom Disk files
- Create new folders in WeCom Disk
Non-Applicable Scenarios
- Moving WeCom Disk files or folders → Inform users that this function is not supported yet, and suggest manual operation via the WeCom client
- Deleting/copying WeCom Disk files → Inform users that this function is not supported yet, and suggest manual operation via the WeCom client
- Deleting/renaming WeCom Disk folders (), adjusting directory tree structure → Inform users that this function is not supported yet, and suggest manual operation via the WeCom client
- Creating/deleting shared spaces (), modifying space members and settings → Inform users that this function is not supported yet, and suggest manual operation via the WeCom client
- Granting a robot permission to a space / adding a robot to shared space members → WeCom Disk does not have this function, which cannot be achieved through any channel (including the client). Prohibit making such suggestions to users, and do not guide users to "contact the space administrator to authorize the robot"
- Modifying file sharing permissions, generating sharing links, revoking sharing, setting access passwords/validity periods → Inform users that this function is not supported yet, and suggest manual operation via the WeCom client
- WeCom Disk file version management (viewing historical versions, restoring old versions, comparing versions) → Inform users that this function is not supported yet
- Undoing/modifying uploaded files (overwrite upload, instant upload, resumable upload) → Inform users that this function is not supported yet; if replacement is needed, re-upload a new file via the "upload file" process
- Parsing the content of WeCom Disk files (text extraction, OCR, image-based Q&A, PDF/Word/Excel parsing, etc.) → This skill is responsible for downloading the file to local device and returning the
- Transcribing video/audio files or generating subtitles → Inform users that this function is not supported yet
- Continuously monitoring WeCom Disk changes / real-time notifications for new files → Active monitoring is not possible; do not promise "to notify you when new files arrive", please ask users to initiate a query again later
Routing Decision (This Skill / Other Skills)
| User Input Signal | Route To |
|---|
| Explicitly mentions "Disk / Cloud Drive / disk / Wecom Cloud Drive" | This skill |
Provides a link in the format https://drive.weixin.qq.com/s?k=...
(WeCom Disk sharing URL) | This skill (used as the parameter for / ) |
Provides a link in the format https://doc.weixin.qq.com/<doc|sheet|smartsheet|smartpage>/...
| Corresponding / / / |
| Reading/writing content of online documents / / / | Corresponding document skills as above |
| Modifying document permissions / adding members / renaming documents (for doc/sheet/smartsheet/smartpage) | |
Note:
/
are domains for online documents, while
is the domain for WeCom Disk. Do not confuse them.
File Type Enumeration
(online document),
(online spreadsheet),
(online slides),
(collection form),
(mind map),
(flowchart),
(smart spreadsheet),
(smart homepage),
(report),
(PDF),
(offline Word),
(offline Excel),
(offline PPT),
(offline PDF),
(image),
(video and audio),
(design draft). Keep the original names for online documents, and use the
prefix to distinguish offline files. Tencent Documents are not within the scope of this skill; route to corresponding document skills according to the Routing Decision table.
Search both online and offline when ambiguous: When users mention "Excel", "Word", "PPT", "PDF", etc. without specifying online or offline, pass both online and offline versions in
(e.g.,
["sheet", "offline_excel"]
) to avoid omissions. For other types, pass the corresponding enumeration names as they are.
Interface Details
List Files
Retrieve the list of recently viewed files in the user's WeCom Disk, supporting pagination.
Command
bash
wecom-cli disk files list --json '{"limit": 10}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | No | | Pagination cursor; if not passed or passed as an empty string, retrieve the first page of data |
| number | No | 10 | Maximum number of items returned per page; if not passed, use the service default value, maximum 100 |
Return
| Field | Type | Description |
|---|
| boolean | Whether there is more data; use to retrieve the next page when |
| string | Cursor for the next page |
| string | File ID or folder ID |
| string | File name |
| string | Document ID, only meaningful for / / / / / / |
| string | File type: / / / / / / / / / / / |
| number | File size (bytes); only meaningful for |
| string | Creator userid |
| string | ID of the associated shared space |
| string | Name of the shared space |
| string | ID of the parent folder |
| string | Name of the parent folder |
| string | Creation time, in format |
| string | Last update time, in format |
| string | Full path of the file |
| string | Document opening link, only filled for online document types ( / / / / / / ) |
Search Files
Search for WeCom Disk files, folders, or shared spaces by conditions such as keywords, file type, creator, shared space, and sorting.
Command
bash
wecom-cli disk files search --json '{"keywords": ["Quarterly Report"], "search_type": "file", "sort_by": "modify_time", "sort_order": "desc", "limit": 10}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string[] | Optional | — | Array of literal keywords, length 0~20 (OR relationship); select at least one from / / / |
| string[] | Optional | — | List of restricted creator s, length 0~50; no filtering if not passed; select at least one from / / / ; resolve user names to s via |
| string | Optional | | Enumeration of query scope: / (files) / (folders) / (shared spaces); select at least one from / / / |
| string[] | Optional | — | Restricted file types, length 0~10; optional values include / / / / / / / / / / / / / / / / (keep original names for online documents, use prefix for offline documents); do not pass values outside the enumeration; select at least one from / / / |
| string[] | No | — | Keywords restricting the space name, length 0~10, OR relationship; matching spaces will be used as the search scope; no space restriction if not passed; additional filtering condition, cannot trigger search alone |
| string | No | | Sorting method: / / ; do not pass values outside the enumeration |
| string | No | | Sorting direction: / ; only required when or |
| string | No | — | Incremental key for batch retrieval, returned from the previous request; start from the beginning if not passed |
| number | No | 10 | Maximum number of items returned per page, maximum 100 |
Return
| Field | Type | Description |
|---|
| boolean | Whether there is more data; use to retrieve the next page when |
| string | Cursor for the next page |
| string | WeCom Disk file ID / folder ID / space ID |
| string | Type of the matched item: / / / / / / / / / / / |
| string | Name (file name / folder name / space name) |
| number | File size (bytes), only meaningful for |
| string | Creator userid |
| string | ID of the associated shared space |
| string | Name of the shared space |
| string | ID of the parent folder; equals when located in the root directory of the space |
| string | Name of the parent folder |
| string | Full path of the file; when and are the same, they may be at the same level instead of parent-child relationship, use to determine the hierarchy |
| string | Creation time, in format |
| string | Last update time, in format |
| string | Document ID, only meaningful for / / / / / / |
| string | Document opening link, only filled for online document types; can be directly sent to users/groups as an online document sharing link without additional processing |
| string[] | Highlighted summary fragments of the title matching the keywords; empty when |
| string[] | Highlighted summary fragments of the content matching the keywords; empty when |
Critical Constraint for Handling Online Document Matches: If the
returned by the search is
/
/
/
/
/
/
/
/
, these are
online collaborative documents (content stored in the cloud, not binary files).
Prohibit using
(will fail or return an empty file), and it is not suitable to use
. For
/
/
/
, there are corresponding downstream skills to read the content; refer to the Cross-Skill Dependencies table at the end for routing;
currently, no downstream skills or CLI can read the content of / / / / . When users want to view the content of these types, directly inform them that content reading is not supported yet, and guide them to open the
in the WeCom client. Only when
can the
be used as
to call
to get the local file.
Usage Rules
-
Trigger Condition (Authoritative Description):
Select at least one from
/
/
/
;
is only an additional filtering condition and
cannot trigger search alone. If all four are empty, ask the user for clarification in natural language before initiating the search. If the user only provides space keywords (e.g., "search in XX space"), ask for specific search content in natural language.
-
Inform Truthfully if No Results Found: If no results are found after adjusting keywords/types multiple times, stop searching and inform the user truthfully whether "no files found" or "no such space found"; do not repeatedly change keywords to force a search.
-
Optional Parameter Passing Strategy: Default to not passing, only pass when explicitly specified by the user:
| Parameter | When Not to Pass (Backend Default) | When to Pass (Explicitly Expressed by User) |
|---|
| User says "search for xxx / find xxx / files / materials" without specifying the object type → Backend uses | Explicitly says "only search folders / directories"→; "only search shared spaces / team spaces"→; "only files, no folders"→ |
| User has no sorting preference → Backend uses | "Latest / recently modified / earliest"→; "Largest / smallest"→ |
| Not required when | Use for new→old and for old→new when passing / ; default to if not passed |
| User says "documents / files / materials / resources" or business concepts (contracts / reports / meeting minutes) → No filtering, rely on | User explicitly mentions specific formats (PPT / Excel / PDF / images / smart spreadsheets, etc.), add the corresponding enumerations to the array |
| No space restriction | User says "search in XX space / XX team disk" → Fill in space name keywords (this interface does not accept ) |
-
Do Not Mix File Type Suffixes in : When users say "search for Excel reports" or "find PPT plans", pass the file type suffixes (Excel/PPT/Word/PDF) to
for filtering, and only keep business keywords in
(e.g., "reports" / "plans"). Example: "Excel report" →
+
file_types:["sheet","offline_excel"]
.
-
Spoken Language → Enumeration Mapping for : Refer to the "User Spoken Expression" column in the File Type Enumeration table above.
-
Pagination Continuation: Use
as the
for the next call when
; pass an empty string for
in the first call.
-
Time Range Filtering Not Supported: This interface does not have
/
fields; do not forge them. If users provide time ranges such as "last 3 days / last week / this month", first retrieve data with
,
, then perform secondary filtering on the client side based on
.
-
Result Summary Order Follows Sorting Direction: When
(default, new→old), summarize results for users from newest to oldest, do not reverse the order.
Read File Information
Read basic file information based on
or WeCom Disk file URL.
Command
bash
wecom-cli disk files get --json '{"file_id": "FILE_ID"}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | Either | — | File ID; choose either or ; takes priority if both are provided |
| string | Either | — | WeCom Disk file sharing URL (in the format https://drive.weixin.qq.com/s?k=AJEAIQdfAAoN4N17GM
); choose either or |
Return
| Field | Type | Description |
|---|
| string | File ID or folder ID |
| string | File name |
| string | Document ID, only meaningful for / / / / / / |
| string | File type: / / / / / / / / / / / |
| number | File size (bytes); only meaningful for |
| string | Creator userid |
| string | ID of the associated shared space |
| string | Name of the shared space |
| string | ID of the parent folder, may be the folder or space |
| string | Name of the parent folder |
| string | Creation time, in format |
| string | Last update time, in format |
| string | Full path of the file |
| string | Document opening link, only filled for online document types ( / / / / / / ) |
Upload File
Upload local files to a specified directory in WeCom Disk. Two upload methods are supported:
A. Media Method directly pass
when
is available in the context;
B. Local Path Method directly pass
. Choose one of the two methods.
Command
bash
wecom-cli disk files upload --json '{"folder_id": "FOLDER_ID", "file_name": "Quarterly Report.pptx", "file_content_media": "mcxxx"}'
Or use the local file path directly:
bash
wecom-cli disk files upload --json '{"folder_id": "FOLDER_ID", "file_name": "Quarterly Report.pptx", "file_path": "/tmp/Quarterly Report.pptx"}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | No | — | Target folder ID; can pass folder or space ; upload to the default space if not passed |
| string | Conditionally Required | — | File name (including extension); length 1~255; prohibited characters: ; automatically extracted from the path if is passed and is not; required if is passed |
| string | Either | — | of the file material (prefix ), do not construct or guess it; choose either or |
| string | Either | — | Absolute path of the local file; choose either or , one must be provided |
Return
| Field | Type | Description |
|---|
| string | ID of the uploaded file |
| string | File name |
| string | Document ID, only meaningful for / / / / / / |
| string | File type |
| number | File size (bytes); only meaningful for |
| string | Creator userid |
| string | ID of the associated shared space |
| string | Name of the shared space |
| string | ID of the parent folder |
| string | Name of the parent folder |
| string | Creation time |
| string | Last update time |
| string | Full path of the file |
| string | Document opening link, only filled for online document types |
Usage Rules
There are two upload paths, choose one based on the material form available to the user:
Applicable scenario: A valid
is
already available in the context (returned by a preceding skill or directly provided by the user), no need to go through
again.
- Confirm : If not provided by the user, do not pass it to upload to the default space
- Directly fill the existing into and call
Path B: Local Path Method ()
- Can be used directly when the user explicitly provides a local file path (or a preceding skill returns a local , such as the path after downloading via )
- Confirm : If not provided by the user, do not pass it to upload to the default space
- Directly fill the local path into and call (no need to go through )
Mutually Exclusive: Only one of
and
can be selected, cannot pass both or neither. If the user provides neither
nor local file path, ask for clarification in natural language; do not fabricate a file through search/illusion.
Download File
Download WeCom Disk files to local device and return the local file path.
Command
bash
wecom-cli disk files download --json '{"file_id": "FILE_ID"}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | Either | — | ID of the file to download, choose either or ; must pass if is not passed |
| string | Either | — | File URL, choose either or ; must pass if is not passed |
Return
| Field | Type | Description |
|---|
| string | Local file path returned after the framework saves the file |
| string | File content (returned as a string if the content is not long) |
| number | File size, in bytes |
Usage Rules
- Only Applicable to Offline Binary Files: Only files with (corresponding to / / / / / / in ) can be downloaded to local device via this interface.
- Never Use Download for Online Documents: If the returned by the search is / / / / / / / / , prohibit passing their or as / to this interface, which will fail or return an invalid file. For / / / , use the to route to the corresponding downstream document skills according to the Cross-Skill Dependencies table at the end to read content; currently, no downstream skills can read the content of / / / / , directly inform users that this is not supported yet, and guide them to open the in the WeCom client.
- URL Format Identification: Only
https://drive.weixin.qq.com/s?k=...
is a WeCom Disk file sharing URL, which can be used as the parameter; https://doc.weixin.qq.com/...
/ https://page.weixin.qq.com/...
are online document links, prohibited from being passed to this interface.
Rename File
Modify the name of a WeCom Disk file.
Command
bash
wecom-cli disk files rename --json '{"file_id": "FILE_ID", "new_name": "New File Name.xlsx"}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | Yes | — | File ID (required) |
| string | Yes | — | New file name (required, including extension); length 1~255; prohibited characters: |
Return
| Field | Type | Description |
|---|
| string | Operation result, when successful |
This interface does not return a
object; to retrieve the latest metadata, call "Read File Information" again.
Create Folder
Create a new folder in a specified directory of WeCom Disk.
Command
bash
wecom-cli disk folders create --json '{"folder_id": "FOLDER_ID", "folder_name": "New Folder"}'
Parameters
| Field | Type | Required | Default Value | Description |
|---|
| string | Optional | — | ID of the target parent folder; can pass folder or space , create in the root directory of the personal space if not passed |
| string | Yes | — | Folder name |
Return
| Field | Type | Description |
|---|
| string | Folder ID |
| string | Folder name |
| string | Document ID, only meaningful for online document types |
| string | File type: |
| number | File size (bytes); only meaningful for |
| string | Creator userid |
| string | ID of the associated shared space |
| string | Name of the space; returned only when having permission to the space, appears together with |
| string | ID of the parent folder, may be the folder or space |
| string | Name of the parent folder; returned only when having permission to the parent folder, appears together with |
| string | Creation time, in format |
| string | Last update time, in format |
| string | Full path of the folder |
| string | Document opening link, only filled for online document types |
Key Constraints
- File Name is Not : When the user provides a file name/keyword, first use to get the ; do not directly use the file name as .
- Upload Material Source Constraint: Choose one of and for , one must be provided, cannot pass both. must be a valid (prefix ), do not construct or guess it; can only be a real local file path explicitly provided by the user or returned by a preceding skill, do not fabricate it. If neither is available, ask for clarification in natural language; do not fabricate a file through search/illusion.
- Search Must Be Bounded: Adjust conditions once if necessary after a set of searches; stop and inform users "no results found" after 2~3 rounds of unsuccessful searches, and ask users to provide more accurate keywords/file types/creators; do not keep changing keywords to force a search.
- Convey CLI Errors as They Are: If the command returns a clear error code, inform users truthfully and provide alternative suggestions; do not bypass the CLI using curl/python or other general methods to force completion.
- Do Not Expose Internal IDs: Internal IDs such as / / / / are only used for subsequent interface calls; prohibit directly displaying them to users; if need to display creator information for , first resolve it to a name via .
- Ask for Clarification When Spaces/Folders Have the Same Name: If the search returns multiple spaces or folders with the same name, ask users to select the specific target in natural language; do not randomly select the first one or guess.
- Ask for Clarification When Parameters Are Missing / Multiple Candidates / Intent is Unclear: Ask users to clarify in natural language, do not guess.
Result Display Specifications
Strictly follow these rules when displaying
/
results to users:
- Display item by item using markdown unordered lists, prohibit using tables — display a maximum of 10 items.
- First line of each item: If the returned is not empty (online document), write it as a markdown link in the format ; if is empty (offline files, folders, spaces, etc.), write it as , do not fabricate links. Secondary lines can display / / readable (e.g., ), separate fields with or spaces.
- Prohibit directly displaying raw JSON, internal IDs such as / / / .
Cross-Skill Dependencies
| Dependent Skill | Trigger Condition | Purpose of Using the Dependent Skill |
|---|
| Search matches / , and user wants to "read the content" | Pass the returned to wecom-cli doc 'contents get'
to read the content (except when starts with / , route to ) |
| Search matches (online spreadsheet), and user wants to read the content | Pass the returned to the corresponding reading interface of |
| Search matches (smart spreadsheet), and user wants to read the content | Pass the returned to the corresponding reading interface of |
| Search matches (smart homepage), or with starting with / , and user wants to read the content | Pass the returned to the corresponding reading interface of |
| Matched item is word/sheet/smartsheet/smartpage and user requests to modify document permissions / add members / rename the document | Hand over to ; renaming for other online/offline types (file/collect/mind/flow/journal/ppt/pdf, etc.) uses the function of this skill; renaming (folders) is not supported (see Scope of Application), inform users that this is not supported yet and suggest manual operation via the WeCom client |
When parameters are missing / multiple candidates / intent is unclear, ask users to clarify in natural language.