feishu-cli-file

Original🇨🇳 Chinese
Translated

Feishu Drive File Management. Used when users need to list, create, move, copy, or delete files in Feishu Drive.

5installs
Added on

NPX Install

npx skill4agent add riba2534/feishu-cli feishu-cli-file

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

Feishu Drive File Management Skill

Manage files and folders in Feishu Drive, including listing, creating, moving, copying, and deleting operations.

Usage

bash
/feishu-file list [folder_token]         # List files
/feishu-file mkdir <name> [--parent]     # Create folder
/feishu-file move <token> --target       # Move file
/feishu-file copy <token> --target       # Copy file
/feishu-file delete <token>              # Delete file

Detailed CLI Command Explanations

1. List Folder Contents

bash
# List root directory (My Space)
feishu-cli file list

# List specified folder
feishu-cli file list <folder_token>
Output Example:
File List (Folder: root):
  1. [Folder] Project Documents
     Token: fldcnxxx
     Modified Time: 2024-01-21 14:30

  2. [docx] Meeting Minutes
     Token: doccnxxx
     Modified Time: 2024-01-20 10:15

  3. [sheet] Data Sheet
     Token: shtcnxxx
     Modified Time: 2024-01-19 16:45
File Types:
TypeDescription
folder
Folder
docx
Cloud Document
sheet
Spreadsheet
bitable
Base (Multi-dimensional Sheet)
mindnote
Mind Note
file
Regular File

2. Create Folder

bash
# Create in root directory
feishu-cli file mkdir "New Folder"

# Create in specified location
feishu-cli file mkdir "Subfolder" --parent <folder_token>
Output Example:
Folder created successfully!
  Name: New Folder
  Token: fldcnAbCdEfGhIjK
  Path: /My Space/New Folder

3. Move File or Folder

bash
# Move document
feishu-cli file move <file_token> --target <folder_token> --type docx

# Move folder
feishu-cli file move <folder_token> --target <parent_folder> --type folder
Parameter Explanation:
ParameterDescriptionRequired
file_token
Token of the file/folder to moveYes
--target
Target folder tokenYes
--type
File type (docx/sheet/folder/file, etc.)Yes
Output Example:
File moved successfully!
  File: doccnAbCdEfGhIjK
  Target: fldcnXyZaBcDeFgH

4. Copy File

bash
# Copy document
feishu-cli file copy <file_token> --target <folder_token> --type docx

# Copy and rename
feishu-cli file copy <file_token> --target <folder_token> --type docx --name "Copy"
Parameter Explanation:
ParameterDescriptionRequired
file_token
Token of the file to copyYes
--target
Target folder tokenYes
--type
File typeYes
--name
New file nameNo
Output Example:
File copied successfully!
  Original File: doccnAbCdEfGhIjK
  New File: doccnNewCopyToken
  Location: fldcnXyZaBcDeFgH

5. Delete File or Folder

bash
# Delete document
feishu-cli file delete <file_token> --type docx

# Delete folder (including contents)
feishu-cli file delete <folder_token> --type folder
Note: Deletion moves the file to the recycle bin, which can be restored within 30 days.
Output Example:
File deleted successfully!
  File: doccnAbCdEfGhIjK
  Type: docx

File Type Reference Table

--type ParameterDescriptionExample Token
docx
New version cloud document
doccnXxx
doc
Old version cloud document
docXxx
sheet
Spreadsheet
shtcnXxx
bitable
Base
bitXxx
mindnote
Mind Note
mindXxx
folder
Folder
fldcnXxx
file
Regular File
boxcnXxx

Typical Workflows

Organize Document Directory

bash
# 1. View current directory structure
feishu-cli file list

# 2. Create new folder
feishu-cli file mkdir "2024 Projects"

# 3. Move document to new folder
feishu-cli file move doccnXxx --target fldcnXxx --type docx

Backup Important Documents

bash
# 1. Create backup folder
feishu-cli file mkdir "Backup-$(date +%Y%m%d)"

# 2. Copy document
feishu-cli file copy doccnXxx --target fldcnBackup --type docx --name "Document Backup"

Permission Requirements

  • drive:drive:readonly
    - Read file list
  • drive:drive
    - File operations (create/move/copy/delete)