A sleek, powerful command-line tool that automatically organizes your messy directories into beautiful, categorized folders based on file types.
- 🚀 Instant Organization: Sort hundreds of files in milliseconds.
- 📂 Smart Categorization: Automatically groups files into Images, Videos, Code, Documents, and more.
- � Safety First: Includes a
--dry-runmode to preview changes and a--revertflag to undo everything. - ⚡ Modern UI: Beautiful terminal output with progress spinners and color-coded feedback.
- � Developer Ready: Supports common programming extensions like JS, PY, GO, TS, and more.
Before:
Downloads/
├── vacation.jpg
├── report.pdf
├── script.py
├── archive.zip
└── notes.txt
After:
Downloads/
├── 📸 images/vacation.jpg
├── 📄 documents/report.pdf, notes.txt
├── 💻 code/script.py
└── 📦 archives/archive.zip
Install the tool globally using npm:
npm install -g sort-files-cli# Sort the current directory
sort-files
# Sort a specific folder
sort-files ~/Downloads
# Preview changes without moving any files (Highly Recommended!)
sort-files --dry-run
# Oops! Revert everything back to how it was
sort-files --revert| Flag | Description |
|---|---|
-d, --dry-run |
Preview changes without moving files |
-r, --revert |
Revert files back to their original location |
-h, --help |
Display help information |
-V, --version |
Display version number |
| Category | Icon | Extensions |
|---|---|---|
| Images | 📸 | jpg, png, gif, svg, webp, ico, raw ... |
| Videos | 🎥 | mp4, mov, avi, mkv, webm ... |
| Documents | 📄 | pdf, docx, txt, xlsx, pptx, csv ... |
| Code | 💻 | js, py, html, css, ts, go, json, md ... |
| Archives | 📦 | zip, rar, 7z, tar, gz, iso ... |
| Music | 🎵 | mp3, wav, flac, m4a, aac ... |
| E-books | 📚 | epub, mobi, azw3, fb2 |
| Executables | ⚙️ | exe, dmg, pkg, app, sh, bin |
| Fonts | 🔡 | ttf, otf, woff, woff2 |
- Scanning: The tool identifies all files in your target directory.
- Analysis: It checks the file extension against a database of categories.
- Execution: It safely moves files into categorized subfolders (creating them if they don't exist).
- Cleanup: Empty category folders are removed when you use the
--revertcommand.
Found a bug or have a feature request?
- Fork the GitHub Repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
Author: Tochukwu Nweke
Project Link: https://github.com/nwekeKent/sort-file-cli