Smart offline file organizer with AI-powered classification
Features β’ Installation β’ Quick Start β’ Commands β’ Docs
Sortora is an intelligent CLI tool that automatically organizes your files using smart filename analysis and optional AI classification. It works 100% offline - no cloud services, no data leaving your machine.
ββββββββ βββββββ βββββββ βββββββββ βββββββ βββββββ ββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββ βββββββββββ βββ βββ βββββββββββββββββββ
βββββββββββ βββββββββββ βββ βββ βββββββββββββββββββ
ββββββββββββββββββββ βββ βββ ββββββββββββ ββββββ βββ
ββββββββ βββββββ βββ βββ βββ βββββββ βββ ββββββ βββ
Smart Offline File Organizer
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Organize your Downloads folder
sortora organize ~/Downloads
# Preview what will happen (dry run)
sortora organize ~/Downloads --dry-runBefore:
~/Downloads/
βββ Contract_Acme_Inc_2025.pdf
βββ Invoice_GlobalTech_January_2025.pdf
βββ John-Smith-Resume.docx
βββ react-components.tsx
βββ api-server.py
βββ Screenshot_2025-01-15.png
βββ ... 50 more files
After:
~/Downloads/
βββ Contracts/
β βββ Acme Inc/
β βββ 2025/
β βββ Contract_Acme_Inc_2025.pdf
βββ Finance/
β βββ Invoices/
β βββ GlobalTech/
β βββ Invoice_GlobalTech_January_2025.pdf
βββ Documents/
β βββ Resumes/
β βββ John Smith/
β βββ John-Smith-Resume.docx
βββ Code/
β βββ React/
β β βββ Components/
β β βββ react-components.tsx
β βββ Python/
β βββ api-server.py
βββ Screenshots/
βββ 2025-01/
βββ Screenshot_2025-01-15.png
- Animated startup banner with gradient colors
- Progress indicators for all operations
- Colored output for easy reading
- Interactive mode with intuitive prompts
- Extracts company names:
Contract_Acme_Inc.pdfβContracts/Acme Inc/ - Extracts person names:
John-Smith-Resume.pdfβResumes/John Smith/ - Detects document types: contracts, invoices, resumes, reports
- Recognizes dates: organizes by year/month from filename
- Groups by language: Python, JavaScript, Go, Rust, etc.
- Detects file type: components, configs, utils, tests, styles
- Framework awareness: React, Vue, Svelte components
- Zero-shot classification using MobileBERT
- Semantic embeddings using MiniLM
- OCR support for scanned documents
- 100% offline - models run locally
- Dry run mode - preview changes before applying
- Interactive mode - confirm each action
- Undo support - rollback any operation
- Trash integration - deleted files go to trash
# Install globally
npm install -g sortora
# Run setup to download AI models (optional)
sortora setup- Node.js 18 or higher
- ~100 MB disk space for AI models (optional)
# Just run sortora to see the animated banner and help
sortorasortora scan ~/Downloadssortora organize ~/Downloads --dry-run# Interactive mode (confirm each action)
sortora organize ~/Downloads -i
# Auto mode (apply all suggestions)
sortora organize ~/Downloads --auto| Command | Description |
|---|---|
sortora |
Show animated banner and help |
sortora setup |
Initial setup, download AI models |
sortora scan <path> |
Scan and analyze files |
sortora organize <path> |
Organize files based on rules |
sortora watch <path> |
Watch folder and auto-organize |
sortora duplicates <path> |
Find duplicate files |
sortora undo |
Undo last operation |
sortora rules list |
List all rules |
sortora organize <path> [options]
Options:
-d, --deep Scan subdirectories recursively
--dry-run Preview changes without applying
-i, --interactive Confirm each action
--auto Apply all suggestions automatically
--global Move files to global destinations (~/Documents, etc.)
--confidence <n> Minimum confidence for auto mode (0-1)Local Mode (default) Files are organized within the target directory:
sortora organize ~/Downloads
# Creates: ~/Downloads/Documents/, ~/Downloads/Code/, etc.Global Mode Files are moved to system directories:
sortora organize ~/Downloads --global
# Moves to: ~/Documents/, ~/Pictures/, ~/Projects/, etc.| Type | Extensions | Smart Sorting |
|---|---|---|
| Contracts | pdf, docx | Contracts/{Company}/{Year}/ |
| Invoices | Finance/Invoices/{Company}/ |
|
| Resumes | pdf, docx | Documents/Resumes/{Name}/ |
| Reports | xlsx, pdf | Documents/Reports/{Year}/ |
| Presentations | pptx, key | Documents/Presentations/ |
| Language | Extensions | Smart Sorting |
|---|---|---|
| JavaScript/TypeScript | js, ts, jsx, tsx | Code/{Language}/{Type}/ |
| Python | py | Code/Python/ |
| Go | go | Code/Go/ |
| Vue/React/Svelte | vue, jsx, tsx | Code/{Framework}/Components/ |
| Config | json, yaml, toml | Code/Config/ |
| SQL | sql | Code/Database/ |
| Type | Extensions | Smart Sorting |
|---|---|---|
| Screenshots | png, jpg | Screenshots/{Year}-{Month}/ |
| Photos | jpg, heic, raw | Photos/{Year}/{Month}/ |
| Music | mp3, flac | Music/{Artist}/{Album}/ |
| Video | mp4, mkv | Videos/{Year}/ |
Config file location: ~/.config/sortora/config.yaml
version: 1
settings:
mode: suggest # or 'auto'
confirmDestructive: true
ignoreHidden: true
ignorePatterns:
- "*.tmp"
- ".DS_Store"
destinations:
photos: ~/Pictures/Sorted
documents: ~/Documents/Sorted
code: ~/Projects
music: ~/Music/Sorted| Feature | Sortora | Others |
|---|---|---|
| Works offline | Yes | Often require cloud |
| Smart filename analysis | Yes | Basic patterns |
| AI classification | Yes (optional) | Rarely |
| Code file support | Yes | No |
| Multi-language filenames | Yes | Often EN only |
| Undo support | Yes | Rarely |
| Beautiful CLI | Yes | Basic |
| Open source | Yes | Often paid |
Contributions are welcome! Please read our Contributing Guide.
# Clone the repo
git clone https://github.com/d1maash/sortora.git
# Install dependencies
npm install
# Run in development
npm run dev
# Build
npm run build
# Test
npm testMIT License - see LICENSE for details.
Made with care for your messy folders