feishu-cli
统一的飞书 CLI skill。通过一个运行时处理:
help 渐进式帮助(适配 LLM 自发现)
auth 授权与 token 管理
tool 业务动作(calendar/contact/doc/wiki/drive/sheets/mail/meeting/okr/bitable)
api 原始 Open API 调用
渐进式 help(推荐顺序)
# 1) 顶层命令总览
python3 skills/feishu-cli/run.py '{"action":"help"}'
# 2) 认证帮助
python3 skills/feishu-cli/run.py '{"action":"help","topic":"auth"}'
# 3) 查看全部模块
python3 skills/feishu-cli/run.py '{"action":"help","topic":"modules"}'
# 4) 查看某模块动作
python3 skills/feishu-cli/run.py '{"action":"help","topic":"module","module":"calendar"}'
# 5) 查看某动作参数与示例
python3 skills/feishu-cli/run.py '{"action":"help","topic":"action","module":"calendar","action_name":"create"}'
auth 示例
# 查看授权状态
python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"status"}'
# 获取租户 token(复用现有 lark_auth)
python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"tenant_token"}'
# 生成 OAuth URL(先做 redirect allowlist 预检)
python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"oauth_url","redirect_uri":"https://example.com/callback","scopes":["contact:user.base:readonly"]}'
tool 示例
# 创建日程
python3 skills/feishu-cli/run.py '{"action":"tool","module":"calendar","tool_action":"create","title":"周会","start":"2026-03-06 10:00","duration":"60m"}'
# 读取文档
python3 skills/feishu-cli/run.py '{"action":"tool","module":"doc","tool_action":"read","document_id":"doccnxxxx"}'
# 查询通讯录用户
python3 skills/feishu-cli/run.py '{"action":"tool","module":"contact","tool_action":"get_user","user_id":"ou_xxx"}'
api 示例
# 原始 Open API 调用(tenant)
python3 skills/feishu-cli/run.py '{"action":"api","method":"GET","path":"/contact/v3/scopes"}'
各模块动作速查
| module |
支持的 tool_action |
| calendar |
create, query, update, delete, list_calendars, freebusy |
| contact |
get_user, search_user, list_departments |
| doc |
create, read, read_content, write_markdown, list_blocks, update_block_text |
| wiki |
list_spaces, list_nodes, create_node, get_node |
| drive |
list_files, upload, download |
| sheets |
create, get, list_sheets |
| mail |
list_mailgroups, list_members |
| meeting |
create, list, get, update, delete |
| okr |
list_periods, batch_get, list_user_okrs |
| bitable |
list_tables, list_fields, list_records, create_record, update_record, delete_record |
| message |
send_message, history, upload_file |
| task |
list, create, update, delete, complete, uncomplete, list_subtasks, create_subtask |
别名兼容:旧名 create_spreadsheet→create,get_spreadsheet→get,list_okr_periods→list_periods,batch_get_okrs→batch_get 均已配置别名,可正常调用但文档以新名为准。
统一环境变量(建议)
LARK_APP_ID
LARK_APP_SECRET
LARK_TENANT_TOKEN(可选,优先直用)
LARK_OPEN_BASE_URL(可选)
LARK_OAUTH_REDIRECT_URI(OAuth)
LARK_OAUTH_REDIRECT_ALLOWLIST(OAuth 预检)
LARK_OAUTH_SCOPES(OAuth 默认 scope)
1---
2name: feishu-cli
3description: When the agent needs to call 飞书/Lark APIs locally → unified CLI (auth/tool/api/help) with progressive disclosure.
4triggers:
5 intent_patterns:
6 - "feishu cli|飞书cli|飞书工具|lark api|飞书授权|oauth"
7 - "日历|日程|calendar|会议|meeting|视频会议"
8 - "通讯录|contact|用户查询|部门"
9 - "云文档|document|docx|创建文档|读取文档"
10 - "云盘|drive|文件管理|文件夹"
11 - "邮件|email|mail|邮件组"
12 - "多维表格|bitable|表格记录"
13 - "OKR|目标管理|okr"
14 - "电子表格|spreadsheet|sheets"
15 - "知识库|wiki|知识空间"
16 context_signals:
17 keywords: ["feishu", "lark", "oauth", "calendar", "docx", "wiki", "drive", "bitable", "contact", "mail", "okr", "sheets", "meeting", "spreadsheet"]
18 confidence_threshold: 0.4
19priority: 8
20requires_tools: [bash]
21max_tokens: 300
22cooldown: 15
23metadata:
24 source: https://skillmd.com/skills/cklxx/feishu-cli
25---
26
27# feishu-cli
28
29统一的飞书 CLI skill。通过一个运行时处理:
30- `help` 渐进式帮助(适配 LLM 自发现)
31- `auth` 授权与 token 管理
32- `tool` 业务动作(calendar/contact/doc/wiki/drive/sheets/mail/meeting/okr/bitable)
33- `api` 原始 Open API 调用
34
35## 渐进式 help(推荐顺序)
36
37```bash
38# 1) 顶层命令总览
39python3 skills/feishu-cli/run.py '{"action":"help"}'
40
41# 2) 认证帮助
42python3 skills/feishu-cli/run.py '{"action":"help","topic":"auth"}'
43
44# 3) 查看全部模块
45python3 skills/feishu-cli/run.py '{"action":"help","topic":"modules"}'
46
47# 4) 查看某模块动作
48python3 skills/feishu-cli/run.py '{"action":"help","topic":"module","module":"calendar"}'
49
50# 5) 查看某动作参数与示例
51python3 skills/feishu-cli/run.py '{"action":"help","topic":"action","module":"calendar","action_name":"create"}'
52```
53
54## auth 示例
55
56```bash
57# 查看授权状态
58python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"status"}'
59
60# 获取租户 token(复用现有 lark_auth)
61python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"tenant_token"}'
62
63# 生成 OAuth URL(先做 redirect allowlist 预检)
64python3 skills/feishu-cli/run.py '{"action":"auth","subcommand":"oauth_url","redirect_uri":"https://example.com/callback","scopes":["contact:user.base:readonly"]}'
65```
66
67## tool 示例
68
69```bash
70# 创建日程
71python3 skills/feishu-cli/run.py '{"action":"tool","module":"calendar","tool_action":"create","title":"周会","start":"2026-03-06 10:00","duration":"60m"}'
72
73# 读取文档
74python3 skills/feishu-cli/run.py '{"action":"tool","module":"doc","tool_action":"read","document_id":"doccnxxxx"}'
75
76# 查询通讯录用户
77python3 skills/feishu-cli/run.py '{"action":"tool","module":"contact","tool_action":"get_user","user_id":"ou_xxx"}'
78```
79
80## api 示例
81
82```bash
83# 原始 Open API 调用(tenant)
84python3 skills/feishu-cli/run.py '{"action":"api","method":"GET","path":"/contact/v3/scopes"}'
85```
86
87## 各模块动作速查
88
89| module | 支持的 tool_action |
90|--------|-------------------|
91| calendar | create, query, update, delete, list_calendars, freebusy |
92| contact | get_user, search_user, list_departments |
93| doc | create, read, read_content, write_markdown, list_blocks, update_block_text |
94| wiki | list_spaces, list_nodes, create_node, get_node |
95| drive | list_files, upload, download |
96| **sheets** | **create, get, list_sheets** |
97| mail | list_mailgroups, list_members |
98| meeting | create, list, get, update, delete |
99| **okr** | **list_periods, batch_get, list_user_okrs** |
100| bitable | list_tables, list_fields, list_records, create_record, update_record, delete_record |
101| message | send_message, history, upload_file |
102| task | list, create, update, delete, complete, uncomplete, list_subtasks, create_subtask |
103
104> **别名兼容**:旧名 `create_spreadsheet`→`create`,`get_spreadsheet`→`get`,`list_okr_periods`→`list_periods`,`batch_get_okrs`→`batch_get` 均已配置别名,可正常调用但文档以新名为准。
105
106## 统一环境变量(建议)
107
108- `LARK_APP_ID`
109- `LARK_APP_SECRET`
110- `LARK_TENANT_TOKEN`(可选,优先直用)
111- `LARK_OPEN_BASE_URL`(可选)
112- `LARK_OAUTH_REDIRECT_URI`(OAuth)
113- `LARK_OAUTH_REDIRECT_ALLOWLIST`(OAuth 预检)
114- `LARK_OAUTH_SCOPES`(OAuth 默认 scope)