Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,20 +479,31 @@ feishu-cli search docs "产品需求" --user-access-token <token>

## Claude Code 技能

本项目提供以下 Claude Code 技能,位于 `skills/` 目录(14 个技能)
本项目提供以下 Claude Code 技能,位于 `skills/` 目录:

| 技能 | 说明 | 用法 |
|------|------|------|
| `/feishu-cli-shared` | 共享基础、认证前置规则、身份差异 | `/feishu-cli-shared` |
| `/feishu-cli-doc` | 文档入口(读/写/导入/导出) | `/feishu-cli-doc` |
| `/feishu-cli-read` | 读取飞书文档/知识库并转换为 Markdown | `/feishu-cli-read <doc_id\|url>` |
| `/feishu-cli-write` | 创建/写入飞书文档(含素材插入、快速创建空白文档) | `/feishu-cli-write "标题"` |
| `/feishu-cli-import` | 从 Markdown 导入创建文档 | `/feishu-cli-import <file.md>` |
| `/feishu-cli-export` | 导出为 Markdown/PDF/Word,下载文档素材 | `/feishu-cli-export <doc_id> [path]` |
| `/feishu-cli-im` | 即时通讯入口(消息发送 / 回复 / 转发) | `/feishu-cli-im <receive_id>` |
| `/feishu-cli-perm` | 权限管理 | `/feishu-cli-perm <doc_token>` |
| `/feishu-cli-msg` | 消息全功能管理(发送/回复/转发/批量获取/资源下载/话题回复) | `/feishu-cli-msg <receive_id>` |
| `/feishu-cli-chat` | 会话浏览、消息互动与群聊管理 | `/feishu-cli-chat` |
| `/feishu-cli-drive` | 云空间文件管理 | `/feishu-cli-drive` |
| `/feishu-cli-sheets` | 电子表格 | `/feishu-cli-sheets` |
| `/feishu-cli-calendar` | 日历日程管理 | `/feishu-cli-calendar` |
| `/feishu-cli-task` | 任务与任务清单 | `/feishu-cli-task` |
| `/feishu-cli-contact` | 通讯录和部门查询 | `/feishu-cli-contact` |
| `/feishu-cli-toolkit` | 综合工具箱(表格导出/日历agenda/任务管理/清单成员/文件/素材/评论/知识库/通讯录) | `/feishu-cli-toolkit` |
| `/feishu-cli-board` | 画板操作(精排绘图/Mermaid 导入/截图/节点管理) | `/feishu-cli-board` |
| `/feishu-cli-whiteboard` | 画板入口 | `/feishu-cli-whiteboard` |
| `/feishu-cli-bitable` | 多维表格全功能(数据表/字段/记录/视图配置/仪表盘/工作流/表单/角色/附件/聚合查询) | `/feishu-cli-bitable` |
| `/feishu-cli-base` | 多维表格入口 | `/feishu-cli-base` |
| `/feishu-cli-wiki` | 知识库操作 | `/feishu-cli-wiki` |
| `/feishu-cli-vc` | 视频会议与妙记(搜索会议/获取纪要/妙记信息) | `/feishu-cli-vc` |
| `/feishu-cli-auth` | OAuth 认证、Token 管理、scope 配置、搜索权限排错 | `/feishu-cli-auth` |
| `/feishu-cli-search` | 搜索飞书文档/消息/应用(含 Token 前置检查流程) | `/feishu-cli-search` |
Expand Down
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

feishu-cli 是一个功能完整的飞书开放平台命令行工具。它将飞书文档、知识库、电子表格、消息、日历、任务等操作封装为简洁的命令行接口,**核心能力是 Markdown ↔ 飞书文档双向无损转换**。

