File Manager 1.0.0
v1.0.0OpenClaw自动化文件管理助手,用于批量文件操作、智能分类、重复文件清理、文件重命名、目录同步等任务。当用户需要整理文件、批量重命名、清理重复文件、同步目录或自动化文件工作流时使用此技能。
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description match the provided scripts (organize, batch_rename, deduplicate, sync). No unrelated credentials, binaries, or network endpoints are requested. Minor inconsistency: SKILL.md documents a 'watch' capability and references scripts/watch.py, but there is no watch.py file included.
Instruction Scope
SKILL.md tells the agent to run the included Python scripts and to install small Python deps; all instructions stay within the file-management domain (classification, renaming, deduplication, synchronization). The docs emphasize dry-run/preview and confirmations. Note: some operations are destructive (delete/move) and some flags permit skipping confirmation (e.g., batch_rename has --no-confirm; sync/deduplicate accept execution flags), so care is needed when invoking the scripts.
Install Mechanism
No install spec or remote downloads; dependencies are small Python packages listed in requirements.txt (tqdm, colorama). All code is bundled with the skill—no arbitrary network fetches or archive extraction during install.
Credentials
The skill requests no environment variables, secrets, or external service access. All filesystem access is local and consistent with the described functionality.
Persistence & Privilege
always:false (normal). disable-model-invocation:false (normal), so an agent could autonomously invoke these scripts. Because the scripts can perform destructive actions (delete/move/update) if called with execution flags and confirmation can be bypassed with certain options, autonomous invocation increases the blast radius—this is expected but worth acknowledging.
Assessment
This skill appears to be what it says: a local file-management toolbox. Before installing or running it: 1) Be aware the scripts can delete or move files—always run in dry-run/preview mode first. 2) There is a missing watch.py referenced in SKILL.md; don't rely on the 'watch' feature until that script is provided. 3) Inspect the included scripts yourself (they're present and readable) and run them on a small / non-critical directory to confirm behavior. 4) Avoid running as root or in system directories; back up important data before using --execute or any option that skips confirmation (e.g., --no-confirm). 5) If you want autonomous agent invocation, consider restricting the agent's permissions or disabling autonomous execution to reduce risk of accidental destructive operations.Like a lobster shell, security has layers — review code before you run it.
latest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
File Manager - OpenClaw 自动化文件管理
核心功能
1. 智能文件分类 (organize)
按文件类型、日期、大小或自定义规则自动分类文件。
# 按文件类型分类
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)
支持正则表达式、序列号、日期等模式的重命名。
# 添加前缀/后缀
python scripts/batch_rename.py <pattern> --prefix "IMG_" --suffix "_2024"
# 使用正则替换
python scripts/batch_rename.py "IMG_(\d+)" --replace "Photo_\1"
# 序列号重命名
python scripts/batch_rename.py "*.jpg" --sequence --start 1 --pad 4
3. 重复文件清理 (deduplicate)
基于内容哈希检测并处理重复文件。
# 扫描并列出重复文件
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)
双向或单向目录同步,支持排除模式和增量同步。
# 单向同步 (源 → 目标)
python scripts/sync.py <source> <target> --mirror
# 双向同步
python scripts/sync.py <dir1> <dir2> --bidirectional
# 排除特定文件
python scripts/sync.py <source> <target> --exclude "*.tmp,*.log,.git"
5. 文件监控 (watch)
监控目录变化并触发动作。
# 监控并记录变化
python scripts/watch.py <directory> --log changes.log
# 监控并自动执行命令
python scripts/watch.py <directory> --on-change "python scripts/organize.py {path}"
使用模式
常见场景
场景1: 整理下载文件夹
# 自动分类下载的文件
python scripts/organize.py ~/Downloads --by-type --move
场景2: 清理重复照片
# 找出并删除重复照片,保留高质量版本
python scripts/deduplicate.py ~/Pictures --compare-resolution --keep best
场景3: 批量整理项目文件
# 按日期整理并按类型分类
python scripts/organize.py ./projects --by-date --by-type --date-format year/month
场景4: 自动备份工作目录
# 同步到备份目录,排除临时文件
python scripts/sync.py ~/Work ~/Backups/Work --exclude "node_modules,.git,*.tmp"
工作流
文件整理工作流
- 分析目录结构和文件分布
- 选择分类策略 (类型/日期/大小/自定义)
- 执行整理 (dry-run 预览 → 确认 → 执行)
- 验证结果
清理工作流
- 扫描重复/过期/大文件
- 生成报告并预览
- 用户确认或自动处理
- 移动到回收站/隔离区/直接删除
同步工作流
- 分析源和目标差异
- 处理冲突 (保留新/保留旧/保留两者)
- 执行同步
- 生成同步报告
安全原则
- 预览优先: 所有修改操作默认执行 dry-run,确认后再执行
- 备份保护: 删除操作优先移动到隔离区而非永久删除
- 递归警告: 递归操作需要显式确认
- 日志记录: 所有操作记录到日志文件便于审计
⚙️ 依赖安装与环境初始化
依赖安装
本 skill 依赖以下 Python 包:
pip install tqdm colorama
或使用 requirements.txt(如果存在):
pip install -r requirements.txt
环境要求
- Python 3.8+
- tqdm >= 4.60.0 (进度条)
- colorama >= 0.4.4 (Windows 彩色输出)
脚本参数说明
直接查看脚本帮助获取详细参数:
python scripts/<script>.py --help
Files
8 totalSelect a file
Select a file to preview.
Comments
Loading comments…
