Skip to content

Sstark97/dev_sweep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

75 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DevSweep Logo

DevSweep

Professional developer cache cleaner for macOS, Linux, and Windows

Reclaim gigabytes of disk space safely and intelligently

License: MIT Bash .NET Platform


๐ŸŽฏ Overview

DevSweep is a production-grade CLI tool that safely cleans deep system caches, helping developers reclaim valuable disk space without compromising system stability.

๐Ÿ“ข Migration in Progress: DevSweep is migrating from Bash (v1.x, macOS only) to .NET 10 AOT (v2.x, cross-platform). See PROGRESS.md for details.

๐Ÿ”€ Versions

Version Platform Status Location
v1.x (Bash) macOS only โœ… Production bash/
v2.x (.NET 10 AOT) macOS, Linux, Windows ๐Ÿšง In Development net/

Current stable version: v1.x (Bash) - Fully functional, production-ready Future version: v2.x (.NET) - Cross-platform, hexagonal architecture, MCP server support

๐Ÿ“บ See It In Action

DevSweep Demo

DevSweep analyze mode detecting ~14GB of cleanable caches

๐Ÿงน What It Cleans

  • ๐ŸŽจ JetBrains IDEs - Removes old versions, keeps latest, cleans corrupted caches (~2-5GB)
  • ๐Ÿณ Docker/OrbStack - Containers, images, volumes, and build cache (~5-20GB)
  • ๐Ÿบ Homebrew - Old package versions, unused dependencies, download cache (~500MB-2GB)
  • โš™๏ธ Dev Tools - Maven, Gradle, npm, yarn, pnpm, pip caches (~5-15GB)
  • ๐Ÿ—‚๏ธ System (Coming soon) - System logs and caches

Average recovery: 10-30GB of disk space

โœจ Features

  • ๐Ÿ›ก๏ธ Safety First: Built-in --dry-run and --analyze modes to preview all actions
  • ๐ŸŽ›๏ธ Interactive Menu: User-friendly interface for guided cleanup
  • ๐Ÿ”ง Modular Architecture: Clean, testable, extensible codebase
  • โš ๏ธ Double Confirmation: Explicit approval for destructive operations
  • ๐Ÿ“Š Smart Analysis: Shows estimated space to be recovered before cleaning
  • ๐ŸŽจ Beautiful Output: Colored, organized logging with progress indicators
  • โœ… Well Tested: 115 tests, 100% passing, optimized for speed
  • ๐Ÿš€ Fast: Optimized for performance, completes in seconds

๐Ÿ“ฆ Installation

Note: These instructions are for v1.x (Bash). v2.x (.NET) installation will be documented when available.

Homebrew (Recommended)

# Add the tap
brew tap sstark97/tap

# Install DevSweep
brew install devsweep

Quick Install (Alternative)

# Clone and install locally (no sudo required)
git clone https://github.com/Sstark97/dev_sweep.git
cd dev_sweep/bash
make install-local

# Verify installation
devsweep --version

The command will be available at ~/.local/bin/devsweep

System-wide Installation

git clone https://github.com/Sstark97/dev_sweep.git
cd dev_sweep/bash
sudo make install

# Available globally
devsweep --version

Uninstall

# Homebrew
brew uninstall devsweep
brew untap sstark97/tap

# Local installation (from bash/ directory)
cd dev_sweep/bash
make uninstall-local

# System-wide
sudo make uninstall

๐Ÿš€ Usage

Quick Start

# Interactive mode - guided cleanup
devsweep

# Analyze mode - see what can be cleaned with size estimates
devsweep --analyze --all

# Safe preview - see detailed actions without deleting
devsweep --dry-run --all

# Clean everything (with confirmations)
devsweep --all

Interactive Mode

devsweep

Launches an interactive menu to select which modules to run.

Command-Line Flags

# Analyze mode - preview with size estimates (recommended first step)
devsweep --analyze --all

# Run all cleanup modules (with confirmations)
devsweep --all

# Safe preview mode - see detailed actions, no files deleted
devsweep --dry-run --all

# Clean specific modules
devsweep --jetbrains
devsweep --docker --homebrew

# Skip confirmations (use with caution!)
devsweep --force --all

# Verbose output
devsweep --verbose --jetbrains

Available Flags

Flag Short Description
--help -h Show help message
--version -v Show version
--analyze -a Analyze and show cleanup preview with size estimates
--dry-run -d Preview mode - shows detailed actions, no deletions
--verbose Detailed output
--force -f Skip confirmations
--all -a Run all cleanup modules
--jetbrains Clean JetBrains IDEs only
--docker Clean Docker/OrbStack only
--homebrew Clean Homebrew only
--devtools Clean dev tools (Maven, Gradle, Node)
--system Clean system caches and logs

Examples

# Recommended workflow: Analyze first, then clean
devsweep --analyze --all          # See what can be cleaned
devsweep --all                     # Clean with confirmations

# Safe exploration - see detailed actions
devsweep --dry-run --all

# Clean only JetBrains with preview
devsweep --jetbrains --verbose

# Full cleanup of dev tools
devsweep --devtools --docker --homebrew

# Clean everything (skip confirmations - use with caution!)
devsweep --force --all

