A simple Python command-line tool to organize files in a directory into categorized subfolders based on their file extensions.
- Automatic categorization: Moves files into folders like
Images,Documents,Videos,Audio,Archives,Code, andOthers. - Dry run mode: Preview what will happen before making changes.
- Verbose output: See detailed information about each operation.
- Easy to use: Just point it at a folder and go!
Clone this repository:
git clone https://github.com/yourusername/file-organizer-cli.git
cd file-organizer-cli(Optional but recommended) Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activateInstall dependencies (if any):
pip install -r requirements.txtFrom the project root, run:
PYTHONPATH=src python3 -m file_organizer.cli /path/to/your/folderOptions:
--dry-run: Show what would be done, but don’t move any files.-vor--verbose: Enable detailed output.
Examples:
Preview what would happen in your Downloads folder:
PYTHONPATH=src python3 -m file_organizer.cli ~/Downloads --dry-run -vActually organize your Downloads folder:
PYTHONPATH=src python3 -m file_organizer.cli ~/Downloads -vFiles are sorted into these folders by default:
- Images:
.jpg,.jpeg,.png,.gif,.bmp,.tiff,.webp - Documents:
.pdf,.doc,.docx,.txt,.rtf,.odt,.xls,.xlsx,.ppt,.pptx - Videos:
.mp4,.mov,.avi,.mkv,.flv,.wmv - Audio:
.mp3,.wav,.flac,.aac,.ogg - Archives:
.zip,.rar,.7z,.tar,.gz - Code:
.py,.cpp,.h,.java,.js,.html,.css - Others: Anything else
Pull requests and suggestions are welcome!
Feel free to open an issue or submit a PR.
This project is licensed under the MIT License.
Questions or suggestions?
Open an issue or contact yourusername.