OpenClaw自动化文件管理助手,用于批量文件操作、智能分类、重复文件清理、文件重命名、目录同步等任务。当用户需要整理文件、批量重命名、清理重复文件、同步目录或自动化文件工作流时使用此技能。
Scanned 9/11/2026
Install to Claude Code
npx -y skills add lxyeternal/MalSkillBench --skill file-manager --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of File Manager?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/lxyeternal-file-manager)More formats (shields.io, HTML) on the badges page.
---
name: file-manager
description: OpenClaw自动化文件管理助手,用于批量文件操作、智能分类、重复文件清理、文件重命名、目录同步等任务。当用户需要整理文件、批量重命名、清理重复文件、同步目录或自动化文件工作流时使用此技能。
---
# File Manager - OpenClaw 自动化文件管理
## 核心功能
### 1. 智能文件分类 (`organize`)
按文件类型、日期、大小或自定义规则自动分类文件。
```bash
# 按文件类型分类
python scripts/organize.py <source_dir> --by-type
# 按日期分类 (年/月/日)
python scripts/organize.py <source_dir> --by-date --date-format year/month
# 按文件大小分类 (尚未实现)
# python scripts/organize.py <source_dir> --by-size --size-ranges "10MB,100MB,1GB"
```
### 2. 批量重命名 (`batch_rename`)
支持正则表达式、序列号、日期等模式的重命名。
```bash
# 添加前缀/后缀
python scripts/batch_rename.py <pattern> --prefix "IMG_" --suffix "_2024"
# 使用正则替换
python scripts/batch_rename.py "*.jpg" --replace "IMG_(\d+)" "Photo_\1"
# 序列号重命名
python scripts/batch_rename.py "*.jpg" --sequence --padding 4
```
### 3. 重复文件清理 (`deduplicate`)
基于内容哈希检测并处理重复文件。
```bash
# 扫描并列出重复文件
python scripts/deduplicate.py <directory> --scan-only
# 删除重复文件(保留最旧/最新)
python scripts/deduplicate.py <directory> --keep oldest --action delete
# 移动重复文件到隔离目录
python scripts/deduplicate.py <directory> --action move --to <quarantine_dir>
```
### 4. 目录同步 (`sync`)
双向或单向目录同步,支持排除模式和增量同步。
```bash
# 单向同步 (源 → 目标)
python scripts/sync.py <source> <target> --mirror
# 双向同步 (尚未实现)
python scripts/sync.py <dir1> <dir2> --bidirectional
# 排除特定文件
python scripts/sync.py <source> <target> --exclude "*.tmp,*.log,.git"
```
## 使用模式
### 常见场景
**场景1: 整理下载文件夹**
```python
# 自动分类下载的文件
python scripts/organize.py ~/Downloads --by-type --move
```
**场景2: 清理重复照片**
```python
# 扫描重复照片
python scripts/deduplicate.py ~/Pictures --scan-only
```
**场景3: 批量整理项目文件**
```python
# 按日期整理项目文件
python scripts/organize.py ./projects --by-date --date-format year/month
```
**场景4: 自动备份工作目录**
```python
# 同步到备份目录,排除临时文件
python scripts/sync.py ~/Work ~/Backups/Work --exclude "node_modules,.git,*.tmp"
```
## 工作流
### 文件整理工作流
1. 分析目录结构和文件分布
2. 选择分类策略 (类型/日期/大小/自定义)
3. 执行整理 (dry-run 预览 → 确认 → 执行)
4. 验证结果
### 清理工作流
1. 扫描重复/过期/大文件
2. 生成报告并预览
3. 用户确认或自动处理
4. 移动到回收站/隔离区/直接删除
### 同步工作流
1. 分析源和目标差异
2. 预览待同步的文件列表
3. 确认后执行同步
4. 显示同步统计
## 安全原则
- **预览优先**: 所有修改操作默认执行 dry-run 预览,需加 --execute 才执行
- **操作确认**: 执行前需要用户输入 yes 确认
- **符号链接安全**: 遍历目录时跳过符号链接,避免无限递归
- **冲突保护**: 目标文件已存在时自动重命名或跳过,不会覆盖
## ⚙️ 依赖安装与环境初始化
### 环境要求
- Python 3.8+
- 无外部依赖,仅使用 Python 标准库
---
## 脚本参数说明
直接查看脚本帮助获取详细参数:
```bash
python scripts/<script>.py --help
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!