"Your wish is my command! Grant me access to your files, and I shall bring order to digital chaos!" โจ
FileGenie is a conversational, AI-powered file management tool that transforms chaotic workspaces into organized digital realms. With both offline and online modes, it provides intelligent file operations, semantic search, and automated organization.
Engineering Constraints: Built with maximum 8 variables and โค500 lines of code - proving that powerful AI-enhanced file management can be achieved through elegant, minimalist design.
This constraint-driven architecture demonstrates efficient coding practices while delivering comprehensive file organization, semantic analysis, and intelligent automation capabilities.
- ๐ FAST Mode (Offline): Lightning-fast responses with basic file operations
- ๐ง SMART Mode (Online): AI-powered analysis with OpenAI integration
- Conversational Commands: Natural language file operations
- Semantic Search: Find files by meaning, not just names
- Smart Organization: Auto-categorize files by type and content
- Duplicate Detection: Find and remove duplicate files intelligently
- Content Analysis: AI-powered file content understanding
- File Operations: Move, rename, copy, delete with confirmation
- Smart Cleanup: Identify temp files, large files, and old files
- Auto-Tagging: Semantic categorization of files
- Relationship Detection: Discover connections between files
- Smart Rename: Auto-fix messy filenames
- Python 3.7 or higher
- Optional: OpenAI API key for AI features
- Clone the repository:
git clone https://github.com/bhanvinayer/FileGenie.git
cd FileGenie- Install dependencies:
pip install -r requirements.txt- Set up environment (Optional - for AI features):
# Create .env file
echo "OPENAI_API_KEY=your_api_key_here" > .env- Run FileGenie:
python filegenie.pyNatural Language Operations:
"organize python files"
"delete temp files"
"find all images"
"move documents to archive folder"
"rename draft.txt to final.txt"
Interactive Menu Options:
- ๐ฌ Conversational Commands
- ๐ง Semantic Content Analysis
- ๐๏ธ Smart Auto-Organization
- ๐ Duplicate Detection & Removal
- ๐งน Smart Workspace Cleanup
- ๐ Semantic Search
- ๐ File Relationship Analysis
- ๐ Workspace Analytics
# 1. Scan workspace
> python filegenie.py
> Enter workspace: /Users/username/Downloads
# 2. Smart organization
> Choice: 3
# FileGenie will auto-categorize files into:
# - code/ (Python, JavaScript, etc.)
# - docs/ (PDFs, Word docs, etc.)
# - data/ (CSV, JSON files)
# - misc/ (Other files)# 1. Enable AI mode with OPENAI_API_KEY
# 2. Analyze content
> Choice: 2
# 3. Search semantically
> Choice: 6
> Search query: machine learning model
# Returns files related to ML even without "machine learning" in filename# 1. Smart cleanup suggestions
> Choice: 5
# Identifies:
# - Temporary files (temp*, backup*, copy*)
# - Large files (>5MB)
# - Old files (>30 days)
# 2. Remove duplicates
> Choice: 4
# Groups similar files and lets you choose which to keep- Maximum 8 Variables: Optimized memory usage with strategic variable reuse
- โค500 Lines of Code: Compact, efficient implementation
- Dual Mode Support: Seamless offline/online operation switching
# Global State Management (8 variables max)
files = [] # Tracked file paths
meta = {} # File metadata and settings
sem = {} # Semantic analysis results
rel = {} # File relationships
q = "" # Query/operation string
res = "" # Response/result string
ai = None # AI agent instance
cmd = {} # Command parsing and temp data- Code Files:
.py,.js,.html,.css,.json - Documents:
.txt,.md,.pdf,.docx - Data Files:
.csv,.xlsx,.yaml - Logs:
.log,.cfg
# .env file
OPENAI_API_KEY=your_openai_api_key_here # Optional: Enables AI featuresFileGenie runs in safe mode by default, requiring confirmation for destructive operations:
- File deletion
- File moving/renaming
- Bulk operations
# Example: Find configuration files
semantic_search("application settings and configuration")
# Returns files containing config data, even if not named "config"- Code: Python, JavaScript, Java files
- Docs: Text files, PDFs, documentation
- Data: CSV, JSON, Excel files
- Misc: Logs, temporary files
FileGenie can discover semantic relationships between files:
- Similar content structure
- Related project files
- Documentation-code pairs
FileGenie provides comprehensive workspace analytics:
- File count and size distribution
- Duplicate file analysis
- File type breakdown
- Large file identification
- Workspace organization score
- Confirmation Prompts: All destructive operations require confirmation
- Safe Mode: Enabled by default
- Operation History: Track all file operations
- Backup Suggestions: Recommends backing up before major changes
- Reversible Operations: Where possible, operations can be undone
Requirements: OpenAI API key Features:
- Advanced semantic analysis
- Intelligent content summarization
- Context-aware file relationships
- Natural language command parsing
- Smart organization suggestions
Requirements: None Features:
- Basic file operations
- Pattern-based search
- Rule-based organization
- File type analysis
- Manual duplicate detection
- Maintain the 8-variable constraint
- Keep total code under 500 lines
The demo/ folder contains sample files to test FileGenie:
- Mixed file types (Python, CSV, text, images)
- Duplicate files for testing detection
- Messy filenames for smart rename testing
- Various content types for semantic analysis
Try running FileGenie on the demo folder to see it in action!
"In the realm of digital chaos, FileGenie brings order, one file at a time!" ๐งโโ๏ธ