Preview-first cross-platform file organizer with undo and a Python CLI
Project description
FolderSorter
FolderSorter is a safe, open-source macOS file organizer.
FolderSorter 是一個安全、開源、預覽優先的 macOS 檔案整理器。
Launch and discoverability plan | Roadmap | pip distribution | Changelog | GitHub social preview asset
English
FolderSorter is built for the common file clutter problem: a messy Downloads folder, Desktop, screenshots pile, and random PDFs, ZIPs, DMGs, videos, and images. Unlike tools that immediately move files, FolderSorter previews every operation first and can undo the last cleanup.
Highlights
- Preview-first cleanup: drag files or folders in, inspect the plan, then apply.
- One-click undo: every applied cleanup writes a local transaction record.
- Common Mac defaults: Images, Videos, Documents, Archives, Installers, Audio, Code, and Screenshots.
- Conflict control: automatically rename, skip, or replace same-name files.
- Rules you can read: rules can be imported and exported as JSON.
- GUI + CLI: a simple Mac app for everyday use and a pure Python
foldersorterCLI for automation. - Bilingual interface: follow system language, English, or Traditional Chinese.
- Local-first privacy: no uploads, no analytics, no network feature.
Requirements
- macOS 14 or newer
- Xcode command line tools or Xcode with SwiftPM
Run The App
./script/build_and_run.sh
The generated app bundle is written to:
dist/FolderSorter.app
Install The Cross-Platform CLI With pip
python3 -m pip install foldersorter
foldersorter --help
The pip package is implemented in Python and works on macOS, Windows, and Linux. It does not require Swift, Xcode, or Xcode Command Line Tools.
Use The App
- Open the app.
- Choose an output folder, or use the default Desktop
Cfolder. - Drag in a folder, click
Downloads, clickDesktop, or choose files manually. - Review the preview.
- Click
Start Sortingonly when the plan looks right. - Use
Undoto revert the latest cleanup.
The default mode is copy, so original files stay in place. Move mode is available when you want a real cleanup.
The app includes a language picker with System, English, and 繁體中文.
CLI
Preview only:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C
Apply the preview:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C --apply
Move instead of copy:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C --move --apply
Use exported or example rules:
swift run foldersorter \
--input ~/Downloads \
--output ~/Desktop/C \
--rules Examples/general-mac-cleanup.rules.json
Undo the latest applied cleanup:
swift run foldersorter --undo
Rule Format
Rules are evaluated in order. A rule matches when all filled conditions match. For example, the screenshot rule checks both file extension and filename tokens:
{
"extensionsText": "png, jpg, jpeg",
"nameContainsText": "screenshot, 截圖",
"folderName": "Screenshots"
}
Development
Run tests:
swift test
Build all products:
swift build
Generate app icons:
swift script/generate_icon.swift
Project Positioning
FolderSorter is not trying to clone Hazel. The goal is a safer, simpler, transparent organizer for the broadest Mac audience:
- easier than complex automation tools,
- safer than one-shot cleaners,
- more transparent than closed-source apps,
- more approachable than CLI-only organizers.
Next Priorities
- Downloadable release: ship a
.zipfirst, then.dmg, so users do not need to runswift build. - Stronger GUI rules: add visual conditions for file size, dates, screenshots, duplicates, and broad file types.
- Before / after comparison: show the messy source folder beside the planned organized output.
Help This Project Grow
FolderSorter is positioned as a macOS Downloads cleaner, screenshot organizer, and local-first file management utility for non-technical Mac users first, while still keeping CLI and JSON rules for power users.
- Star or share the repository if the preview-first workflow solves a real cleanup problem.
- Use the included UI screenshot when writing posts or issue discussions.
- Use
Media/foldersorter-social-preview.jpgas the GitHub social preview image. - See
DISCOVERABILITY.mdfor the launch checklist and posting copy.
繁體中文
FolderSorter 解決的是最常見的檔案混亂問題:Downloads 爆滿、桌面塞滿 截圖、PDF、ZIP、DMG、影片、圖片和各種臨時檔。FolderSorter 不會一開始 就移動檔案,而是先產生整理預覽,讓你確認之後再套用;套用後也能復原 上一筆整理。
特色
- 整理前先預覽:拖入檔案或資料夾,先看完整計畫,再決定是否套用。
- 一鍵復原:每次套用整理都會留下本機 transaction 紀錄。
- 一般 Mac 預設分類:Screenshots、Images、Videos、Documents、Archives、Installers、Audio、Code。
- 同名衝突控制:自動改名、略過同名、或取代同名。
- 規則透明:分類規則可以匯入與匯出成 JSON。
- GUI + CLI:一般 Mac 使用者用 SwiftUI app,進階或跨平台使用者可用純 Python
foldersorterCLI。 - 雙語介面:可跟隨系統語言,也可手動選 English 或繁體中文。
- 本機優先隱私:不會上傳檔案、檔名、規則,也沒有分析追蹤。
系統需求
- macOS 14 或更新版本
- Xcode Command Line Tools 或包含 SwiftPM 的 Xcode
執行 App
./script/build_and_run.sh
產生的 app bundle 會放在:
dist/FolderSorter.app
使用 pip 安裝跨平台 CLI
python3 -m pip install foldersorter
foldersorter --help
pip 套件是純 Python CLI,可在 macOS、Windows、Linux 使用,不需要 Swift、 Xcode 或 Xcode Command Line Tools。
使用方式
- 打開 app。
- 選擇輸出資料夾,或使用預設的桌面
C資料夾。 - 拖入資料夾、點
Downloads、點Desktop,或手動選擇檔案。 - 檢查整理預覽。
- 確認計畫沒問題後再按
開始整理。 - 需要回復時按
復原,可復原上一筆整理。
預設模式是複製,所以原始檔案會留在原處。若你想真正清理原資料夾, 可以切換到移動模式。
app 左側有語言選單,可選 System / 跟隨系統、English 或 繁體中文。
CLI
只預覽,不移動或複製檔案:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C
套用預覽:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C --apply
改成移動模式:
swift run foldersorter --input ~/Downloads --output ~/Desktop/C --move --apply
使用匯出的規則或範例規則:
swift run foldersorter \
--input ~/Downloads \
--output ~/Desktop/C \
--rules Examples/general-mac-cleanup.rules.json
復原上一筆已套用的整理:
swift run foldersorter --undo
規則格式
規則會依照順序檢查。每條規則中有填寫的條件都必須符合。 例如截圖規則會同時檢查副檔名和檔名關鍵字:
{
"extensionsText": "png, jpg, jpeg",
"nameContainsText": "screenshot, 截圖",
"folderName": "Screenshots"
}
開發
執行測試:
swift test
建置所有 products:
swift build
產生 app icon:
swift script/generate_icon.swift
專案定位
FolderSorter 不是要複製 Hazel。它的目標是做出更安全、更簡單、更透明, 適合最大多數 Mac 使用者的檔案整理器:
- 比複雜自動化工具更容易上手;
- 比一次性清理工具更安全;
- 比閉源工具更透明;
- 比純 CLI 工具更適合一般使用者。
下一步優先事項
- 可下載版本:先提供
.zip,再補.dmg,讓使用者不需要跑swift build。 - 強化 GUI 規則:加入檔案大小、日期、截圖、重複檔、檔案大類型等視覺化條件。
- 整理前後對照:左邊顯示原始混亂資料夾,右邊顯示預計整理後的輸出結果。
幫助更多人看見
FolderSorter 的定位是給一般 Mac 使用者的 Downloads 清理工具、截圖整理器、 本機優先檔案管理工具;同時保留 CLI 與 JSON 規則給進階使用者。
- 如果預覽優先的整理流程真的解決你的問題,可以 star 或分享這個 repo。
- 寫文章、貼文或 issue 討論時,可以直接使用 repo 內的 UI 展示圖。
Media/foldersorter-social-preview.jpg可作為 GitHub social preview 圖片。DISCOVERABILITY.md裡有 launch checklist 與中英文推廣文案。
License / 授權
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foldersorter-0.2.0.tar.gz.
File metadata
- Download URL: foldersorter-0.2.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2be20a29a190f4e0d72418fb150f6c4fa9c5b1691e5d1e4089b7cc0d21fd7854
|
|
| MD5 |
9e0356c509dae6f9144aae8d94e7dcdf
|
|
| BLAKE2b-256 |
8e5afe46ab3626a302ea57532fd089292e74b6f96f2891ed6ed93553b981a127
|
Provenance
The following attestation bundles were made for foldersorter-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on kodlbegiko/FolderSorter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foldersorter-0.2.0.tar.gz -
Subject digest:
2be20a29a190f4e0d72418fb150f6c4fa9c5b1691e5d1e4089b7cc0d21fd7854 - Sigstore transparency entry: 1839888253
- Sigstore integration time:
-
Permalink:
kodlbegiko/FolderSorter@d15f4f4f48eaf7ff06ec27d19bd5980fca118bdd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kodlbegiko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d15f4f4f48eaf7ff06ec27d19bd5980fca118bdd -
Trigger Event:
release
-
Statement type:
File details
Details for the file foldersorter-0.2.0-py3-none-any.whl.
File metadata
- Download URL: foldersorter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b4252ad2475cfcdcf455b96fd03e2d904fc82165d7cdc531289a8322cf6384a
|
|
| MD5 |
5bf0bf22642d44cda8a2d9004fa860fb
|
|
| BLAKE2b-256 |
93bb812058a72629133b69e11b069dcbbb749324b2f77637c2c4adfa110d9fb3
|
Provenance
The following attestation bundles were made for foldersorter-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on kodlbegiko/FolderSorter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foldersorter-0.2.0-py3-none-any.whl -
Subject digest:
4b4252ad2475cfcdcf455b96fd03e2d904fc82165d7cdc531289a8322cf6384a - Sigstore transparency entry: 1839888265
- Sigstore integration time:
-
Permalink:
kodlbegiko/FolderSorter@d15f4f4f48eaf7ff06ec27d19bd5980fca118bdd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kodlbegiko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d15f4f4f48eaf7ff06ec27d19bd5980fca118bdd -
Trigger Event:
release
-
Statement type: