skills/feishu-cli-perm/SKILL.md
飞书云文档权限管理。支持添加/更新/删除/查看协作者、公开权限管理、分享密码、批量添加、 权限检查、转移所有权。当用户请求"添加权限"、"权限管理"、"共享文档"、"授权"、 "协作者"、"full_access"、"转移所有权"时使用。
npx skillsauth add riba2534/feishu-cli feishu-cli-permInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
飞书云文档权限管理:添加/更新/删除/查看协作者、公开权限管理、分享密码、批量添加、权限检查、转移所有权。
~/.feishu-cli/config.yaml)。无需 auth login(User Token 不适用于权限管理 API)。| scope | 说明 |
|-------|------|
| docs:permission.member:create | 添加协作者 |
| docs:permission.member:retrieve | 查看协作者列表 |
| docs:permission.member:update | 更新协作者权限 |
| docs:permission.member:delete | 删除协作者 |
| docs:permission.member:transfer | 转移所有权 |
| docs:permission.member:auth | 检查用户权限 |
| docs:permission.setting:read / docs:permission.setting:readonly | 读取公开权限设置 |
| docs:permission.setting:write_only | 更新公开权限、密码管理 |
# 给用户添加编辑权限(最常用操作)
feishu-cli perm add <TOKEN> --doc-type docx --member-type email --member-id [email protected] --perm edit --notification
# 查看文档协作者列表
feishu-cli perm list <TOKEN> --doc-type docx
# 删除指定协作者
feishu-cli perm delete <TOKEN> --doc-type docx --member-type email --member-id [email protected]
| 命令 | 说明 |
|------|------|
| perm add | 添加协作者权限 |
| perm update | 更新已有协作者的权限级别 |
| perm list | 查看协作者列表 |
| perm delete | 删除协作者 |
| 命令 | 说明 |
|------|------|
| perm batch-add | 从 JSON 文件批量添加协作者 |
| perm transfer-owner | 转移文档所有权 |
| perm auth | 检查当前用户对文档的权限 |
| 命令 | 说明 |
|------|------|
| perm public-get | 查看文档公开权限设置 |
| perm public-update | 更新公开权限(外部访问、链接分享等) |
| perm password create | 创建分享密码 |
| perm password update | 刷新分享密码 |
| perm password delete | 删除分享密码 |
feishu-cli perm add <TOKEN> \
--doc-type <DOC_TYPE> \
--member-type <MEMBER_TYPE> \
--member-id <MEMBER_ID> \
--perm <PERM> \
[--notification]
feishu-cli perm update <TOKEN> \
--doc-type <DOC_TYPE> \
--member-type <MEMBER_TYPE> \
--member-id <MEMBER_ID> \
--perm <PERM>
feishu-cli perm list <TOKEN> --doc-type <DOC_TYPE>
feishu-cli perm delete <TOKEN> \
--doc-type <DOC_TYPE> \
--member-type <MEMBER_TYPE> \
--member-id <MEMBER_ID>
feishu-cli perm batch-add <TOKEN> \
--doc-type <DOC_TYPE> \
--members-file <members.json> \
[--notification]
--doc-type 默认 docx,非 docx 文档(sheet / bitable / file / wiki / slides 等)必须显式指定,否则会按 docx 处理导致 API 报错。
members.json 格式(顶层为 JSON 数组):
[
{"member_type": "email", "member_id": "[email protected]", "perm": "edit"},
{"member_type": "email", "member_id": "[email protected]", "perm": "view"}
]
feishu-cli perm transfer-owner <TOKEN> \
--member-type <MEMBER_TYPE> \
--member-id <MEMBER_ID> \
[--notification] \
[--remove-old-owner] \
[--stay-put] \
[--old-owner-perm <view|edit|full_access>]
| 参数 | 默认值 | 说明 |
|------|--------|------|
| --notification | true | 通知新所有者 |
| --remove-old-owner | false | 移除原所有者权限 |
| --stay-put | false | 文档保留在原位置 |
| --old-owner-perm | full_access | 原所有者保留权限(仅 remove-old-owner=false 时生效) |
feishu-cli perm auth <TOKEN> --action <ACTION> [--doc-type <DOC_TYPE>]
可用的 action 值:view、edit、share、comment、export
feishu-cli perm public-get <TOKEN>
feishu-cli perm public-update <TOKEN> \
[--external-access] \
[--link-share-entity <anyone_readable|anyone_editable|...>]
feishu-cli perm password create <TOKEN> [--doc-type <DOC_TYPE>]
feishu-cli perm password update <TOKEN> [--doc-type <DOC_TYPE>]
feishu-cli perm password delete <TOKEN> [--doc-type <DOC_TYPE>]
| 值 | 说明 | 使用场景 |
|----|------|----------|
| view | 查看权限 | 只读分享给外部人员或大范围分享,保护文档不被误改 |
| edit | 编辑权限 | 团队协作编辑,日常最常用的权限级别 |
| full_access | 完全访问权限 | 管理员权限,包含管理协作者、文档设置、导出、查看历史版本等全部能力 |
| 值 | 别名(IM 风格) | 说明 | 使用场景 | 示例 |
|----|-----------------|------|----------|------|
| email | — | 邮箱 | 最常用,精确到个人 | [email protected] |
| openid | open_id | Open ID | 通过开放平台获取的用户 ID | ou_xxx |
| userid | user_id | User ID | 企业内部用户 ID | 123456 |
| unionid | union_id | Union ID | 跨应用统一 ID | on_xxx |
| openchat | chat_id | 群聊 ID | 按群聊授权,群内所有成员获得权限 | oc_xxx |
| opendepartmentid | — | 部门 ID | 按部门授权,部门内所有成员获得权限 | od_xxx |
| groupid | — | 群组 ID | 用户组 | gc_xxx |
| wikispaceid | — | 知识空间 ID | 知识库空间 | ws_xxx |
IM API 风格别名(
open_id、user_id、union_id、chat_id)会自动映射为标准值,两种写法等效。
| 值 | 说明 |
|----|------|
| docx | 新版文档(默认) |
| doc | 旧版文档 |
| sheet | 电子表格 |
| bitable | 多维表格 |
| wiki | 知识库 |
| file | 文件 |
| folder | 文件夹 |
| mindnote | 思维笔记 |
| minutes | 妙记 |
| slides | 幻灯片 |
| 前缀 | doc-type | |------|----------| | docx_ | docx | | doccn | doc | | sht_ | sheet | | bascn | bitable | | wikicn | wiki | | fldcn | folder |
feishu-cli perm add docx_xxxxxx \
--doc-type docx \
--member-type email \
--member-id [email protected] \
--perm edit \
--notification
feishu-cli perm update docx_xxxxxx \
--doc-type docx \
--member-type email \
--member-id [email protected] \
--perm full_access
feishu-cli perm add sht_xxxxxx \
--doc-type sheet \
--member-type openchat \
--member-id oc_xxxxxx \
--perm edit
feishu-cli perm add sht_xxxxxx \
--doc-type sheet \
--member-type opendepartmentid \
--member-id od_xxxxxx \
--perm view
feishu-cli perm transfer-owner docx_xxxxxx \
--member-type email \
--member-id [email protected] \
--old-owner-perm view
feishu-cli perm public-update docx_xxxxxx \
--external-access \
--link-share-entity anyone_readable
# 1. 授予完全访问权限
feishu-cli perm add <TOKEN> \
--doc-type docx \
--member-type email \
--member-id [email protected] \
--perm full_access \
--notification
# 2. 转移文档所有权
feishu-cli perm transfer-owner <TOKEN> \
--doc-type docx \
--member-type email \
--member-id [email protected] \
--notification
| 错误 | 原因 | 解决方法 |
|------|------|----------|
| Permission denied / 权限不足 | App 未开通相关权限 scope | 在飞书开放平台 -> 权限管理中申请 docs:permission.member:create 等权限 |
| doc-type mismatch / Token 无效 | doc-type 与实际文档类型不匹配 | 检查 Token 前缀:docx_ -> docx、sht_ -> sheet、bascn -> bitable |
| member not found | member-id 不存在或 member-type 不正确 | 确认邮箱/ID 正确,注意 email 类型需要用户的飞书注册邮箱 |
| password create: Permission denied | 分享密码为企业版功能 | 确认企业是否开通此功能,或联系管理员开启 |
| transfer-owner: no permission | 只有文档所有者或管理员可转移 | 先用 perm list 确认当前 App 身份,确保是文档创建者 |
perm add 命令的详细参数枚举和输入检查清单见 references/add_permission.md。
tools
往飞书文档里插入/更新/读取/删除「妙笔BOX」HTML 小组件块——飞书文档里**唯一能跑动画和可交互内容**的载体。 把一整页 HTML(CSS/JS)塞进块,在 iframe 沙箱里真实执行:CSS @keyframes 动画、ECharts/Three.js 图表、 Canvas、可拖拽力导向图、Dashboard、打字机/进度条/状态机动画等都能动。 当用户请求"飞书文档里做动画/能动的图/可交互图表/数据大屏/Dashboard/真实地图/地理飞线/3D 图表(map3D、3D 曲面、Three.js)/在飞书文档里放 ECharts 可视化/批量做一套图表演示"、"妙笔BOX"、"HTML 小组件"、 "在飞书文档里跑 ECharts/CSS 动画/JavaScript"、"嵌入网页/HTML 到飞书文档"、"飞书文档里的图怎么动起来"时使用。 注意:要"动"必须用本技能(妙笔BOX);画板(feishu-cli-board)的 SVG 节点会被服务端栅格化成静态图,不会动。
tools
飞书 OpenAPI 裸调。api GET/POST/PUT/DELETE/PATCH <path> 直接调用任意飞书 OpenAPI 接口, 覆盖 feishu-cli 尚未封装的接口(对齐 lark-cli 的 api 能力)。支持 --params(query)/--data(body JSON)/--data-file(从文件读 body)/ --as auto|user|bot 身份/--dry-run 预览/-o 二进制下载/--format/--jq。 当用户请求"调用 X API"、"裸调飞书接口"、"feishu-cli 没封装的接口怎么调"、"raw api"、 "用 api 命令发请求"、"下载飞书媒体/文件 binary"时使用。 不适用:仅查 schema 不调用(用 feishu-cli schema);已有专用命令的高频场景(用对应 feishu-cli <模块>)。
tools
飞书电子表格高级能力(筛选视图 + 筛选条件 + 下拉单元格 + 浮动图片 + 批量样式)。 filter-view CRUD 管理筛选视图,filter-view condition CRUD 写筛选条件(V3 API); dropdown set/get/update/delete 管理单元格下拉框(V2 dataValidation); image get/update/media-upload/write-image 操作浮动图片与单元格写图; batch-set-style 批量设置多范围单元格样式。 基础读写(read/write/style/add-rows/add-sheet)仍在 feishu-cli 主命令 sheet/bitable, 本 skill 专注高级能力。 当用户请求"筛选视图"、"筛选条件"、"加下拉框"、"数据验证"、"列下拉"、"浮动图片"、"插入图片"、"批量样式"时使用。
tools
飞书 OpenAPI 方法本地浏览 + 通用 API 透传调用。schema `service.resource.method` 三段式查路径/参数/scope(无需联网); `feishu-cli api <method> <path>` 直接调任意端点(v1.29+,覆盖 2500+ 未封装 API)。 当用户请求"飞书有没有 XX API"、"X API 的参数是什么"、"X 方法需要什么 scope"、 "OpenAPI 方法浏览"、"看 SDK 怎么调用"、"调一个没封装的飞书 API"时使用。 不适用:查在线最新 schema(请用 OpenAPI Explorer,本地元数据可能落后于飞书开放平台)。