sort-files-cli
v1.1.2
Published
A CLI tool to sort files into predefined categories
Maintainers
Readme
📂 Sort Files CLI
A sleek, powerful command-line tool that automatically organizes your messy directories into beautiful, categorized folders based on file types.
✨ Features
- 🚀 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 & After
Before:
Downloads/
├── vacation.jpg
├── report.pdf
├── script.py
├── archive.zip
└── notes.txtAfter:
Downloads/
├── 📸 images/vacation.jpg
├── 📄 documents/report.pdf, notes.txt
├── 💻 code/script.py
└── 📦 archives/archive.zip🛠 Installation
Install the tool globally using npm:
npm install -g sort-files-cli🚀 Usage
Basic Commands
# 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🎛 Options
| 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 |
📁 Supported Categories
| 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 |
🛡 How It Works
- 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.
🤝 Contributing
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.
📄 License
Distributed under the MIT License. See LICENSE for more information.
Author: Tochukwu Nweke
Project Link: https://github.com/nwekeKent/sort-file-cli
