Skip to content

feat(nuclear): Add nuclear mode for complete devtools cleanup#24

Merged
Sstark97 merged 3 commits into
mainfrom
feature/issue-14-nuclear-mode
Feb 7, 2026
Merged

feat(nuclear): Add nuclear mode for complete devtools cleanup#24
Sstark97 merged 3 commits into
mainfrom
feature/issue-14-nuclear-mode

Conversation

@Sstark97
Copy link
Copy Markdown
Owner

@Sstark97 Sstark97 commented Feb 7, 2026

Summary

Implements Issue #14 - Nuclear mode for complete package manager cleanup

Changes

  • Add --nuclear flag for aggressive cleanup of ALL development tool caches
  • Create confirm_nuclear() that NEVER auto-confirms (even with --force)
  • Implement nuclear_devtools_clean() to destroy all caches without exceptions
  • Add 20 unit tests with full coverage
  • Fix missing log_section() function (bonus fix)

Targets

Package Manager Normal Mode Nuclear Mode
Gradle Old versions only caches + wrapper
npm _cacache only Complete directory
Cargo registry + git
Composer cache
pip cache cache (no change)
poetry cache cache + virtualenvs
Maven repository repository (no change)

Usage

# Nuclear cleanup of development tools
devsweep --nuclear --devtools

# Nuclear with analyze preview
devsweep --nuclear --analyze --devtools

# Nuclear with dry-run
devsweep --nuclear --dry-run --devtools

Safety

  • ⚠️ Requires typing "yes" - not skippable with --force
  • Shows detailed list of what will be deleted with sizes
  • Respects --dry-run and --analyze modes

Tests

  • ✅ 146 tests passing (100%)
  • ✅ 20 new unit tests for nuclear mode
  • ✅ All paths verified
  • ✅ Dry-run and analyze modes tested
  • ✅ Cache detection tested for all package managers

Files Changed

  • bin/devsweep - CLI flag + validation + help
  • src/utils/config.sh - Paths + NUCLEAR_MODE flag
  • src/utils/common.sh - confirm_nuclear() + log_section() fix
  • src/modules/devtools.sh - nuclear_devtools_clean() implementation
  • tests/unit/nuclear_mode_test.sh - 20 unit tests

Closes #14

@Sstark97 Sstark97 force-pushed the feature/issue-14-nuclear-mode branch from a88b404 to 38697d1 Compare February 7, 2026 21:04
- Add NUCLEAR_MODE flag and paths for complete cleanup
- Create confirm_nuclear() that never auto-confirms with --force
- Implement nuclear_devtools_clean() to remove ALL caches
  - Gradle: caches + wrapper
  - npm: complete directory
  - Cargo: registry + git
  - Composer: cache
  - pip + poetry: all caches including virtualenvs
  - Maven: repository
- Add --nuclear flag to CLI with validation
- Update help documentation with nuclear mode examples
- Add 20 unit tests with full coverage

Closes #14
- Add log_section() to display section headers
- Fixes errors in jetbrains and docker tests
- Used by log_cleanup_section() wrapper
@Sstark97 Sstark97 force-pushed the feature/issue-14-nuclear-mode branch from 38697d1 to 9b02023 Compare February 7, 2026 21:09
- Remove Cargo/Composer from nuclear mode (no existing modules)
- Add nuclear_*_clean() functions to each package manager module:
  * maven.sh: nuclear_maven_clean() - removes entire repository
  * gradle.sh: nuclear_gradle_clean() - removes caches + wrapper
  * node.sh: nuclear_node_clean() - removes npm, yarn, pnpm completely
  * python.sh: nuclear_python_clean() - removes pip + poetry with virtualenvs
- Refactor devtools.sh nuclear_devtools_clean() to orchestrator pattern:
  * Collects sizes from all modules
  * Shows single summary with all caches
  * Single confirmation with confirm_nuclear()
  * Sets NUCLEAR_CONFIRMED flag to skip module confirmations
  * Calls each module's nuclear function
- Update nuclear_mode_test.sh:
  * Remove Cargo/Composer path tests
  * Add tests for module nuclear functions
  * Add tests for NUCLEAR_CONFIRMED flag behavior
- Clean up config.sh: remove unused CARGO_* and COMPOSER_* paths

Architecture: monolithic (175 lines) -> orchestrator + 4 modules (more maintainable)
Tests: 156/156 passing (24 nuclear mode tests)
Manual test: verified with ~1GB real cache cleanup
@Sstark97 Sstark97 merged commit a8ecb5e into main Feb 7, 2026
2 checks passed
@Sstark97 Sstark97 deleted the feature/issue-14-nuclear-mode branch February 7, 2026 21:28
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.

Add aggressive cleanup mode for all package managers

1 participant