Skip to content

vi9521/lazyclean-kiro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 LazyClean β€” Smart Folder Cleaner (Kiro Week 2 Ready)

πŸ“ Featured Article: LazyClean: Building a Smart File Organizer with Kiro AI - From Chaos to Order in 3 Days

πŸ‘€ Author: Digvijay Gade on AWS Builder Center

Built for Kiro Week 2 Challenge: Lazy Automation | ⏱️ Developed in 3 days with Kiro AI assistance


πŸ€– Built with Kiro AI

LazyClean was significantly enhanced with Kiro AI assistance. Kiro helped implement:

  • βœ… Progress bars with cli-progress library
  • βœ… File size analysis and formatted tables
  • βœ… Enhanced error handling patterns
  • βœ… Smart backup system architecture

Development Impact: Features that would have taken 12-15 hours were implemented in just 3-4 hours with Kiro's guidance - 4x faster development!

πŸ“– Read the complete story: How I Built LazyClean with Kiro AI


πŸš€ What is LazyClean?

LazyClean is a fast, production-ready Node.js CLI tool that automatically organizes messy folders.

It sorts files into:

  • πŸ–Ό Images (jpg, png, gif, svg, webp)
  • πŸŽ₯ Videos (mp4, avi, mkv, mov, wmv)
  • πŸ“„ Documents (pdf, doc, docx, txt, xlsx, pptx)
  • 🎡 Audio (mp3, wav, flac, aac, ogg)
  • πŸ—„ Archives (zip, rar, 7z, tar, gz)
  • πŸ’» Code (js, py, java, cpp, html, css)
  • πŸ“¦ Others (everything else)

LazyClean also detects duplicate files using SHA-1 hashing, supports undo, dry-run, recursive scanning, and provides a beautiful CLI interface.


✨ Key Features

πŸ—‚ Automatic Categorization

Sorts files into category-based folders based on file extensions.

🧬 Duplicate Detection

Uses SHA-1 hashing to identify duplicate files β†’ duplicates moved to /Duplicates folder.

πŸ§ͺ Dry-Run Mode

Preview all actions without modifying any files - see what would happen before committing.

πŸ” Undo System

Safely reverts past actions using lazyclean-log.json - restore files to their original locations.

🌲 Recursive Scan

Organizes files inside subfolders and nested directory structures.

🚫 Ignore System

Skip specific files/folders using .klignore file (similar to .gitignore).

🎨 Beautiful CLI

  • Figlet ASCII art banner
  • Chalk colored output
  • Ora loading spinners
  • Formatted summary tables

πŸ“¦ Installation

git clone https://github.com/vi9521/lazyclean-kiro.git
cd lazyclean-kiro
npm install

▢️ Usage

πŸ” Dry Run (Preview Changes)

node src/lazyclean.js --path <folder> --dry-run

🧹 Real Cleanup

node src/lazyclean.js --path <folder>

πŸ” Undo Last Cleanup

node src/lazyclean.js --path <folder> --undo

πŸ” Undo Multiple Steps

node src/lazyclean.js --path <folder> --undo --undo-steps 5

πŸ“Š Generate Report

node src/lazyclean.js --path <folder> --report

🌲 Recursive Mode (Process Subfolders)

node src/lazyclean.js --path <folder> --recursive

🚫 Ignore Rules

Create a .klignore file in your project root to skip specific patterns:

node_modules/
.git/
secret.txt
temp/
*.log

LazyClean will automatically skip these files and folders during organization.


πŸ“‚ Project Structure

lazyclean-kiro/
β”œβ”€β”€ .kiro/
β”‚   β”œβ”€β”€ config.json         
β”‚   └── README-kiro.md       
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lazyclean.js         
β”‚   β”œβ”€β”€ utils.js             
β”‚   └── src_sample/            
β”œβ”€β”€ demo_report/              
β”œβ”€β”€ demo_target/             
β”œβ”€β”€ README.md                 
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
└── package-lock.json

🧠 Duplicate Detection β€” How It Works

LazyClean uses SHA-1 cryptographic hashing for accurate duplicate detection:

  1. Hash Calculation: Computes SHA-1 hash for each file's content
  2. Comparison: Files with identical hashes are duplicates (even with different names)
  3. Segregation: Duplicate files are moved to /Duplicates folder
  4. Logging: All actions logged for safe undo operations

Example:

  • vacation.jpg (hash: abc123...)
  • vacation-copy.jpg (hash: abc123...) β†’ Duplicate detected!

πŸ” Undo System

LazyClean logs all file operations in lazyclean-log.json:

{
  "runs": [
    {
      "action": "move",
      "from": "image.jpg",
      "to": "Images/image.jpg",
      "timestamp": "2025-12-04T10:30:00.000Z"
    }
  ]
}

Undo safely restores files to their original locations - zero data loss risk!


πŸ“– Learn More

Want to know how LazyClean was built? Read the detailed development story:

πŸ“ LazyClean: Building a Smart File Organizer with Kiro AI

The article covers:

  • The 2 AM problem that inspired LazyClean
  • How Kiro AI accelerated development by 4x
  • Technical implementation details
  • Challenges solved and lessons learned

πŸ“œ License

MIT License β€” free to use, modify, and distribute.


πŸ‘¨β€πŸ’» Author

Digvijay Gade (@vi9521)


🎯 Project Status

βœ… Fully Functional - Production-ready CLI tool
βœ… Well Documented - Complete usage guide and blog post
βœ… Kiro Enhanced - Built with AI assistance for rapid development
βœ… Open Source - MIT License, contributions welcome


πŸ™ Acknowledgments

  • Kiro AI - For accelerating feature development
  • AWS Builder Center - For hosting the development blog
  • AI for Bharat - For organizing the Kiro Week 2 Challenge

⭐ Star this repo if you find it useful!

Built with ❀️ for developers who hate messy folders

About

Smart CLI tool to organize messy folders automatically (Kiro Week 2)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors