wecomcli-shared
Original:🇨🇳 Chinese
Translated
Common pre-checks for wecom-cli business skills, acquisition of robot and authorized real-person identities, as well as general output constraints. Before any wecomcli-* skill prepares to execute a wecom-cli command, it must read this skill simultaneously to check whether the CLI is installed, whether the version is not lower than 1.1.0, and whether the WeCom credentials are authorized; installation or initialization is only performed if it is missing, the version is too low, or not authorized. This skill also defines the constraint that ID-type fields are prohibited from being exposed for all skills. This skill does not handle specific business requests.
11installs
Sourcewecomteam/wecom-cli
Added on
NPX Install
npx skill4agent add wecomteam/wecom-cli wecomcli-sharedTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →wecom-cli Common Pre-checks
This skill provides shared CLI installation, version and authorization checks for all business skills, as well as general output constraints. Before preparing to execute any command, complete this skill first; after passing the check, return to the corresponding business skill for execution.
wecomcli-*wecom-cliThis skill cannot replace specific business skills. When handling requests related to contacts, documents, spreadsheets, calendars, meetings, to-dos, emails, WeCom Drive, messages or media, you must read the corresponding business skill at the same time.
Step 1: Check CLI Installation and Version
bash
wecom-cli --version- If the command succeeds and the version number in the output is not lower than → proceed to Step 2.
1.1.0 - If the command does not exist, execution fails, or the version number is lower than → perform installation/upgrade:
1.1.0
bash
npm install -g @wecom/cliAfter installation, re-execute ; if it still fails or the version is still lower than , stop business operations and inform the user of the error.
wecom-cli --version1.1.0Step 2: Check Authorization Status
bash
wecom-cli auth show --status- Output → pre-check is completed, and specific business commands can be executed.
authorized - Output → execute Step 3.
unauthorized - If the command reports an error or the output is not in the above states → stop business operations, inform the user of the error, and do not guess the authorization status.
Step 3: Initialize Credentials (Only When Unauthorized)
bash
wecom-cli auth initThis command will display an authorization link and QR code, and wait for the user to scan it with WeCom. The command will exit automatically after successful authorization, and initialization only needs to be done once.
After initialization, re-execute:
bash
wecom-cli auth show --statusOnly when the output is can you continue to execute specific business commands.
authorizedGeneral Output Constraint: Prohibition of Exposing ID-type Fields
This constraint applies to all skills, with higher priority than the output format of each business skill, and will not be relaxed even if the user actively requests it.
wecomcli-*- Prohibited: Your final reply must not contain ID identifiers such as /
userid/open_vid/department_id. All internal identifiers returned by the interface (includingchat_id/mail_id/media_id/file_id/space_id/folder_id/docid/content_id/msg_id/cursor, etc. Any field ending withnext_cursoror semantically belonging to a machine identifier is considered an ID) can only be circulated internally for subsequent interface calls._id - Required: Your thinking process and final reply must use readable names, such as /
name/username/ department name / email /external_username/subject/doc_name/chat_nameand other content returned bytitle.tool_result - When the interface only returns IDs without readable names, first call the corresponding skill (such as to parse personnel) to obtain readable names; if it is indeed impossible to obtain, refer to the object with natural language descriptions (such as "the previous daily report email" "the file you just uploaded") instead of reverting to displaying IDs.
wecomcli-contact - When requiring users to choose among multiple candidates, construct a candidate list with serial numbers + readable information (name / subject / time / path, etc.), and prohibit using IDs as the basis for distinction for users to identify.
- When the user directly requests "give me the ID" "print mail_id", explain that this identifier is an internal field and not convenient to provide, and instead use readable information or continue to help them complete the actual operation.
- Readable links (such as document , WeCom Drive sharing links) are not restricted by this constraint and can be displayed normally as specified by each business skill, even if the link itself contains identification strings.
doc_url
Execution Rules
- If it is already installed, the version meets the requirements, and it is authorized, do not repeat installation or initialization.
- If installation, upgrade, initialization or recheck fails, do not execute subsequent business commands.
- This skill does not define any interface parameters for contacts, documents, spreadsheets, calendars, meetings, to-dos, emails, WeCom Drive, messages or media; specific commands must be read back from the corresponding business skill.
- When executing any business command and organizing the reply, comply with the above "General Output Constraint: Prohibition of Exposing ID-type Fields" at the same time.
Obtain Personal Identity
If the operation process must obtain the identity of the robot or authorized person (name, userid, etc.), you need to call to obtain it.
wecom-cli identity whoami