除了传统的 CLI 用法,feishu-cli 还为 [Claude Code](https://claude.ai/claude-code) 等 AI 编程助手提供了 **11 个开箱即用的技能文件**,让 AI Agent 能够直接创建文档、发送消息、管理权限无需任何额外配置。
除了传统的 CLI 用法,feishu-cli 还为 [Claude Code](https://claude.ai/claude-code) 等 AI 编程助手提供了一组开箱即用的技能文件,让 AI Agent 能够直接创建文档、发送消息、管理权限无需任何额外配置。

### 为什么选择 feishu-cli

- **双向转换零损耗** — 支持 40+ 种块类型,Markdown 导入飞书后再导出,内容完整保留
- **图表原生渲染** — Mermaid(8 种图表类型)和 PlantUML 自动转换为飞书画板,不是截图,是可编辑的矢量图
- **大规模文档处理** — 三阶段并发管道架构,实测 10,000+ 行 / 127 个图表 / 170+ 个表格一次导入
- **AI Agent 原生** — 11 个技能文件覆盖飞书全功能,AI 助手即装即用
- **AI Agent 原生** — 多组技能文件覆盖飞书核心全功能,AI 助手即装即用
- **一个工具覆盖全平台** — 文档、知识库、表格、消息、日历、任务、权限、画板、评论、搜索

## 核心能力
Expand Down Expand Up @@ -569,18 +569,29 @@ feishu-cli dept children <department_id>

## AI 技能集成

`skills/` 目录包含 **11 个** 为 [Claude Code](https://claude.ai/claude-code) 设计的技能文件,让 AI Agent 能够直接操作飞书 — 创建文档、发送消息、管理权限,全部通过自然语言驱动。
`skills/` 目录包含多组为 [Claude Code](https://claude.ai/claude-code) 设计的技能文件,让 AI Agent 能够直接操作飞书,全部通过自然语言驱动。

| 技能 | 功能 | 触发示例 |
|------|------|---------|
| `feishu-cli-shared` | 认证 / 身份 / 权限前置 | "先帮我把飞书登录和权限理顺" |
| `feishu-cli-doc` | 文档入口 | "创建 / 读取 / 导出飞书文档" |
| `feishu-cli-read` | 读取飞书文档 / 知识库 | "读一下这个飞书链接" |
| `feishu-cli-write` | 创建 / 写入 / 更新文档 | "创建一个新飞书文档" |
| `feishu-cli-import` | 从 Markdown 导入创建文档 | "把这个 md 文件上传到飞书" |
| `feishu-cli-export` | 导出为 Markdown / PDF / Word | "把飞书文档导出来" |
| `feishu-cli-im` | 消息发送 / 回复 / 转发 | "发消息给 xxx" |
| `feishu-cli-perm` | 权限管理 | "给文档添加权限" |
| `feishu-cli-msg` | 消息全功能管理 | "发消息给 xxx" |
| `feishu-cli-drive` | 云空间文件管理 | "列出文件夹里的文件" |
| `feishu-cli-sheets` | 电子表格 | "读取飞书表格数据" |
| `feishu-cli-calendar` | 日历日程 | "帮我约个会" |
| `feishu-cli-task` | 任务 / 任务清单 | "创建一个待办" |
| `feishu-cli-contact` | 用户和部门查询 | "查一下张三的邮箱" |
| `feishu-cli-toolkit` | 综合工具箱(表格/日历/任务/群聊/文件/评论/知识库/通讯录) | "读取飞书表格数据" |
| `feishu-cli-board` | 画板操作(精排绘图/Mermaid 导入/截图/节点管理) | "画个架构图"、"在飞书里画图" |
| `feishu-cli-whiteboard` | 画板入口 | "编辑飞书白板" |
| `feishu-cli-base` | 多维表格入口 | "查看飞书多维表格" |
| `feishu-cli-wiki` | 知识库入口 | "找一下知识库里的文档" |
| `feishu-cli-auth` | OAuth 认证、Token 管理、scope 配置 | "登录飞书"、"获取 Token" |
| `feishu-cli-search` | 搜索飞书文档 / 消息 / 应用 | "搜索飞书文档" |
| `feishu-cli-doc-guide` | 飞书文档创建规范 | 其他技能内部引用 |
Expand Down Expand Up @@ -641,6 +652,7 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
| 群消息读取(User 身份) | `im:message.group_msg:get_as_user` | User Token 读取群消息 |
| 画板 | `board:whiteboard` | 画板读写 |
| 电子表格 | `sheets:spreadsheet` | 电子表格读写 |
| 多维表格 | `bitable:app` | 多维表格读写 |
| 素材管理 | `subscriptions:image` | 上传下载, 需单独申请 |
| 用户信息 | `contact:user.base:readonly` | 获取用户信息, 需单独申请 |
| 通讯录 | `contact:contact.base:readonly` | 需单独申请 |
Expand All @@ -660,9 +672,20 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"scopes": {
"tenant": [
"board:whiteboard:node:create",
"board:whiteboard:node:delete",
"board:whiteboard:node:read",
"board:whiteboard:node:update",
"bitable:app",
"calendar:calendar.free_busy:read",
"calendar:calendar:create",
"calendar:calendar:delete",
"calendar:calendar:read",
"calendar:calendar:update",
"calendar:calendar.event:create",
"calendar:calendar.event:delete",
"calendar:calendar.event:read",
"calendar:calendar.event:reply",
"calendar:calendar.event:update",
"docs:document.comment:read",
"docs:document.comment:write_only",
"docs:permission.member:create",
Expand All @@ -672,6 +695,8 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"docx:document:write_only",
"drive:drive.metadata:readonly",
"drive:drive.search:readonly",
"drive:drive",
"drive:drive:readonly",
"drive:drive:version:readonly",
"im:chat.announcement:read",
"im:chat.announcement:write_only",
Expand Down Expand Up @@ -709,7 +734,13 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"sheets:spreadsheet:create",
"sheets:spreadsheet:read",
"sheets:spreadsheet:write_only",
"task:task:read",
"task:task:write",
"task:tasklist:read",
"task:tasklist:write",
"wiki:member:create",
"wiki:member:retrieve",
"wiki:member:update",
"wiki:wiki:readonly"
],
"user": []
Expand All @@ -726,6 +757,7 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"board:whiteboard:node:delete",
"board:whiteboard:node:read",
"board:whiteboard:node:update",
"bitable:app",
"calendar:calendar.acl:create",
"calendar:calendar.acl:delete",
"calendar:calendar.acl:read",
Expand All @@ -742,6 +774,7 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"calendar:calendar:update",
"contact:contact.base:readonly",
"contact:user.base:readonly",
"directory:department:search",
"docs:document.comment:create",
"docs:document.comment:read",
"docs:document.comment:update",
Expand All @@ -753,6 +786,8 @@ npx skills add riba2534/feishu-cli --global --yes --agent claude-code --copy
"docx:document:write_only",
"drive:drive.metadata:readonly",
"drive:drive.search:readonly",
"drive:drive",
"drive:drive:readonly",
"drive:drive:version",
"drive:drive:version:readonly",
"im:chat.announcement:read",
Expand Down
54 changes: 54 additions & 0 deletions docs/superpowers/plans/2026-03-30-feishu-cli-skills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# feishu-cli Skills Expansion Plan

> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Add official-aligned `feishu-cli-*` skills so the repository's AI skill surface is close to `larksuite/cli` without renaming existing skills.

**Architecture:** Keep the current granular skills intact, then add thin umbrella/family skills for the main product areas (`shared`, `doc`, `im`, `drive`, `sheets`, `calendar`, `task`, `contact`, `wiki`, `base`, `whiteboard`). Update project docs so the skill index reflects the expanded catalog.

**Tech Stack:** Markdown skill files, existing `feishu-cli` CLI commands, repository docs.

---

### Task 1: Add umbrella skills

**Files:**
- Create: `skills/feishu-cli-shared/SKILL.md`
- Create: `skills/feishu-cli-doc/SKILL.md`
- Create: `skills/feishu-cli-im/SKILL.md`
- Create: `skills/feishu-cli-drive/SKILL.md`
- Create: `skills/feishu-cli-sheets/SKILL.md`
- Create: `skills/feishu-cli-calendar/SKILL.md`
- Create: `skills/feishu-cli-task/SKILL.md`
- Create: `skills/feishu-cli-contact/SKILL.md`
- Create: `skills/feishu-cli-wiki/SKILL.md`
- Create: `skills/feishu-cli-base/SKILL.md`
- Create: `skills/feishu-cli-whiteboard/SKILL.md`

- [ ] **Step 1: Draft the skill files**
- [ ] **Step 2: Keep each skill thin and command-oriented**
- [ ] **Step 3: Make sure names and descriptions mirror the official lark-cli concept**

### Task 2: Update repository docs

**Files:**
- Modify: `README.md`
- Modify: `CLAUDE.md`
- Modify: `AGENTS.md`

- [ ] **Step 1: Replace stale skill counts**
- [ ] **Step 2: Add the new skill names to the index/table**
- [ ] **Step 3: Keep the existing feishu-cli- skills listed as first-class entry points**

### Task 3: Verify the catalog

**Files:**
- Inspect: `skills/`
- Inspect: `README.md`
- Inspect: `CLAUDE.md`
- Inspect: `AGENTS.md`

- [ ] **Step 1: Confirm all new files exist**
- [ ] **Step 2: Confirm no broken relative links**
- [ ] **Step 3: Review the diff for consistency**

39 changes: 39 additions & 0 deletions skills/feishu-cli-base/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: feishu-cli-base
description: >-
飞书多维表格(Base / Bitable):创建、读取、写入、字段、视图、记录、仪表盘、
工作流和表单管理。适用于和官方 lark-base 对齐的多维表格入口。
user-invocable: true
allowed-tools: Bash, Read
---

# 飞书 Base 技能

这个技能对齐官方 lark-base 的入口,但命令使用 feishu-cli 的 bitable 能力。

## 常用命令

```bash
feishu-cli bitable create --name "新 Base"
feishu-cli bitable get <base_token>
feishu-cli bitable tables <base_token>
feishu-cli bitable fields <base_token> <table_id>
feishu-cli bitable records <base_token> <table_id>
feishu-cli bitable get-record <base_token> <table_id> <record_id>
feishu-cli bitable add-record <base_token> <table_id> --fields '{"名称":"测试"}'
feishu-cli bitable update-record <base_token> <table_id> <record_id> --fields '{"状态":"完成"}'
feishu-cli bitable delete-records <base_token> <table_id> --record-ids rid1,rid2
feishu-cli bitable views <base_token> <table_id>
feishu-cli bitable create-view <base_token> <table_id> --name "新视图"
feishu-cli bitable dashboard list <base_token>
feishu-cli bitable workflow list <base_token>
feishu-cli bitable form list <base_token>
feishu-cli bitable role list <base_token>
feishu-cli bitable data-query <base_token> <table_id> --query query.json
```

## 使用建议

- 用户说“多维表格”优先看这个技能
- 先读表结构,再写字段或记录
- 公式 / 查找引用 / 工作流涉及复杂结构时,先确认字段和 schema
36 changes: 36 additions & 0 deletions skills/feishu-cli-calendar/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: feishu-cli-calendar
description: >-
飞书日历:查看日历、创建和更新日程、管理参与人、查询忙闲状态和搜索日程。
适用于预约会议、查空闲时间、查看今天/本周日程等场景。
user-invocable: true
allowed-tools: Bash, Read
---

# 飞书日历技能

这个技能对齐官方 lark-calendar 的入口。

## 常用命令

```bash
feishu-cli calendar list
feishu-cli calendar primary
feishu-cli calendar get <calendar_id>
feishu-cli calendar create-event --calendar-id <calendar_id> --summary "团队周会" --start "2026-03-30T10:00:00+08:00" --end "2026-03-30T11:00:00+08:00"
feishu-cli calendar get-event <calendar_id> <event_id>
feishu-cli calendar list-events <calendar_id>
feishu-cli calendar update-event <calendar_id> <event_id> --summary "新标题"
feishu-cli calendar delete-event <calendar_id> <event_id>
feishu-cli calendar event-search --calendar-id <calendar_id> --query "周会"
feishu-cli calendar event-reply <calendar_id> <event_id> --status accept
feishu-cli calendar attendee list <calendar_id> <event_id>
feishu-cli calendar freebusy --start "2026-03-30T00:00:00+08:00" --end "2026-03-31T00:00:00+08:00"
feishu-cli calendar agenda <calendar_id>
```

## 使用建议

- 用户要“帮我约个会”时,先查 busy 再创建
- 用户要“今天有什么安排”时,先看 `agenda`
- 参会人和时间有歧义时,先澄清再创建
30 changes: 30 additions & 0 deletions skills/feishu-cli-contact/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: feishu-cli-contact
description: >-
飞书通讯录:查询用户信息、搜索用户、列出部门用户以及获取部门和子部门信息。
适用于从姓名、邮箱、手机号定位成员,或需要部门树信息的场景。
user-invocable: true
allowed-tools: Bash, Read
---

# 飞书通讯录技能

这个技能对齐官方 lark-contact 的入口。

## 常用命令

```bash
feishu-cli user info <user_id>
feishu-cli user search --email user@example.com
feishu-cli user search --mobile 13800138000
feishu-cli user list --department-id od_xxx
feishu-cli dept get <department_id>
feishu-cli dept children <department_id>
```

## 适用场景

- 找人
- 通过邮箱 / 手机号映射用户
- 通过部门找成员
- 获取部门层级结构
40 changes: 40 additions & 0 deletions skills/feishu-cli-doc/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: feishu-cli-doc
description: >-
飞书文档:创建、导入、导出、读取和增量更新文档,插入图片/文件/画板,
以及处理 Markdown 与飞书文档之间的转换。适用于文档创建、阅读、编辑、导出、
追加、替换、删除章节等场景。
user-invocable: true
allowed-tools: Bash, Read, Write
---

# 飞书文档技能

这个技能对齐官方 lark-doc 的入口粒度,但命令全部使用 feishu-cli 的实际能力。

## 优先级

1. 只读:用 [feishu-cli-read](../feishu-cli-read/SKILL.md)
2. 写入与编辑:用 [feishu-cli-write](../feishu-cli-write/SKILL.md)
3. Markdown 导入:用 [feishu-cli-import](../feishu-cli-import/SKILL.md)
4. 导出与素材:用 [feishu-cli-export](../feishu-cli-export/SKILL.md)

## 常用命令

```bash
feishu-cli doc create --title "新文档"
feishu-cli doc export <document_id> -o output.md --download-images
feishu-cli doc import input.md --title "文档标题" --upload-images
feishu-cli doc add <document_id> -c '{"elements":[]}'
feishu-cli doc content-update <document_id> --mode append --markdown "## 新内容"
feishu-cli doc media-insert <document_id> --file image.png --type image
feishu-cli doc media-download <file_token> -o image.png
```

## 使用建议

- 读文档优先走 `feishu-cli-read`。
- 新建或重写文档优先走 `feishu-cli-write`。
- 将本地 Markdown 导入飞书优先走 `feishu-cli-import`。
- 导出为 Markdown / 下载素材优先走 `feishu-cli-export`。

35 changes: 35 additions & 0 deletions skills/feishu-cli-drive/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: feishu-cli-drive
description: >-
飞书云空间文件管理:文件列表、文件夹、移动、复制、删除、创建快捷方式、
上传、下载、版本管理、元数据和统计信息。也覆盖素材上传下载的底层文件操作。
user-invocable: true
allowed-tools: Bash, Read
---

# 飞书云空间技能

这个技能对齐官方 lark-drive 的“文件 / 云空间”入口。

## 常用命令

```bash
feishu-cli file list
feishu-cli file meta <file_token>
feishu-cli file stats <file_token>
feishu-cli file mkdir "新文件夹" --parent <folder_token>
feishu-cli file move <file_token> --target <folder_token> --type docx
feishu-cli file copy <file_token> --target <folder_token> --type docx
feishu-cli file delete <file_token> --type docx
feishu-cli file version list <file_token>
feishu-cli file upload /path/to/file.pdf --parent <folder_token>
feishu-cli file download <file_token> -o output.pdf
feishu-cli media upload image.png --parent-type doc_image --parent-node <document_id>
feishu-cli media download <media_token> --output image.png
```

## 何时使用

- 用户要“找文件”“列文件夹”“下载文件”“上传素材”
- 用户要查文件版本、元数据、统计
- 用户要处理文档附件,但不想进入文档编辑流程
Loading