feishu-drive

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feishu Drive Tool

飞书云盘工具

Single tool
feishu_drive
for cloud storage operations.
用于云存储操作的独立工具
feishu_drive

Token Extraction

Token提取

From URL
https://xxx.feishu.cn/drive/folder/ABC123
folder_token
=
ABC123
从URL
https://xxx.feishu.cn/drive/folder/ABC123
中提取 →
folder_token
=
ABC123

Actions

操作指令

List Folder Contents

列出文件夹内容

json
{ "action": "list" }
Root directory (no folder_token).
json
{ "action": "list", "folder_token": "fldcnXXX" }
Returns: files with token, name, type, url, timestamps.
json
{ "action": "list" }
根目录(无需folder_token)。
json
{ "action": "list", "folder_token": "fldcnXXX" }
返回结果:包含token、名称、类型、链接、时间戳的文件信息。

Get File Info

获取文件信息

json
{ "action": "info", "file_token": "ABC123", "type": "docx" }
Searches for the file in the root directory. Note: file must be in root or use
list
to browse folders first.
type
:
doc
,
docx
,
sheet
,
bitable
,
folder
,
file
,
mindnote
,
shortcut
json
{ "action": "info", "file_token": "ABC123", "type": "docx" }
在根目录中搜索文件。注意:文件必须位于根目录,或需先使用
list
指令浏览文件夹。
type
可选值:
doc
,
docx
,
sheet
,
bitable
,
folder
,
file
,
mindnote
,
shortcut

Create Folder

创建文件夹

json
{ "action": "create_folder", "name": "New Folder" }
In parent folder:
json
{ "action": "create_folder", "name": "New Folder", "folder_token": "fldcnXXX" }
json
{ "action": "create_folder", "name": "New Folder" }
在指定父文件夹中创建:
json
{ "action": "create_folder", "name": "New Folder", "folder_token": "fldcnXXX" }

Move File

移动文件

json
{ "action": "move", "file_token": "ABC123", "type": "docx", "folder_token": "fldcnXXX" }
json
{ "action": "move", "file_token": "ABC123", "type": "docx", "folder_token": "fldcnXXX" }

Delete File

删除文件

json
{ "action": "delete", "file_token": "ABC123", "type": "docx" }
json
{ "action": "delete", "file_token": "ABC123", "type": "docx" }

File Types

文件类型

TypeDescription
doc
Old format document
docx
New format document
sheet
Spreadsheet
bitable
Multi-dimensional table
folder
Folder
file
Uploaded file
mindnote
Mind map
shortcut
Shortcut
类型描述
doc
旧版格式文档
docx
新版格式文档
sheet
电子表格
bitable
多维表格
folder
文件夹
file
已上传文件
mindnote
思维导图
shortcut
快捷方式

Configuration

配置

yaml
channels:
  feishu:
    tools:
      drive: true  # default: true
yaml
channels:
  feishu:
    tools:
      drive: true  # 默认值: true

Permissions

权限

  • drive:drive
    - Full access (create, move, delete)
  • drive:drive:readonly
    - Read only (list, info)
  • drive:drive
    - 完全访问权限(创建、移动、删除)
  • drive:drive:readonly
    - 只读权限(列出、查看信息)

Known Limitations

已知限制

  • Bots have no root folder: Feishu bots use
    tenant_access_token
    and don't have their own "My Space". The root folder concept only exists for user accounts. This means:
    • create_folder
      without
      folder_token
      will fail (400 error)
    • Bot can only access files/folders that have been shared with it
    • Workaround: User must first create a folder manually and share it with the bot, then bot can create subfolders inside it
  • 机器人无个人根文件夹:飞书机器人使用
    tenant_access_token
    ,无专属“我的空间”。根文件夹概念仅适用于用户账号。这意味着:
    • 不带
      folder_token
      调用
      create_folder
      会失败(400错误)
    • 机器人仅能访问已共享给它的文件/文件夹
    • 解决方法:用户需先手动创建文件夹并共享给机器人,之后机器人可在该文件夹内创建子文件夹