Skip to content

feat(dots): add cleanup subcommand#485

Merged
p-chan merged 2 commits into
mainfrom
add-dots-cleanup
Jun 28, 2026
Merged

feat(dots): add cleanup subcommand#485
p-chan merged 2 commits into
mainfrom
add-dots-cleanup

Conversation

@p-chan

@p-chan p-chan commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Why

Provide a single command to free disk space by cleaning up old versions and caches.

What

  • Add dots cleanup subcommand to bin/dots
  • Removes old Homebrew versions and cached files (brew cleanup)
  • Removes unused mise tool versions (mise prune --yes)
  • Clears npm, yarn, and pnpm caches (skipped if not installed)
  • Reports how much disk space was freed using the same API as macOS System Settings > Storage
  • Enforces running from the home directory to ensure correct behavior

Notes

  • Storage measurement uses volumeAvailableCapacityForImportantUsageKey via Swift to match System Settings values (includes purgeable space)
  • Each cleanup step uses || true so failures don't abort the script

Adds `dots cleanup` to free disk space by removing unused Homebrew
packages, old mise tool versions, and npm/yarn/pnpm caches.
Must be run from the home directory to ensure correct behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@p-chan p-chan self-assigned this Jun 28, 2026
`brew bundle cleanup` uninstalls packages not in the Brewfile which is
too aggressive for a cleanup command. `brew cleanup` limits the scope
to removing old versions and cached files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@p-chan p-chan merged commit 83affb6 into main Jun 28, 2026
7 checks passed
@p-chan p-chan deleted the add-dots-cleanup branch June 28, 2026 10:21
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.

1 participant