Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
larksuite avatar

Lark Contact

  • 385k installs
  • 15.9k repo stars
  • Updated July 28, 2026
  • larksuite/cli

lark-contact is a Lark/Feishu CLI skill that searches and retrieves user contact information by name, email, or phone.

About

Search and retrieve Lark/Feishu user profiles by name, email, or phone. Agents can look up contact information and user identities for team operations.

  • Search users by name, email, or phone
  • Retrieve user profile information
  • Structured JSON output for agent operations

Lark Contact by the numbers

  • 384,987 all-time installs (skills.sh)
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

lark-contact capabilities & compatibility

Capabilities
user search · contact lookup · profile retrieval
Pricing
Free
npx skills add https://github.com/larksuite/cli --skill lark-contact

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs385k
repo stars15.9k
Security audit3 / 3 scanners passed
Last updatedJuly 28, 2026
Repositorylarksuite/cli

How do you resolve Lark employee names to open_id?

Look up and retrieve user contact information from Lark/Feishu in agent workflows.

Who is it for?

Developers automating Lark messaging or scheduling who must translate human names into open_ids and back within agent workflows.

Skip if: Org-chart traversal, department-wide employee listings, or hierarchy exports require native Lark OpenAPI instead of lark-contact.

When should I use this skill?

User provides a person name or email needing open_id resolution, or agent output contains open_ids needing human-readable names.

What you get

open_id values, employee profile records, and human-readable name or department mappings for downstream API calls.

  • open_id mappings
  • employee profile lookups

By the numbers

  • Published as version 1.0.0 with lark-cli binary requirement

Files

SKILL.mdMarkdownGitHub ↗

lark-contact

选哪个命令

user 身份和 bot 身份是两条完全独立的路径。先确定当前身份,再按下表选命令:

想做什么user 身份bot 身份
按姓名 / 邮箱搜员工拿 open_id`+search-user`不支持
已知 open_id 取他人资料+search-user --user-ids <id>`+get-user --user-id <id>`
查看自己+get-user+search-user --user-ids me不支持

已知 open_id 只是想发消息 / 排日程,不必经过 contact —— 直接 `lark-im` / `lark-calendar`

典型场景

# 找张三给他发消息:先搜,确认 open_id,再发
lark-cli contact +search-user --query "张三" --has-chatted --as user
lark-cli im +messages-send --user-id ou_xxx --text "Hi!"

搜索命中多条且后续操作有副作用(发消息、邀请会议等),把候选列给用户挑;不要擅自选第一条。

注意事项

  • 41050 / Permission denied 受当前身份的可见范围限制(两条命令都可能遇到)。换 bot 身份或让管理员调整可见范围,细节见 `lark-shared`
  • 跨租户用户(is_cross_tenant=true)多数业务字段为空字符串,这是飞书可见性规则,下游做空值兜底。
  • ID 类型:默认 open_id+get-user 可改 --user-id-type union_id|user_id;+search-user 只接受 open_id

不在本 skill 范围

  • 发消息 / 查聊天记录 → `lark-im`
  • 排日程 / 邀请会议 → `lark-calendar`
  • 部门树 / 按部门列员工 / 组织架构 ,通过 `lark-openapi-explorer` 查找原生接口

+get-user

按 ID 取用户基本信息(姓名等)。

# 取自己
lark-cli contact +get-user --as user

# bot 按 ID 取他人
lark-cli contact +get-user --user-id ou_xxx --as bot

# 按 union_id / user_id 取(默认 open_id)
lark-cli contact +get-user --user-id <id> --user-id-type union_id --as bot

注意事项

  • user 身份按 ID 取他人请用 `+search-user --user-ids <id>`,字段比本命令多(部门 / 邮箱 / 是否激活等)。本命令的 user 模式只回很少字段。
  • `--as bot` 必须传 `--user-id`:不传会直接报错(只有 user 身份能省略 --user-id 取自己)。

+search-user

仅 user 身份。需要 scope contact:user:search

适用范围

  • ✅ 已知姓名 / 邮箱 / 「聊过的人」想找出 open_id
  • ✅ 已知一组 open_id 想批量校验或回填字段(--user-ids,最多 100,支持 me)
  • ✅ 按聊天关系 / 在职状态 / 租户边界 / 企业邮箱等维度筛选员工
  • ❌ 已知 open_id 想拿完整 profile → 用 +get-user --as bot
  • ❌ 已知 open_id 想发消息 → 直接走 lark-im,不经过本命令

关键 flag

--query / --queries / --user-ids / bool filter 至少传一个。bool filter 显式传 =false 会报错——不传等于不过滤。

Flag作用
--query <text>关键词(姓名 / 邮箱 / 手机号),≤ 50 rune
--queries <csv>多个关键词并行搜,最多 20 条;与 --query / --user-ids 互斥;输出新 shape(见下)
--user-ids <csv>open_id 列表,≤ 100;支持 me 表示自己;与 --query 同传时把搜索范围限定在该集合
--has-chatted仅搜聊过天的
--has-enterprise-email仅搜有企业邮箱的
--exclude-external-users仅搜同租户(排除外部联系人)
--left-organization仅搜已离职的
--lang <locale>覆盖 localized_name 的语种(如 zh_cn / en_us / ja_jp)
--page-size <n>单页大小 1-30,默认 20

常用例子

# 按姓名搜,看候选确认是哪个张三
lark-cli contact +search-user --query "张三" --has-chatted

# 按完整邮箱搜(命中通常唯一,适合作后续命令的输入)
lark-cli contact +search-user --query "alice@example.com"

# 查看自己
lark-cli contact +search-user --user-ids me

# 批量回填:已知一组 open_id,取姓名 / 邮箱 / 部门
lark-cli contact +search-user --user-ids "ou_a,ou_b,ou_c" --format json

# 多 filter 组合:同租户的、有企业邮箱的「王」姓员工
lark-cli contact +search-user --query "王" --exclude-external-users --has-enterprise-email

# filter-only 枚举:列出所有"聊过天的离职同事"(无关键词)
lark-cli contact +search-user --has-chatted --left-organization

批量并行查询 (fanout)

一次查多个名字:

lark-cli contact +search-user --queries "Alice,Bob,张三"
  • 每行 user 带 matched_query,标识来自哪个 query
  • queries[] 每个输入一条 {query, error?, has_more},失败的有 error
  • 部分失败不影响其它 query;全部失败才 exit 非 0
# bool filter 对每个 query 都生效
lark-cli contact +search-user --queries "Alice,Bob" --has-chatted

# 与 --query / --user-ids 互斥
lark-cli contact +search-user --queries "a" --query "b"

Related skills

FAQ

Does lark-contact support department org charts?

lark-contact does not traverse department trees or list all employees in a department. Use native Lark OpenAPI for org-structure queries; lark-contact handles single-user search and open_id reverse lookup.

When should agents call lark-contact first?

Agents call lark-contact when a user names a person but the next step needs an open_id for messaging, groups, or calendar, or when output shows open_ids that must display as human-readable names.

Is Lark Contact safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.