SkillsMar 30, 2026·1 min read

Lark CLI Skill: Contact — User & Org Directory

Lark/Feishu CLI skill for contacts. Search users by name/email/phone, get user profiles, query org structure.

TL;DR
Search Lark/Feishu users by name, email, or phone and query organizational structure via CLI.
§01

What it is

This Lark CLI skill provides programmatic access to the Lark/Feishu contact and organizational directory. It lets you search users by name, email, or phone number, retrieve detailed user profiles, and query the organizational structure including departments and reporting hierarchies.

The skill targets developers and automation engineers who need to look up user information or org data from Lark/Feishu without navigating the web interface.

§02

How it saves time or tokens

Manual user lookup in Lark requires logging into the admin console and navigating multiple screens. This CLI skill provides instant access to the same data with a single command. For AI agents managing team workflows, the skill provides the user IDs needed to assign tasks, send messages, or create calendar events.

Batch lookups across departments are especially efficient compared to manual search.

§03

How to use

  1. Configure the Lark CLI with your app credentials (App ID and App Secret)
  2. Use the contact search command to find users by name, email, or phone
  3. Use the profile command to get detailed user information
  4. Use the org command to query department hierarchies
§04

Example

# Search for a user by name
lark contact search --name 'Alice Wang'

# Get user profile by user ID
lark contact get --user-id 'ou_abc123'

# List all users in a department
lark contact list --department-id 'od_dept001'

# Query org structure
lark contact org --department-id 'od_root' --recursive

The output includes user IDs, names, emails, phone numbers, departments, and job titles in JSON format.

§05

Related on TokRepo

§06

Common pitfalls

  • Contact API access requires the app to have 'contact:user.employee:readonly' scope; missing permissions return empty results
  • User IDs differ between open_id, union_id, and user_id formats; use the correct format for downstream API calls
  • Rate limits apply to batch queries; add delays when iterating over large departments

Frequently Asked Questions

What permissions does the contact skill need?+

The Lark app needs 'contact:user.employee:readonly' for user search and profile access, and 'contact:department.organize:readonly' for department queries. These are configured in the Lark Developer Console.

Can I search by email or phone?+

Yes. The search command supports name, email, and phone lookups. Partial matching works for names. Email and phone require exact matches for privacy reasons.

What user data is returned?+

User profiles include name, email, phone, department, job title, employee type, avatar URL, and various user IDs (open_id, union_id, user_id). The exact fields depend on your app permissions.

Does this work with Feishu or Lark?+

Both. Feishu (Chinese version) and Lark (international version) use the same API with different base URLs. The CLI detects the environment from your app configuration.

Can I export the entire org directory?+

Yes, with the recursive flag on the org command. Start from the root department and query recursively to get all departments and users. Be mindful of rate limits for large organizations.

Citations (3)
🙏

Source & Thanks

Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars

Part of the Lark CLI Official Skills Collection on TokRepo.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets