Complete guide to using Sortora from the command line.
When you run sortora without any arguments, you'll see an animated banner with gradient colors:
███████╗ ██████╗ ██████╗ ████████╗ ██████╗ ██████╗ █████╗
██╔════╝██╔═══██╗██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗██╔══██╗
███████╗██║ ██║██████╔╝ ██║ ██║ ██║██████╔╝███████║
╚════██║██║ ██║██╔══██╗ ██║ ██║ ██║██╔══██╗██╔══██║
███████║╚██████╔╝██║ ██║ ██║ ╚██████╔╝██║ ██║██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Smart Offline File Organizer
───────────────────────────────────────────────────────
v1.1.1
The banner features:
- Line-by-line animated reveal
- Cyan-to-blue gradient colors
- Typewriter effect for the tagline
- Version display
sortora [command] [options]| Command | Description |
|---|---|
sortora |
Show animated banner and help menu |
sortora setup |
Initialize Sortora and download AI models |
sortora scan <path> |
Scan directory and analyze files |
sortora organize <path> |
Organize files based on rules |
sortora watch <path> |
Monitor directory for new files |
sortora duplicates <path> |
Find and manage duplicate files |
sortora undo |
Undo recent operations |
sortora rules |
Manage organization rules |
Initialize Sortora and optionally download AI models.
# Full setup with AI models (~100 MB)
sortora setup
# Minimal setup without AI
sortora setup --minimal
# Full setup with all OCR languages
sortora setup --full- Creates configuration directory (
~/.config/sortora/) - Initializes SQLite database
- Downloads AI models (unless
--minimal):- Embedding model (MiniLM ~23 MB)
- Classifier model (MobileBERT ~25 MB)
- OCR engine (Tesseract ~15 MB)
Scan a directory and analyze files without making changes.
sortora scan <path> [options]| Option | Description |
|---|---|
-d, --deep |
Scan subdirectories recursively |
--duplicates |
Calculate file hashes to find duplicates |
--ai |
Use AI for smart classification |
--json |
Output results as JSON |
# Basic scan
sortora scan ~/Downloads
# Recursive scan with AI
sortora scan ~/Documents -d --ai
# Scan and find duplicates
sortora scan ~/Pictures --duplicates
# Export to JSON
sortora scan ~/Downloads --json > scan-results.jsonThe scan command displays:
- Total files found
- File categories breakdown
- Size statistics
- AI classifications (if
--aienabled) - Duplicate groups (if
--duplicatesenabled)
Organize files based on smart rules and AI classification.
sortora organize <path> [options]| Option | Description |
|---|---|
-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 |
--confidence <n> |
Minimum confidence for auto mode (0-1) |
Files are organized within the target directory:
sortora organize ~/Downloads
# Result:
# ~/Downloads/Documents/
# ~/Downloads/Code/
# ~/Downloads/Screenshots/Files are moved to system directories:
sortora organize ~/Downloads --global
# Result:
# ~/Documents/...
# ~/Pictures/...
# ~/Projects/...# Preview what will happen
sortora organize ~/Downloads --dry-run
# Interactive mode - confirm each action
sortora organize ~/Downloads -i
# Automatic mode with high confidence threshold
sortora organize ~/Downloads --auto --confidence 0.9
# Deep scan with global destinations
sortora organize ~/Documents -d --globalWhen running with -i or --interactive:
- Accept: Apply the suggested action
- Skip: Skip this file
- Edit destination: Manually specify destination
- Quit: Stop processing
Monitor a directory for new files and organize them automatically.
sortora watch <path> [options]| Option | Description |
|---|---|
--auto |
Automatically organize new files |
# Watch and suggest
sortora watch ~/Downloads
# Watch and auto-organize
sortora watch ~/Downloads --autoPress Ctrl+C to stop watching.
Find and manage duplicate files.
sortora duplicates <path> [options]| Option | Description |
|---|---|
--clean |
Remove duplicates interactively |
# Find duplicates
sortora duplicates ~/Pictures
# Find and clean duplicates
sortora duplicates ~/Documents --cleanThe command shows:
- Number of duplicate groups
- Total space that could be freed
- List of duplicate files
Undo recent file operations.
sortora undo [options]| Option | Description |
|---|---|
--all |
Show all recent operations |
--id <id> |
Undo specific operation by ID |
# Undo last operation
sortora undo
# Show operation history
sortora undo --all
# Undo specific operation
sortora undo --id 42Manage organization rules.
sortora rules [action] [file]| Action | Description |
|---|---|
list |
List all active rules |
add |
Add a new custom rule |
test <file> |
Test which rule matches a file |
edit |
Open rules file in editor |
# List all rules
sortora rules list
# Test a specific file
sortora rules test ~/Downloads/report.pdf
# Add new rule interactively
sortora rules add
# Edit rules file
sortora rules editThese options work with all commands:
| Option | Description |
|---|---|
-V, --version |
Show version number |
-h, --help |
Show help for command |
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error occurred |
| Variable | Description |
|---|---|
SORTORA_CONFIG_DIR |
Custom config directory |
SORTORA_DATA_DIR |
Custom data directory |
SORTORA_NO_AI |
Disable AI features |
EDITOR |
Editor for rules edit |
Always use --dry-run first to see what will happen:
sortora organize ~/Downloads --dry-run# Organize and log results
sortora organize ~/Downloads --auto 2>&1 | tee organize.log
# Watch for new files in background
sortora watch ~/Downloads --auto &Use higher confidence in auto mode for more accurate results:
sortora organize ~/Downloads --auto --confidence 0.95For nested directories:
sortora organize ~/Projects -d- Configuration - Customize settings
- Rules System - Create custom rules
- AI Features - Enable smart classification