Home / Market / WeCom Shared setup

WeCom Shared setup

Public pre-checking of wecom-cli business skills, obtaining robot and authorized real person identities, and general output constraints. Before any wecomcli-* skill is prepared to execute the wecom-cli command for the first time, this skill must be read at the same time to check whether the CLI is installed, whether the version is not lower than 1.2.1, and whether the enterprise WeChat credentials are authorized; only perform installation or initialization if it is missing, the version is too lo

skill★ 339512387 dlskills.shMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: wecomcli-shared description: wecom-cli 业务技能的公共前置检查、获取机器人及授权真人身份,以及通用输出约束。任何 wecomcli-* 技能首次准备执行 wecom-cli 命令前,都必须同时读取本技能,检查 CLI 是否安装、版本是否不低于 1.2.1,以及企业微信凭证是否已授权;仅在缺失、版本过低或未授权时执行安装或初始化。本技能还定义所有技能通用的 ID 类字段禁止外露约束。本技能不处理具体业务请求。

---

wecom-cli 公共前置检查

本技能提供所有 wecomcli-* 业务技能共用的 CLI 安装、版本与授权检查,以及通用输出约束。首次准备执行任意 wecom-cli 命令前,先完成本技能;检查通过后,再回到对应业务技能执行。

> 本技能不能代替具体业务技能。处理联系人、文档、表格、日程、会议、待办、邮件、微盘、消息或媒体请求时,必须同时读取对应业务技能。

Step 1:检查 CLI 安装与版本

wecom-cli --version
npm install -g @wecom/cli

安装完成后重新执行 wecom-cli --version;仍失败或版本仍低于 1.2.1 时停止业务操作,并把错误告知用户。

Step 2:检查授权状态

wecom-cli auth show --status

Step 3:初始化凭证(仅未授权时)

wecom-cli auth init --noninteractive

该命令会展示授权链接和二维码,并等待用户使用企业微信扫码。授权成功后命令自动退出,仅需初始化一次。

初始化完成后重新执行:

wecom-cli auth show --status

仅当输出 authorized 时,才能继续执行具体业务命令。

通用输出约束:ID 类字段禁止外露

本约束对所有 wecomcli-* 技能生效,优先级高于各业务技能的输出格式,且不因用户主动索要而放宽。

执行规则

获取个人身份

如果操作流程必须获取机器人或授权人身份(姓名、userid等),需要调用 wecom-cli identity whoami 获取。