← 返回
未分类 中文

File Organizer

Scan, deduplicate, and organize files in a directory by type, generating a dry-run plan before optionally moving files without deleting anything.
扫描、去重并按类型整理目录中的文件,生成预览计划后可选择性地移动文件,不删除任何文件。
newageinvestments25-byte newageinvestments25-byte 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 363
下载
💾 5
安装
1
版本
#latest

概述

File Organizer

Scans a target directory, categorizes files by type, finds duplicates, and generates (or executes) a cleanup plan. Dry-run by default — always shows what will happen before doing it.

Scripts

All scripts live in scripts/. Run with python3. No third-party dependencies.

ScriptPurpose
-----------------
scan.pyWalk a directory, output JSON inventory
find_duplicates.pyFind duplicate files by content hash
organize.pyGenerate and optionally execute a move plan
manifest.pyProduce a markdown before/after manifest

Category mappings (extension → folder) are in references/categories.md. Read it if asked about supported file types or to customize mappings.

Typical Workflow

1. Scan the directory

python3 scripts/scan.py ~/Downloads --output /tmp/scan.json

Add --hash to pre-compute hashes (needed for duplicate detection without a separate pass).

2. Find duplicates (optional)

python3 scripts/find_duplicates.py /tmp/scan.json --output /tmp/dupes.json

Or scan and deduplicate in one step:

python3 scripts/find_duplicates.py --directory ~/Downloads

3. Generate organization plan (dry run)

python3 scripts/organize.py /tmp/scan.json --output /tmp/plan.json

Or scan + plan in one step:

python3 scripts/organize.py --directory ~/Downloads

Key flags:

  • --dest ~/Downloads/Organized — custom destination (default: /Organized/)
  • --flat — don't preserve subdirectory structure
  • --dry-run — default, shows plan without moving anything
  • --execute — actually move files (prompts for confirmation)
  • --execute --yes — skip confirmation prompt

4. Execute the plan

python3 scripts/organize.py /tmp/scan.json --execute
# or skip the prompt:
python3 scripts/organize.py /tmp/scan.json --execute --yes

5. Generate manifest

# From plan JSON
python3 scripts/manifest.py --plan /tmp/plan.json --output /tmp/manifest.md

# Before/after comparison (run scan.py twice)
python3 scripts/manifest.py --before /tmp/before.json --after /tmp/after.json --output /tmp/diff.md

# Simple inventory
python3 scripts/manifest.py --scan /tmp/scan.json --output /tmp/inventory.md

Safety Rules

  • organize.py never deletes files — only moves them
  • Dry-run is the default; --execute must be explicit
  • Symlinks are skipped (never moved)
  • Destination conflicts are flagged in the plan and skipped during execution (unless --yes)
  • Hidden files/dirs (.dotfiles) are skipped by default; use --include-hidden to include them

Common Scenarios

"Clean up my Downloads folder"

→ Run scan + organize dry-run, show the plan summary, ask user to confirm before executing.

"Find duplicate files in my Desktop"

→ Run find_duplicates.py --directory ~/Desktop, report groups sorted by wasted space.

"Organize my files and save a report"

→ Run scan → organize (dry-run) → confirm → organize (execute) → manifest to markdown.

"What file types are supported?"

→ Read references/categories.md and summarize the category mappings.

Output Locations

Default destination for organized files: /Organized/

Subfolders are created per category: Images/, Documents/, Videos/, etc.

Files with unrecognized extensions go to Other/.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 18:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 57 📥 85,259
ai-agent

Workflow Crystallizer

newageinvestments25-byte
分析记忆日志,检测重复出现的模式,并建议自动化(cron 任务、技能或工作流快捷方式)。代理会逐步构建自己的快捷方式。
★ 0 📥 510
life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 244 📥 30,711