AI-powered intelligent file organizer.
Crafted with Kilo Code, GitHub Copilot, Claude Web, and the strategic guidance of a human developer.
Quick Start β’ Usage Guide β’ Vibe Coding Methodology β’ Report Issues
Sortoi is an intelligent CLI tool that uses Google Gemini AI to automatically categorize and organize your files. Beyond simple file extensions, it understands content and context to create meaningful, hierarchical folder structures.
![]() |
![]() |
| π― Interactive Mode - Guided Setup | π€ AI Categorizing Your Files |
- π Home Users: Tame your chaotic Downloads folder in seconds
- πΌ Professionals: Organize projects, assets, and archives intelligently
- π¨ Creators: Sort media files by content, not just extension
- π§ AI-Powered: Uses Google Gemini 2.0 Flash for deep file understanding
- π Smart Organization: Creates Category/Subcategory folder structures
- β‘ Lightning Fast: Complete analysis in seconds with caching
- π‘οΈ Safe by Default: Dry-run mode lets you preview before moving
- π Undo System: Full history tracking with one-command rollback
- π― Two Modes: Interactive (guided) or CLI (advanced)
- π Forever Free: No sign-up, just your Google AI API key
Node.js 18+ | pnpm or npm | Google AI API keyGet your API key: Google AI Studio
# Global installation (recommended)
npm install -g sortoi
# Or with pnpm
pnpm add -g sortoi# Interactive mode (easiest)
sortoi
# The tool will guide you through:
# 1. Enter your Google AI API key
# 2. Select directory to organize
# 3. Choose preview or live mode
# 4. Watch the magic happen β¨Just run sortoi and follow the prompts:
sortoiWhat you'll do:
- π Select Directory: Enter path like
C:\Users\YourName\Downloads - π― Choose Mode: Preview (safe) or Live (organize now)
- π Configure: Enable subcategories, caching
- β¨ Watch: AI categorizes and organizes your files
Example:
π Welcome to Sortoi
π Directory path: C:\Users\Milumon\Downloads
π― Mode: 1. Preview (safe) or 2. Live
Select: 1
π Scanning... Found 42 files
οΏ½ Analyzing with AI...
β¨ Preview - Would organize:
invoice.pdf β Documents/Invoices/
vacation.jpg β Images/Photos/
tutorial.mp4 β Videos/Educational/
Direct commands for advanced workflows:
# Organize directory
sortoi /path/to/folder
# Preview first (safe)
sortoi ~/Downloads --dry-run
# Flat structure (no subcategories)
sortoi ~/Documents --no-subcategories
# With custom cache database
sortoi ~/Projects --db ./my-cache.db# History & Rollback
sortoi history list # View all sessions
sortoi history show <session-id> # Details of a session
sortoi history rollback <session-id> # Undo organization
# Verbose logging
sortoi ~/Downloads --verbose
# JSON output (for scripts)
sortoi ~/Downloads --jsonsortoi [directory] [options]
Arguments:
directory Path to organize
Options:
-V, --version Version number
-i, --interactive Interactive mode (guided)
-d, --db <path> Cache database path
--no-subcategories Flat structure (Category only)
--dry-run Preview without moving files
--verbose Detailed logging
--json JSON output
-h, --help Show help
History Commands:
sortoi history list List all sessions
sortoi history show <id> Show session details
sortoi history rollback <id> Undo organization
sortoi ~/Downloads --dry-runOutput:
π Found 15 files
DRY RUN - Would organize:
invoice-2024.pdf β Documents/Invoices/
beach.jpg β Images/Photos/
tutorial.mp4 β Videos/Educational/
sortoi ~/Documents --db ~/cache.dbBenefit: 10x faster on re-runs, only analyzes changed files
sortoi ~/Projects --no-subcategoriesResult: Files sorted into main categories only (no subcategories)
# Organize
sortoi ~/Downloads
# Oops! Undo it
sortoi history list
sortoi history rollback <session-id>sortoi ~/Downloads --json > results.jsonUse case: Integrate with other tools, scripts, or dashboards
Built with production-ready technologies:
- TypeScript 5 - End-to-end type safety
- Google Gemini AI 2.0 Flash - Intelligent categorization
- SQLite - Smart caching with hash validation
- Clean Architecture - SOLID principles, scalable structure
- Node.js 22 - Modern runtime with ESM support
- Scan: Reads all files in the directory
- Hash: Generates SHA-256 hash for cache validation
- Analyze: AI categorizes files (or uses cached result)
- Organize: Creates folder structure and moves files
- Track: Records operation in history for rollback
Smart Caching: Only re-analyzes files that changed (hash mismatch)
MIT License - Open Source
Sortoi is free and open source software. Feel free to use, modify, and distribute it.
See the LICENSE file for details.
Built for those who need it. By someone who did.
I built this because I needed to organize my files. My 'Downloads' folder was a complete mess, and no existing tool really helped me.
A project by Atypical-Playworks
Developed by Miluska Romero


