A configurable Go CLI that organizes files into smart category folders.
It now uses multiple signals to classify files:
- Extension matching (large built-in list)
- Compound extension matching (
.tar.gz,.tar.bz2, etc.) - Filename keyword hints (for files like invoices, screenshots, backups)
- MIME/content sniffing fallback when extension is missing or unclear
- Organizes files into category folders under a target directory
- Handles duplicate filenames safely (
file_(1).ext,file_(2).ext, ...) - Optional recursive mode to process nested folders
- Dry-run mode to preview actions without moving anything
- Verbose plan output and end-of-run summary stats
Built-in categories include:
imagesvideosmusicdocspresentationsspreadsheetsarchivescodeinstallersfonts- Keyword-only buckets:
finance,screenshots,design,certificates,backups - Fallback:
others
- Go
1.26.1(or any compatible local Go toolchain)
Basic run:
go run .With flags:
go run . --dir sort --recursive --dry-run--dir(default:sort): directory to organize--recursive(default:false): process files in subfolders too--dry-run(default:false): show what would happen without moving files--verbose(default:true): print per-file action plan
For each file, SortyMcSortFace uses this order:
- Compound extension (
.tar.gz,.tar.bz2,.tar.xz,.tar.zst) - Normal extension lookup (e.g.,
.png,.mp3,.xlsx,.go) - Filename keyword hints (
invoice,screenshot,backup, etc.) - Content-type sniffing (first 512 bytes via MIME detection)
- Fallback to
others
Input:
sort/
IMG_4102
invoice_march.pdf
project_backup_2026
archive.tar.gz
design_mockup_final
Command:
go run . --dir sort --dry-runPossible result plan:
Plan: sort/IMG_4102 -> sort/images/IMG_4102
Plan: sort/invoice_march.pdf -> sort/docs/invoice_march.pdf
Plan: sort/project_backup_2026 -> sort/backups/project_backup_2026
Plan: sort/archive.tar.gz -> sort/archives/archive.tar.gz
Plan: sort/design_mockup_final -> sort/design/design_mockup_final
-
Auto-watch mode Use
fsnotifyto watch the folder and sort files instantly as they arrive. -
Rule profiles Add
profiles/work.json,profiles/media.json,profiles/dev.jsonand switch with--profile. -
AI-assisted categorization For ambiguous files, call an LLM with filename + extracted text to choose the best category.
-
Semantic duplicate detection Hash files to detect duplicates and move them to
duplicates/instead of keeping copies. -
Time-based organization Add optional destination patterns like
images/2026/04ordocs/2026-Q2. -
OCR and document intelligence Extract text from scanned PDFs/images, then auto-route contracts/invoices/resumes to custom folders.
-
Undo log Write a JSON transaction log for every run and support
--undo last. -
Smart conflict naming Use rich conflict patterns like
file (from Downloads, 2026-04-17).ext. -
Dashboard mode Expose a tiny local web UI to show category counts, trends, and recent moves.
-
Cross-device sync helper After sorting, auto-mirror selected categories to cloud folders (Drive/Dropbox/S3).
- The tool moves files (rename), it does not copy.
- In
--dry-run, nothing on disk changes. - If a file is already in its target folder, it is skipped.