A high-performance CLI tool for organizing messy directories. It detects duplicate files by content, categorizes files by type, and cleans up disk space.
-
🔍 Deep Duplicate Detection: Calculates MD5/SHA-256 hashes to find identical files even if they have different names (e.g.,
thesis.pdfandthesis (1).pdf). -
📂 Smart Categorization: Automatically sorts files into clean, logical folder structures:
Images/,Documents/,Videos/,Audio/,Archives/,Code/,Applications/
-
🛡️ Dry-Run Safety First: Runs in "Simulation Mode" by default. It shows you exactly what would happen without touching a single file until you say so.
-
⚡ High Performance: Powered by Kotlin Coroutines and Java NIO to process thousands of files concurrently.
-
💥 Collision Handling: Smartly renames files (
file_1.jpg) to prevent data loss during organization.
- Java JDK 21 installed.
Clone the repository and build the project using the Gradle Wrapper:
git clone https://github.com/eyuppastirmaci/strata-optima.git
cd strata-optima
./gradlew buildTo run strataoptima from any terminal window without using Gradle, follow these steps:
First, create the executable files:
./gradlew installDistThis creates the binaries in build/install/StrataOptima.
- Move the generated folder
build\install\StrataOptimato a permanent location (e.g.,C:\Tools\StrataOptima). - Add the
binfolder path (e.g.,C:\Tools\StrataOptima\bin) to your System PATH environment variable.- Search "Edit the system environment variables" -> Environment Variables -> System variables -> Path -> Edit -> New.
- Restart your terminal (PowerShell/CMD).
- Move the generated folder to a permanent location:
mv build/install/StrataOptima $HOME/strataoptima- Add the
bindirectory to your PATH in.bashrcor.zshrc:
export PATH="$HOME/strataoptima/bin:$PATH"- Refresh your shell configuration:
source ~/.bashrc # or source ~/.zshrcOnce installed globally, you can run the tool from anywhere:
View available commands and options:
strataoptima --helpScan a directory to see statistics, identify duplicates, and calculate wasted disk space without moving any files.
strataoptima analyze --path "C:\Users\User\Downloads"Example Output:
Analyzing: C:\Users\User\Downloads
Analysis Results
----------------
Total files: 5,790
Total size: 13.96 GB
Duplicates
----------
Duplicate groups: 299
Duplicate files: 396
Wasted space: 251.61 MB
Sorts files into categorized folders.
How it works:
- If you specify a
--targetdirectory, files will be moved to that location. - If you don't specify
--target, the program creates anorganizedfolder inside the source directory and moves files there.
By default, this command will not move files. It simulates the operation and reports what would happen.
Without target (default behavior):
strataoptima organize --path "C:\Users\User\Downloads"With custom target:
strataoptima organize --path "C:\Users\User\Downloads" --target "C:\Users\User\Desktop\Archive"Output Preview:
Mode: DRY-RUN (simulation only)
Source: .../Downloads
Target: .../Downloads/organized
[->] holiday.jpg -> Images\holiday.jpg
[->] invoice.pdf -> Documents\invoice.pdf
[->] setup.exe -> Applications\setup.exe
Summary
-------
Would organize: 5790 files
Run with --execute to apply these changes
To actually move the files and organize your disk, add the --execute flag.
Example 1: Organize to a custom target directory
strataoptima organize --path "C:\Users\User\Downloads" --target "C:\Users\User\Desktop\Archive" --executeOr using short flags:
strataoptima organize -p "C:\Users\User\Downloads" -t "C:\Users\User\Desktop\Archive" -eExample 2: Organize to default location (creates organized folder in source)
strataoptima organize --path "C:\Users\User\Downloads" --executeNote: If you haven't installed the tool globally, replace strataoptima with ./gradlew run --args="..." in the commands above.
StrataOptima is built with a focus on clean architecture and type safety.
- Language: Kotlin (1.9+)
- Concurrency: Kotlin Coroutines
- CLI Framework: Clikt
The project includes a comprehensive test suite covering file detection, hashing algorithms, and organization logic.
# Run all tests
./gradlew test
# Run with verbose logging
./gradlew test --info- HTML Report - Generate detailed HTML reports with charts and statistics
- Delete Duplicates - Option to automatically remove duplicate files (
--delete-copies) - Undo Support - Revert the last organize operation
- Filter by Size - Process only files within a size range (
--min-size,--max-size) - Filter by Date - Process files modified within a date range (
--after,--before) - Filter by Extension - Process only specific file types (
--include "*.jpg,*.png") - Exclude Patterns - Skip files/folders matching patterns (
--exclude "node_modules") - Progress Bar - Visual progress indicator for large directories
- Watch Mode - Monitor a folder and auto-organize new files (
--watch) - Custom Rules - User-defined organization rules via config file
- JSON Export - Export analysis results as JSON (
--output results.json) - Interactive Mode - Prompt for confirmation on each file (
--interactive) - Empty Folder Cleanup - Remove empty directories after organizing
- Large File Finder - List the largest files in a directory (
--top 10) - Config File Support - Save preferences in
.strataoptima.yml - Semantic Organization - Content-aware file organization using local CLIP model
- Organization Modes - Choose how files are organized (
--mode):categorical- By file extension only (current default behavior)semantic- By content using local AI/CLIP model (e.g.,Images/Dogs/,Documents/Invoices/)hybrid- Categorical first, then semantic subcategories (e.g.,Images/Animals/Dogs/)
