Operate the entire Feishu ecosystem via the lark-oapi SDK: messages, documents, calendar, tasks, approvals, and Minutes. The core collaboration tool for Chinese teams.
Use Cases
Messages
- The user says "send a message to xxx on Feishu" or "send a notice in the xxx group"
- The user says "Are there any new messages on Feishu?" or "Check the latest discussion in the Feishu group"
Documents
- The user says "Help me create a weekly report in Feishu Docs" or "Search for that technical design document in Feishu"
- The user says "Append this content to the end of the Feishu document" or "Read XX in the Feishu wiki"
Calendar
- The user says "Help me create a meeting on the Feishu calendar" or "Check my schedule on the Feishu calendar for today"
- The user says "Move the meeting to Friday" or "Cancel tomorrow's weekly meeting"
Tasks
- The user says "Check what to-dos I have on Feishu" or "Help me add a Feishu task: submit the report by Friday"
- The user says "Mark that task on Feishu as complete"
Approvals
- The user says "View the processes awaiting my approval" or "Where is my leave request in the approval process?"
Minutes (Meeting Notes)
- The user says "Help me check the meeting notes from last week's weekly meeting" or "Summarize yesterday's meeting notes"
- The user says "Extract the action items from the meeting"
Prerequisites
- On the Feishu Open Platform (https://open.feishu.cn/)创建应用
- Obtain the App ID and App Secret (if a Feishu Gateway channel is already configured, they can be reused)
- Set environment variables:
export FEISHU_APP_ID="cli_xxxx" export FEISHU_APP_SECRET="xxxx" - Grant the corresponding permissions to the app in the Feishu admin console
Execution Method
The project already has the lark-oapi SDK installed; prefer using the SDK over raw HTTP calls.
Initialize the Client
import lark_oapi as lark
import os
client = lark.Client.builder() \
.app_id(os.environ["FEISHU_APP_ID"]) \
.app_secret(os.environ["FEISHU_APP_SECRET"]) \
.build()
Send a Message
from lark_oapi.api.im.v1 import *
import json
request = CreateMessageRequest.builder() \
.receive_id_type("chat_id") \
.request_body(CreateMessageRequestBody.builder()
.receive_id("目标群聊或用户ID")
.msg_type("text")
.content(json.dumps({"text": "消息内容"}))
.build()) \
.build()
response = client.im.v1.message.create(request)
Rich text message:
content = {
"zh_cn": {
"title": "周报通知",
"content": [
[{"tag": "text", "text": "请各位提交本周周报"}],
[{"tag": "a", "text": "点击填写", "href": "https://..."}],
]
}
}
# msg_type = "post"
Get the group chat list:
request = ListChatRequest.builder().build()
response = client.im.v1.chat.list(request)
Document Operations
from lark_oapi.api.docx.v1 import *
# 读取文档内容
request = RawContentDocumentRequest.builder() \
.document_id("文档ID") \
.build()
response = client.docx.v1.document.raw_content(request)
# 创建文档
request = CreateDocumentRequest.builder() \
.request_body(CreateDocumentRequestBody.builder()
.title("文档标题")
.folder_token("目标文件夹token")
.build()) \
.build()
response = client.docx.v1.document.create(request)
Search documents (REST API):
import httpx
token = get_tenant_access_token()
resp = await httpx.AsyncClient().post(
"https://open.feishu.cn/open-apis/suite/docs-api/search/object",
headers={"Authorization": f"Bearer {token}"},
json={"search_key": "搜索关键词", "count": 10},
)
Calendar Operations
from lark_oapi.api.calendar.v4 import *
import time
# 查询今日日程
now = int(time.time())
request = ListCalendarEventRequest.builder() \
.calendar_id("primary") \
.start_time(str(now)) \
.end_time(str(now + 86400)) \
.build()
response = client.calendar.v4.calendar_event.list(request)
# 创建日程
request = CreateCalendarEventRequest.builder() \
.calendar_id("primary") \
.request_body(CalendarEvent.builder()
.summary("产品评审会")
.start_time(TimeInfo.builder().timestamp("1709000000").build())
.end_time(TimeInfo.builder().timestamp("1709003600").build())
.build()) \
.build()
response = client.calendar.v4.calendar_event.create(request)
Task Operations
from lark_oapi.api.task.v2 import *
# 获取任务列表
request = ListTaskRequest.builder().page_size(50).build()
response = client.task.v2.task.list(request)
# 创建任务
request = CreateTaskRequest.builder() \
.request_body(InputTask.builder()
.summary("周五前交产品报告")
.due(Due.builder().timestamp("1709251200").is_all_day(False).build())
.build()) \
.build()
response = client.task.v2.task.create(request)
# 完成任务
request = CompleteTaskRequest.builder().task_id("任务ID").build()
response = client.task.v2.task.complete(request)
Approval Query
# 获取待审批列表(REST API)
token = get_tenant_access_token()
resp = await httpx.AsyncClient().get(
"https://open.feishu.cn/open-apis/approval/v4/tasks/query",
headers={"Authorization": f"Bearer {token}"},
params={"status": "PENDING"},
)
Minutes (Meeting Notes)
from lark_oapi.api.minutes.v1 import *
# 获取妙记列表
request = ListMinuteRequest.builder().page_size(20).build()
response = client.minutes.v1.minute.list(request)
# 获取转写文本
request = GetMinuteTranscriptRequest.builder() \
.minute_token("妙记token") \
.build()
response = client.minutes.v1.minute_transcript.get(request)
if response.success():
for paragraph in response.data.paragraphs:
speaker = paragraph.speaker.user_name if paragraph.speaker else "未知"
print(f"[{speaker}] {paragraph.content}")
After retrieving Minutes, you can call meeting-insights-analyzer for in-depth analysis, or meeting-notes-to-action-items to extract action items.
When to Use This Skill
用户提到飞书/Lark/Feishu → feishu ✅
用户需要操作中文协作文档 → feishu ✅(如果用户用飞书)
日历相关
├── Google Calendar → google-workspace
├── Apple Calendar → apple-calendar
└── 飞书日历 → feishu ✅
即时消息
├── Slack → slack
├── Discord → discord
└── 飞书/企业沟通 → feishu ✅
任务待办
├── Todoist → todoist
├── Things → things-mac
└── 飞书任务 → feishu ✅
会议纪要
└── 飞书妙记 → feishu ✅(获取后可交给 meeting 组 skill 分析)
Output Specifications
- Before sending a message, show a draft and confirm via
hitlconfirmation - For calendar operations, confirm the time (including time zone) and participants
- Attach links and last modified times to document search results
- Sort task lists by due date, and mark overdue tasks in red
- Present approval lists in a table (title, applicant, time, status)
- Segment Minutes transcripts by speaker and annotate timestamps
- On API errors, parse the error code and give specific fix suggestions (e.g., insufficient permissions → prompt to authorize in the admin console)