Feishu Agent Skill
Feishu (Lark) CLI agent - Provides calendar, todo, and contact management capabilities for AI assistants.
Installation
CODEBLOCK0
Quick Start
- 1. Setup - Configure Feishu app credentials:
CODEBLOCK1
- 2. Authenticate - OAuth 2.0 authorization:
CODEBLOCK2
- 3. Start using - Check your calendar:
CODEBLOCK3
Capabilities
- - 📅 Calendar: List calendars, view events, create/delete events with automatic conflict detection
- ✅ Todo: Manage tasks via Feishu Bitable
- 👥 Contacts: Search and list users from organization
- 🔐 Auth: OAuth 2.0 authentication with automatic token refresh
Commands
Setup & Auth
| Command | Description |
|---|
| INLINECODE0 | Interactive setup wizard (App credentials + OAuth + Bitable) |
| INLINECODE1 |
OAuth 2.0 authorization to get user
accesstoken |
|
feishu-agent whoami | Show current user and authorization status |
|
feishu-agent config list | View global configuration |
Calendar Management
| Command | Description |
|---|
| INLINECODE4 | List all calendars (primary, subscribed) |
| INLINECODE5 |
List events in primary calendar |
|
feishu-agent calendar create --summary "Meeting" --start "2026-03-05 14:00" --end "2026-03-05 15:00" | Create a new event (auto-checks conflicts) |
|
feishu-agent calendar create --summary "Meeting" --start "..." --end "..." --attendee user_id | Create event with attendees |
|
feishu-agent calendar delete --event-id=evt123 | Delete an event |
Other Features
| Command | Description |
|---|
| INLINECODE9 | List todos from Bitable |
| INLINECODE10 |
Create a todo |
|
feishu-agent todo done --record-id=rec123 | Mark todo as done |
|
feishu-agent contact list | List users in department |
|
feishu-agent contact search "John" | Search users by name/email |
Setup Flow
Option 1: Interactive Setup (Recommended)
CODEBLOCK4
This wizard will:
- 1. Prompt for App ID and App Secret
- Open browser for OAuth 2.0 authorization
- Save tokens to INLINECODE14
- Optionally fetch Bitable schema
Option 2: Manual Configuration
CODEBLOCK5
Configuration
Global config is stored in ~/.feishu-agent/config.json:
CODEBLOCK6
Required Feishu App Permissions
In Feishu Developer Console, enable:
- -
calendar:calendar - View and manage user calendars - INLINECODE17 - Manage events in calendars
- INLINECODE18 - Read user contact info
- INLINECODE19 - Access Bitable data (for todo feature)
Redirect URI must be configured: INLINECODE20
Use Cases for AI Agents
Schedule a Meeting
CODEBLOCK7
Note: The command automatically checks for time conflicts using the FreeBusy API. If a conflict is detected, the event creation will fail with a description of the busy time slot.
Check Daily Schedule
CODEBLOCK8
Manage Tasks
CODEBLOCK9
Troubleshooting
"User authorization required"
- - Run
feishu-agent auth to authorize
"Token expired"
- - Run
feishu-agent auth again to refresh
"Time conflict detected"
- - The requested time slot is already busy
- Choose a different time or check your calendar with INLINECODE23
"Permission denied"
- - Check app permissions in Feishu Developer Console
License
MIT
飞书智能体技能
飞书(Lark)命令行智能体 - 为AI助手提供日历、待办事项和联系人管理功能。
安装
bash
通过clawhub安装
clawhub install feishu-agent
或使用bunx直接运行
bunx @teamclaw/feishu-agent <命令>
或通过bun全局安装
bun add -g @teamclaw/feishu-agent
feishu-agent <命令>
快速开始
- 1. 设置 - 配置飞书应用凭证:
bash
feishu-agent setup
- 2. 认证 - OAuth 2.0授权:
bash
feishu-agent auth
- 3. 开始使用 - 查看您的日历:
bash
feishu-agent calendar events
功能
- - 📅 日历:列出日历、查看事件、创建/删除事件,自动检测冲突
- ✅ 待办事项:通过飞书多维表格管理任务
- 👥 联系人:搜索和列出组织中的用户
- 🔐 认证:OAuth 2.0认证,支持自动刷新令牌
命令
设置与认证
| 命令 | 描述 |
|---|
| feishu-agent setup | 交互式设置向导(应用凭证 + OAuth + 多维表格) |
| feishu-agent auth |
OAuth 2.0授权,获取用户访问令牌 |
| feishu-agent whoami | 显示当前用户和授权状态 |
| feishu-agent config list | 查看全局配置 |
日历管理
| 命令 | 描述 |
|---|
| feishu-agent calendar | 列出所有日历(主日历、订阅日历) |
| feishu-agent calendar events |
列出主日历中的事件 |
| feishu-agent calendar create --summary 会议 --start 2026-03-05 14:00 --end 2026-03-05 15:00 | 创建新事件(自动检查冲突) |
| feishu-agent calendar create --summary 会议 --start ... --end ... --attendee user_id | 创建带参与者的活动 |
| feishu-agent calendar delete --event-id=evt123 | 删除事件 |
其他功能
| 命令 | 描述 |
|---|
| feishu-agent todo list | 列出多维表格中的待办事项 |
| feishu-agent todo create --title 任务 --priority 高 |
创建待办事项 |
| feishu-agent todo done --record-id=rec123 | 将待办事项标记为已完成 |
| feishu-agent contact list | 列出部门中的用户 |
| feishu-agent contact search 张三 | 按姓名/邮箱搜索用户 |
设置流程
选项1:交互式设置(推荐)
bash
feishu-agent setup
此向导将:
- 1. 提示输入应用ID和应用密钥
- 打开浏览器进行OAuth 2.0授权
- 将令牌保存到 ~/.feishu-agent/config.json
- 可选获取多维表格架构
选项2:手动配置
bash
步骤1:设置应用凭证
feishu-agent config set appId cli_xxxxx
feishu-agent config set appSecret xxxxx
步骤2:使用用户账户授权
feishu-agent auth
配置
全局配置存储在 ~/.feishu-agent/config.json:
json
{
appId: cli_xxxxx,
appSecret: xxxxx,
userAccessToken: xxxxx,
refreshToken: xxxxx
}
所需飞书应用权限
在飞书开发者控制台中,启用:
- - calendar:calendar - 查看和管理用户日历
- calendar:event - 管理日历中的事件
- contact:user.base:readonly - 读取用户联系人信息
- bitable:app - 访问多维表格数据(用于待办事项功能)
必须配置重定向URI:http://localhost:3000/callback
AI智能体使用场景
安排会议
bash
feishu-agent calendar create \
--summary 团队站会 \
--start 2026-03-05 10:00 \
--end 2026-03-05 10:30 \
--attendee userid1 \
--attendee userid2
注意:该命令会自动使用空闲忙API检查时间冲突。如果检测到冲突,事件创建将失败,并显示繁忙时间段的描述。
查看每日日程
bash
feishu-agent calendar events
管理任务
bash
feishu-agent todo create --title 审查PR #123 --priority 高
feishu-agent todo list
feishu-agent todo done --record-id rec_xxx
故障排除
需要用户授权
- - 运行 feishu-agent auth 进行授权
令牌已过期
- - 再次运行 feishu-agent auth 刷新令牌
检测到时间冲突
- - 请求的时间段已被占用
- 选择其他时间,或使用 feishu-agent calendar events 查看您的日历
权限被拒绝
许可证
MIT