
wecomcli-lookup-contact
通讯录成员查询技能,获取当前用户可见范围内的通讯录成员,支持按姓名/别名本地筛选匹配。返回 userid、姓名和别名。⚠️ 仅返回当前用户有权限查看的成员,非全量成员。
- Installs
- 2.4K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-lookup-contact- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads wecomcli-lookup-contact automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
通讯录成员查询技能
wecom-cli是企业微信提供的命令行程序,所有操作通过执行wecom-cli命令完成。
获取当前用户可见范围内的通讯录成员,并在本地按姓名/别名进行筛选匹配。
操作
1. 获取全量通讯录成员
获取当前用户可见范围内的所有企业成员信息:
调用示例:
wecom-cli contact get_userlist '{}'
返回格式:
{
"errcode": 0,
"errmsg": "ok",
"userlist": [
{
"userid": "zhangsan",
"name": "张三",
"alias": "Sam"
},
{
"userid": "lisi",
"name": "李四",
"alias": ""
}
]
}
返回字段说明:
| 字段 | 类型 | 说明 |
|---|---|---|
errcode | integer | 返回码,0 表示成功 |
errmsg | string | 错误信息 |
userlist | array | 用户列表 |
userlist[].userid | string | 用户唯一 ID |
userlist[].name | string | 用户姓名 |
userlist[].alias | string | 用户别名,可能为空 |
2. 按姓名/别名搜索人员
get_userlist 返回全量成员后,在本地对结果进行筛选匹配:
- 精确匹配:
name或alias与关键词完全一致,直接使用 - 模糊匹配:
name或alias包含关键词,返回所有匹配结果 - 无结果:告知用户未找到对应人员
搜索示例:
用户问:"帮我找一下张三是谁?"
- 调用
get_userlist获取全量成员 - 在
userlist中筛选name或alias包含"张三"的成员 - 返回匹配结果
注意事项
-
get_userlist返回的是当前用户可见范围内的成员,需经过可见性规则过滤,不一定是全公司所有人员;返回字段仅包含userid、name(姓名)和alias(别名) -
⚠️ 超过 10 人时接口将报错:若
userlist返回成员数量超过 10 人,视为异常,应立即停止处理并向用户说明:当前通讯录可见成员数量超过了本技能支持的上限(10 人)。 本技能仅适用于可见范围较小的场景,无法在大范围通讯录中使用。 建议缩小可见范围后重试,或通过其他方式查询目标人员。
-
userid是用户的唯一标识,在需要传递用户 ID 给其他接口时使用此字段 -
alias字段可能为空字符串,搜索时需做空值判断 -
若搜索结果有多个同名人员,需将所有候选人展示给用户选择,不得自行决定
-
若
errcode不为0,说明接口调用失败,需告知用户错误信息(errmsg)
典型工作流
工作流 1:查询人员信息
用户问:"帮我查一下 Sam 是谁?"
wecom-cli contact get_userlist '{}'
获取全量成员列表
- 在结果中筛选
alias为Sam或name包含Sam的成员 - 若找到唯一匹配,直接展示结果:
📇 找到成员:
- 姓名:张三
- 别名:Sam
- 用户ID:zhangsan
- 若找到多个匹配,展示候选列表请用户确认:
🔍 找到多个匹配成员,请确认您要查询的是哪位:
1. 张三(别名:Sam,ID:zhangsan)
2. 张三丰(别名:Sam2,ID:zhangsan2)
请问您要查询的是哪一位?
工作流 2:为其他功能提供 userid 转换
用户问:"帮我发消息给张三"
wecom-cli contact get_userlist '{}'
获取全量成员
- 筛选
name为"张三"的成员,确认userid - 将
userid传递给消息发送接口
工作流 3:批量查询多个人员
用户问:"帮我查一下张三和李四分别是谁?"
wecom-cli contact get_userlist '{}'
获取全量成员列表
- 分别筛选"张三"和"李四"的匹配结果
- 汇总后一并展示
注意:只需调用一次
get_userlist,在本地对结果进行多次筛选,避免重复调用接口。
快速参考
接口说明
| 接口 | 用途 | 输入 | 返回 |
|---|---|---|---|
get_userlist | 获取可见范围内全量通讯录成员 | 无 | 用户列表(userid、name、alias) |
本地筛选策略
| 场景 | 策略 |
|---|---|
| 精确匹配(name 或 alias 完全一致) | 直接使用,无需用户确认 |
| 模糊匹配(name 或 alias 包含关键词),唯一结果 | 直接使用,向用户展示结果 |
| 模糊匹配,多个结果 | 展示候选列表,请用户选择 |
| 无匹配结果 | 告知用户未找到对应人员 |
FAQ
What does the wecomcli-lookup-contact skill do?
通讯录成员查询技能,获取当前用户可见范围内的通讯录成员,支持按姓名/别名本地筛选匹配。返回 userid、姓名和别名。⚠️ 仅返回当前用户有权限查看的成员,非全量成员。
How do I install wecomcli-lookup-contact?
Run npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-lookup-contact in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/wecomcli-lookup-contact/ (personal) or .claude/skills/wecomcli-lookup-contact/ (project).
Which AI agents can use wecomcli-lookup-contact?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is wecomcli-lookup-contact safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains wecomcli-lookup-contact?
It is published by wecomteam in wecomteam/wecom-cli. It has 2,405 recorded installs.
More from wecomteam/wecom-cli
wecomcli-doc
wecomteam/wecom-cli
企业微信在线 doc 文档技能。能够新建 doc、导入本地 .doc/.docx/.txt 为 doc、读取 doc 内容、向 doc 追加或覆盖写入。仅当用户明确出现「doc」「docx」「word」「在线文档」「office 文档」等强类型词,或提供 https://doc.weixin.qq.com/doc/xxx 链接时才使用本技能。用户说"文档""新建文档""写文档""整理成文档""输出到文档"等未指定类型的泛化表达,一律使用 wecomcli-smartpage。
wecomcli-todo
wecomteam/wecom-cli
管理企业微信待办,支持创建、删除或退出、完成、查询和筛选,以及修改标题、描述、参与人名单和截止时间。
wecomcli-meeting
wecomteam/wecom-cli
企业微信会议管理。本技能负责『在线会议』——即含在线会议链接(含会议号/入会链接、可远程或视频参会)的会议的创建、查询、搜索、获取详情(含会议信息、纪要、待办)、查询会议转写原文(逐字发言记录)、更新、取消等全部操作;若用户要的是不含在线会议链接的『日程』(也涵盖纯线下面对面碰头),改用 wecomcli-calendar 技能。用户仅说'开会/约个会/某会/某会议'等、未明确要创建的是日程还是在线会议时,必须先读取本技能并按其中的消歧流程向用户追问确认后再处理,不可臆断直接创建。
wecomcli-contact
wecomteam/wecom-cli
使用 wecom-cli 按姓名、拼音、英文名或别名搜索企业微信通讯录中的人员,并查询匹配人员的 userid、部门和职务。适用于查找联系人、区分同名人员、获取用户 userid,以及列出全部同名人员。
wecomcli-smartsheet
wecomteam/wecom-cli
企业微信智能表格内容操作技能——专注于智能表格(smartsheet)的数据、结构与样式管理:读取表结构与记录、管理子表/字段/记录/视图/图表,以及修改行列样式(填色/高亮);记录新增或更新遇到 851003 / no authority 时通过 Webhook 兜底写入。触发条件:用户提到智能表格、企微表格、smartsheet 的内容操作或样式修改,或链接形如 https://doc.weixin.qq.com/smartsheet/s3xxx。企业微信表格分为「智能表格」和「在线表格」两种类型,本文档介绍的是智能表格的相关技能。智能表格包含子表(sheet)、视图(view)、字段/列(field),每条记录(record)以 recordid 作为主键,结构类似关系型数据库。当用户未明确说明使用「在线表格」时,一律默认使用功能更强大的智能表格(本技能)。
wecomcli-msg
wecomteam/wecom-cli
企业微信消息技能。提供会话列表查询、消息记录拉取(支持文本/图片/文件/语音/视频)、多媒体文件获取和文本消息发送能力。当用户需要"查看消息"、"看聊天记录"、"发消息给某人"、"最近有什么消息"、"给群里发消息"、"看看发了什么图片/文件"时触发。
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.