๐Ÿ›ก๏ธ Safety Features

  1. ๏ฟฝ Analyze Mode: Preview what can be cleaned with size estimates before any action
  2. ๐Ÿ” Dry-Run Mode: See detailed actions without making changes
  3. โœ‹ Interactive Confirmations: Explicit approval for destructive operations
  4. ๐Ÿ”’ Smart Validation: Prevents accidental deletion of critical paths
  5. ๐Ÿ“ Detailed Logging: Full transparency of all actions taken
  6. ๐Ÿ’พ Version Preservation: Automatically keeps latest IDE versions
  7. โšก Graceful Handling: Safely handles missing tools and empty caches

๐Ÿ’ป Development

Note: These instructions are for v1.x (Bash). For v2.x (.NET) development, see PROGRESS.md.

Prerequisites (v1.x - Bash)

  • macOS 10.15+
  • Bash 5.0+
  • bashunit 0.32.0+ for testing

Setup

# Clone repository
git clone https://github.com/Sstark97/dev_sweep.git
cd dev_sweep/bash

# Install dependencies
make setup

# Run tests
make test

Running Tests

# Run all tests (123 tests, ~12.2s)
make test

# Run specific test suite
./bashunit tests/unit/jetbrains_test.sh

# Watch mode (requires fswatch)
make watch-test

Make Commands

make help              # Show all available commands
make test              # Run all tests
make lint              # Run shellcheck
make check             # Syntax validation
make install-local     # Install locally
make clean             # Remove temporary files

Project Structure

dev_sweep/
โ”œโ”€โ”€ bash/                     # v1.x - Bash version (macOS only)
โ”‚   โ”œโ”€โ”€ bin/
โ”‚   โ”‚   โ””โ”€โ”€ devsweep          # Main entry point
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ modules/          # Cleanup modules
โ”‚   โ”‚   โ””โ”€โ”€ utils/            # Shared utilities
โ”‚   โ”œโ”€โ”€ tests/                # 123 tests (112 unit + 11 e2e)
โ”‚   โ”œโ”€โ”€ Makefile              # Build automation
โ”‚   โ””โ”€โ”€ .bashunit.yml         # Test configuration
โ”œโ”€โ”€ net/                      # v2.x - .NET 10 AOT (cross-platform) [Coming soon]
โ”œโ”€โ”€ PROGRESS.md               # Migration roadmap
โ”œโ”€โ”€ README.md                 # This file
โ””โ”€โ”€ CONTRIBUTING.md           # Contribution guidelines

๐Ÿ”„ For Maintainers

Branch Protection Setup

To enforce code quality, configure branch protection rules for the main branch:

  1. Go to Settings โ†’ Branches โ†’ Branch protection rules
  2. Click Add rule for main branch
  3. Configure the following settings:
    • โœ… Require a pull request before merging
    • โœ… Require status checks to pass before merging
      • Add required check: test (from Tests workflow)
    • โœ… Require branches to be up to date before merging
    • โœ… Do not allow bypassing the above settings (recommended)

This ensures that all PRs must pass the automated test suite before they can be merged.

Creating a Release

# Complete automated release workflow
make publish VERSION=1.0.0

This command:

  1. โœ… Runs all tests
  2. โœ… Creates release tarball
  3. โœ… Creates and pushes git tag
  4. โธ๏ธ Pauses for GitHub release creation
  5. โœ… Updates Homebrew formula with correct SHA256
  6. โœ… Validates everything is ready

See QUICKSTART_RELEASE.md for details.

Publishing to Homebrew

After creating a release, submit to Homebrew Core:

# Fork and clone homebrew-core
git clone https://github.com/YOUR_USERNAME/homebrew-core.git
cd homebrew-core

# Add formula
git checkout -b devsweep
cp ../dev_sweep/devsweep.rb Formula/devsweep.rb

# Test and submit
brew install --build-from-source Formula/devsweep.rb
brew test devsweep
brew audit --strict --online Formula/devsweep.rb

git add Formula/devsweep.rb
git commit -m "devsweep 1.0.0 (new formula)"
git push origin devsweep

See HOMEBREW_CORE_SUBMISSION.md for complete guide.

๐Ÿ“Š Test Coverage

Tests:      123 passed, 123 total
  Unit:     112 tests (fast validation, <50ms each)
  E2E:      11 tests (integration validation)
    Smoke:  3 critical tests (CLI, menu, analyze)
    Cleanup: 8 tests (module behavior)
Time:       ~12.2 seconds (parallel execution)
Coverage:   All modules tested, following testing pyramid

๐Ÿ”ฎ Roadmap

See PROGRESS.md for the complete migration roadmap.

v2.x (.NET 10 AOT) - In Progress

  • Cross-platform support (macOS, Linux, Windows)
  • Hexagonal architecture with clean code principles
  • System module for OS caches and logs cleanup
  • MCP Server Integration (AI Agent Support)
  • Rich terminal UI with Spectre.Console
  • JSON output mode for programmatic use
  • Native AOT compilation (~75% faster startup)

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md for:

  • Code style guidelines
  • Testing requirements
  • Pull request process
  • Development workflow

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments

  • Built with bashunit for professional testing
  • Follows Clean Code principles and modern bash best practices
  • Inspired by the need to reclaim disk space on developer machines

๐Ÿ“š Documentation

v1.x (Bash) Documentation

๐Ÿ”— Links


Made with โค๏ธ by developers, for developers

If DevSweep saved you disk space, give it a โญ!

Next steps for Homebrew Core:

  1. Fork: https://github.com/Homebrew/homebrew-core
  2. Copy formula: cp devsweep.rb /Formula/
  3. Commit: git commit -m 'devsweep 1.0.0 (new formula)'
  4. Create PR to Homebrew/homebrew-core

About

CLI app to clean up your device for any trash data

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors