SuperAPI AI Directory

file-manager

General & other

View repository

Updated 10-16 00:04

About this skill

File Management

Help users manage local files and folders: create, organize, search, rename, move.

Use Cases

  • The user says "help me organize my Downloads folder" or "categorize these files by type"
  • The user needs to batch rename files
  • The user wants to find a certain file

Execution Method

Operate the local file system through bash commands.

View directory contents

ls -la "/path/to/dir"

Create a folder

mkdir -p "/path/to/new/folder"

Move files

mv "/source/file.txt" "/destination/"

Organize by type

Categorize files into corresponding folders by extension:

# 示例:按文件类型分类
for ext in pdf docx xlsx png jpg; do
  mkdir -p "$TARGET_DIR/$ext"
  mv "$SOURCE_DIR"/*.$ext "$TARGET_DIR/$ext/" 2>/dev/null
done

Search files

# 按名称搜索
find "/path" -name "*.pdf" -type f

# 按内容搜索(文本文件)
grep -rl "关键词" "/path" --include="*.txt" --include="*.md"

Batch rename

# 示例:添加日期前缀
for f in /path/*.pdf; do
  mv "$f" "/path/$(date +%Y%m%d)_$(basename "$f")"
done

Safety Rules

  • Deletion operations must be confirmed first: use the HITL tool to request user confirmation
  • Prefer moving to the trash: on macOS use the trash command, avoid directly rm
  • Show a preview before operating: first list the files to be operated on, and execute after the user confirms
  • Do not operate on system directories: do not modify system paths such as /System, /Library, /usr
  • Quote paths correctly when they contain spaces: wrap all paths in double quotes