Skip to content

Implement DeepClean: Cross-platform dotnet global tool for cleaning bin/obj folders#1

Merged
matt-goldman merged 4 commits intomainfrom
copilot/add-console-app-global-tool
Nov 24, 2025
Merged

Implement DeepClean: Cross-platform dotnet global tool for cleaning bin/obj folders#1
matt-goldman merged 4 commits intomainfrom
copilot/add-console-app-global-tool

Conversation

Copy link

Copilot AI commented Nov 24, 2025

Creates a dotnet global tool that recursively deletes bin and obj folders from the current directory, with robust error handling and cross-platform support.

Implementation

Console Application (DeepClean/)

  • Configured as dotnet global tool with command name deepclean
  • Recursively finds and deletes bin/obj folders
  • Options: --dry-run (preview), --yes (skip confirmation), --help
  • Reports freed space in human-readable format

Error Handling

  • Catches and reports file locks (IOException) without failing
  • Handles permission errors (UnauthorizedAccessException)
  • Tolerates path length issues and inaccessible directories
  • Uses recursive size calculation with per-file/directory exception handling

CI/CD (.github/workflows/)

  • ci.yml: Matrix build on Ubuntu/Windows/macOS with smoke tests
  • publish.yml: Publishes to NuGet on release, auto-extracts version from tags
  • Both workflows use explicit permissions per security best practices

Usage

# Install globally
dotnet tool install -g DeepClean

# Preview deletions
deepclean --dry-run

# Delete without prompt
deepclean --yes

Example output:

Found 8 folder(s) to delete:
  - /path/to/Project1/bin
  - /path/to/Project1/obj
  ...

Summary:
  Deleted: 8 folder(s)
  Freed space: 1.23 GB
Original prompt

I want to create a console app that can be installed as dotnet global tool that recursively and forcibly deletes bin and obj folders from the current path. Should include a GitHub Actions workflow to publish a nuget package. Should work on any OS. Should catch and handle any predictable errors, like file locks, requires elevation, etc., and report those to the user rather than failing opaquely.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 24, 2025 05:30
Co-authored-by: matt-goldman <19944129+matt-goldman@users.noreply.github.com>
Co-authored-by: matt-goldman <19944129+matt-goldman@users.noreply.github.com>
…lows

Co-authored-by: matt-goldman <19944129+matt-goldman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add console app to delete bin and obj folders Implement DeepClean: Cross-platform dotnet global tool for cleaning bin/obj folders Nov 24, 2025
Copilot AI requested a review from matt-goldman November 24, 2025 05:38
@matt-goldman matt-goldman marked this pull request as ready for review November 24, 2025 05:44
Copy link
Owner

@matt-goldman matt-goldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matt-goldman matt-goldman merged commit 0f6a449 into main Nov 24, 2025
6 checks passed
@matt-goldman matt-goldman deleted the copilot/add-console-app-global-tool branch November 24, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants