A command-line tool and script written in Go that automates the cleanup of temporary files on Windows. It cleans your user TEMP directory, Windows system temporary directory, and Prefetch directory.
-
Automated Cleanup:
Removes files from:- The user's TEMP
%temp%
directory C:\Windows\Temp
C:\Windows\Prefetch
- The user's TEMP
-
Interactive TUI:
Uses Bubble Tea to display:- A colorful banner
- A progress spinner
- Detailed logs for each deletion operation
-
Detailed Metrics:
Provides per-directory and overall summaries:- Total files processed
- Number of successful deletions
- Number of failures
-
Exit Prompt:
After cleanup, the TUI displays a prompt ("Press any key to exit...") and waits for your input before quitting.
- Go 1.18+ – Download Go
- Windows OS – Designed to work on Windows (requires admin privileges for system directories)
- Terminal with ANSI Color Support – For the best experience, use Windows Terminal or PowerShell.
If you prefer to build Cleanify yourself rather than downloading a pre-built executable, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/cleanify.git cd cleanify
-
Initialize the Go Module (if not already initialized):
go mod init github.com/yourusername/cleanify
-
Download Dependencies:
Cleanify uses Bubble Tea, Bubbles (spinner), and Fatih's Color. To download these dependencies, run:
go get github.com/charmbracelet/bubbletea go get github.com/charmbracelet/bubbles go get github.com/fatih/color
-
Build the Executable:
Once all dependencies are installed, build the project by running:
go build -o cleanify.exe
This will compile the source code into a Windows executable named
cleanify.exe
. -
Run Cleanify:
For best results (especially when cleaning system directories), run the executable with administrator privileges:
-
Right-click on
cleanify.exe
and select Run as administrator, or -
Open an elevated PowerShell/Command Prompt and execute:
.\cleanify.exe
-
The project is implemented in a single Go file (main.go
) and leverages:
- Bubble Tea: For building the TUI.
- Bubbles (Spinner): For an animated progress indicator.
- Fatih's Color: For colorized terminal output.
Each component is well-commented to help you understand how the cleanup process, logging, and metrics are handled.
Contributions are welcome! Feel free to open issues or submit pull requests for improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.
Use Cleanify at your own risk. Ensure you back up important data before running cleanup operations. The authors are not liable for any unintended data loss or system issues.