Lazy Tidier: I Taught an Open-Weight Model to Clean My Downloads Folder
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady TL;DR: Lazy Tidier is a Python CLI that sorts a messy folder using simple rules first and an open-weight model only for ambiguous files. It previews every change before touching anything, and it can undo what it did. What I Built My Downloads folder is a mess of IMG_2031.pdf , final_final(1).txt and…
This article documents a Python command-line interface (CLI) tool called "Lazy Tidier" that organizes a user's Downloads folder into tidy categories. The creator built the tool after growing frustrated with manually sorting through a disorganized folder full of PDFs, text files, and other miscellaneous downloads.
Lazy Tidier uses simple file extension rules to categorize obvious files like images, videos, archives, and installers, without needing any artificial intelligence (AI). More ambiguous file types like PDFs and text documents are sent to an open-weight language model for categorization. The tool prints out a preview of all planned changes before making any actual moves.
Key features of Lazy Tidier include:
- Rules based on file extensions to sort obvious file types instantly
- Open-weight LLM (language model) only for ambiguous files
- Dry-run mode by default that prints out the planned changes without making any alterations
- Ability to actually move the files with the "--apply" flag
- Undo the last set of changes with the "--undo" flag
- Files containing sensitive words like "bank", "cv", "resume", etc. are kept local and never sent to the model
- Sanitizer to block path traversal attacks and disallowed characters
- Undo log records every move so files can be restored
- Privacy guard ensures sensitive file names aren't sent to the model
- Works with hosted open-weight models like Llama 3.1 8B on Groq, and can swap to other providers or local models
The creator provides a simple setup process:
1. Clone the repo and enter the directory
2. Create and activate a virtual environment
3. Install dependencies
4. (Optional) Copy .env.example to .env and add your API key
Three commands cover everything:
- `python main.py --folder test_downloads` for a dry-run
- `python main.py --folder test_downloads --apply` to actually move the files
- `python main.py --folder test_downloads --undo` to restore everything
The tool's code is well-tested with 47 pytest tests covering things like filename safety, collisions, privacy matching, and JSON parsing. The AI integration is easily swappable by changing a single line in the .env file, preserving privacy and allowing for local inference later without code changes.
Overall, Lazy Tidier automates the file organization process, giving users a quick and safe way to declutter their Downloads folders without having to manually sort through messy files.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.