DeepClean 1.0.0

dotnet tool install --global DeepClean --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local DeepClean --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=DeepClean&version=1.0.0
                    
nuke :add-package DeepClean --version 1.0.0
                    

DeepClean

CI NuGet

A cross-platform .NET global tool that recursively deletes bin and obj folders from your current directory. Perfect for cleaning up .NET projects and freeing disk space.

Features

  • 🚀 Fast & Efficient: Quickly finds and removes all bin/obj folders recursively
  • 🌍 Cross-Platform: Works on Windows, Linux, and macOS
  • 🛡️ Safe: Asks for confirmation before deletion (can be skipped with -y)
  • 🔍 Dry-Run Mode: Preview what would be deleted without actually deleting
  • 💪 Robust Error Handling: Gracefully handles file locks, permission issues, and other errors
  • 📊 Detailed Summary: Shows how many folders were deleted and how much space was freed

Installation

Install as a global .NET tool:

dotnet tool install -g DeepClean

Update to the latest version:

dotnet tool update -g DeepClean

Uninstall:

dotnet tool uninstall -g DeepClean

Usage

Navigate to the root directory of your .NET solution or project(s) and run:

deepclean

Options

Option Description
-d, --dry-run Preview what would be deleted without actually deleting
-y, --yes Skip confirmation prompt and delete automatically
-h, --help Show help message

Examples

Preview what would be deleted:

deepclean --dry-run

Delete without confirmation:

deepclean --yes

Interactive mode (default):

deepclean

This will show you all the folders to be deleted and ask for confirmation.

Sample Output

DeepClean - Recursively delete bin and obj folders
==================================================

Starting directory: /home/user/projects/MyApp

Found 4 folder(s) to delete:
  - /home/user/projects/MyApp/src/MyApp.Api/bin
  - /home/user/projects/MyApp/src/MyApp.Api/obj
  - /home/user/projects/MyApp/src/MyApp.Core/bin
  - /home/user/projects/MyApp/src/MyApp.Core/obj

Do you want to delete these folders? (y/n): y
Deleting folders...
  ✓ Deleted: /home/user/projects/MyApp/src/MyApp.Api/bin
  ✓ Deleted: /home/user/projects/MyApp/src/MyApp.Api/obj
  ✓ Deleted: /home/user/projects/MyApp/src/MyApp.Core/bin
  ✓ Deleted: /home/user/projects/MyApp/src/MyApp.Core/obj

Summary:
  Deleted: 4 folder(s)
  Freed space: 1.23 GB

Error Handling

DeepClean handles various error scenarios gracefully:

  • File Locks: If files are locked by another process, the error is reported but the tool continues
  • Permission Issues: If you don't have permission to delete a folder, it's reported as an error
  • Path Length Issues: Handles long paths that exceed OS limitations
  • Access Denied: Reports directories that require elevation or special permissions

All errors are collected and displayed at the end of execution.

Building from Source

git clone https://github.com/matt-goldman/deepclean.git
cd deepclean/DeepClean
dotnet build
dotnet run -- --help

Publishing

To create a NuGet package:

dotnet pack -c Release

The GitHub Actions workflow automatically publishes to NuGet when a release is created.

License

MIT License - see LICENSE for details

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 211 11/24/2025