smart-file-organizer
v2.0.0
Published
Intelligent CLI tool for automatically organizing files by type with preview, logging, and undo functionality
Maintainers
Readme
🗂️ Smart File Organizer
An intelligent CLI tool that automatically organizes your files by type with preview functionality, detailed logging, and smart categorization.
✨ Features
- 🔍 Preview Mode - See what will happen before making changes
- 📁 Smart Categorization - Automatically sorts 50+ file types into logical folders
- 📝 Detailed Logging - Track all operations with timestamps
- ⚡ Fast & Efficient - Process hundreds of files in seconds
- 🛡️ Safe Operation - Confirms before making changes, excludes system files
- 🎯 Customizable - Configure your own file type rules
- 📊 Statistics - See exactly what was moved and created
🚀 Quick Start
Installation
# Install globally via npm
npm install -g smart-file-organizer
# Or run directly with npx
npx smart-file-organizerBasic Usage
# Organize current folder
organize-files
# Preview changes first
organize-files --preview
# Organize specific folder
organize-files ~/Downloads
# Show help
organize-files --help📖 Usage Examples
Organize Downloads Folder
organize-files ~/Downloads --preview
# Preview what will happen, then:
organize-files ~/DownloadsOrganize Desktop with Preview
organize-files ~/Desktop -pGet Help
organize-files --help📁 File Categories
The organizer automatically sorts files into these categories:
| Category | File Types |
| --------------------- | ----------------------------------------------------- |
| 📸 bilder | .jpg, .png, .gif, .svg, .webp, .tiff |
| 📄 dokumenter | .pdf, .doc, .docx, .txt, .rtf, .odt |
| 📊 regneark | .xls, .xlsx, .csv, .ods |
| 📽️ presentasjoner | .ppt, .pptx, .odp |
| 🎵 lyd | .mp3, .wav, .flac, .aac, .ogg, .m4a |
| 🎬 video | .mp4, .avi, .mkv, .mov, .wmv, .webm |
| 📦 arkiv | .zip, .rar, .7z, .tar, .gz, .bz2 |
| 💻 kode | .js, .ts, .html, .css, .py, .java, .cpp |
| 📚 ebook | .epub, .mobi, .azw, .fb2 |
| 🔤 font | .ttf, .otf, .woff, .woff2 |
| 📂 andre | All other file types |
🛠️ Command Line Options
| Option | Short | Description |
| ----------- | ----- | -------------------------------------------- |
| --preview | -p | Show what will happen without making changes |
| --help | -h | Display help information |
| --config | -c | Show current configuration |
📝 Logging
All operations are logged to file-organizer.log with timestamps:
[2025-01-15T10:30:15.123Z] INFO: Opprettet mappe: bilder
[2025-01-15T10:30:15.456Z] INFO: Flyttet: vacation.jpg til bilder/
[2025-01-15T10:30:15.789Z] INFO: Flyttet: report.pdf til dokumenter/🔧 Configuration
Create a file-organizer.config.json file to customize categories:
{
"categories": {
"mine-bilder": [".jpg", ".png", ".heic"],
"mine-dokumenter": [".pdf", ".docx"]
},
"excludeFiles": ["important.txt"],
"logFile": "my-organizer.log"
}📊 Example Output
🗂️ File Organizer CLI v1.0
============================
🔍 Organiserer: /Users/username/Downloads
📋 Oversikt over endringer:
📁 bilder/ (15 filer)
• vacation-photo1.jpg
• screenshot.png
• logo.svg
... og 12 til
📁 dokumenter/ (8 filer)
• report.pdf
• invoice.docx
• notes.txt
... og 5 til
❓ Vil du fortsette? (y/N): y
🚀 Starter organisering...
📄 vacation-photo1.jpg → bilder/
📄 report.pdf → dokumenter/
📄 song.mp3 → lyd/
✅ Organisering fullført!
📊 Statistikk:
• Filer flyttet: 23
• Mapper opprettet: 4
• Feil: 0
• Tid brukt: 0.15s🧪 Development
Prerequisites
- Node.js 16+
- npm or yarn
Setup
git clone https://github.com/yourusername/smart-file-organizer.git
cd smart-file-organizer
npm installTesting
npm testLocal Development
npm run dev🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- 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
🐛 Issues
Found a bug? Have a feature request? Please open an issue.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with ❤️ using Node.js
- Inspired by the need for better file organization
- Thanks to the Node.js community
⭐ Show your support
Give a ⭐️ if this project helped you organize your files!
Made with 💻 and ☕ by Marcus
