Skip to content

A powerful command-line tool that automatically organizes your files into categorized folders based on their file types. Keep your directories clean and organized with a simple command.

Notifications You must be signed in to change notification settings

nwekeKent/sort-file-cli

Repository files navigation

📂 Sort Files CLI

npm version license install size

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-run mode to preview changes and a --revert flag 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.txt

After:

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

  1. Scanning: The tool identifies all files in your target directory.
  2. Analysis: It checks the file extension against a database of categories.
  3. Execution: It safely moves files into categorized subfolders (creating them if they don't exist).
  4. Cleanup: Empty category folders are removed when you use the --revert command.

🤝 Contributing

Found a bug or have a feature request?

  1. Fork the GitHub Repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. 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

About

A powerful command-line tool that automatically organizes your files into categorized folders based on their file types. Keep your directories clean and organized with a simple command.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published