mac-storage-cleaner 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mac_storage_cleaner-1.0.0/.github/workflows/publish.yml +22 -0
- mac_storage_cleaner-1.0.0/.gitignore +5 -0
- mac_storage_cleaner-1.0.0/LICENSE +21 -0
- mac_storage_cleaner-1.0.0/PKG-INFO +241 -0
- mac_storage_cleaner-1.0.0/README.md +217 -0
- mac_storage_cleaner-1.0.0/mac_storage_cleaner/__init__.py +0 -0
- mac_storage_cleaner-1.0.0/mac_storage_cleaner/cli.py +895 -0
- mac_storage_cleaner-1.0.0/pyproject.toml +43 -0
- mac_storage_cleaner-1.0.0/tests/__init__.py +0 -0
- mac_storage_cleaner-1.0.0/tests/test_cli.py +145 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Install uv
|
|
14
|
+
uses: astral-sh/setup-uv@v4
|
|
15
|
+
|
|
16
|
+
- name: Build package
|
|
17
|
+
run: uv build
|
|
18
|
+
|
|
19
|
+
- name: Publish to PyPI
|
|
20
|
+
run: uv publish --token $PYPI_API_TOKEN
|
|
21
|
+
env:
|
|
22
|
+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prithvi Kochhar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mac-storage-cleaner
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A fast, safe macOS CLI tool to reclaim disk space
|
|
5
|
+
Project-URL: Homepage, https://github.com/prithvikochhar/Mac_Storage_Cleaner
|
|
6
|
+
Author-email: Prithvi Kochhar <prit.kochhar@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: cleaner,cli,disk-space,macos,storage
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: System :: Filesystems
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Requires-Dist: click>=8.0.0
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# mac-storage-cleaner
|
|
26
|
+
|
|
27
|
+
A fast, safe macOS CLI tool to reclaim disk space by removing known junk files and identifying large stale items.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **`clean`** — deletes browser caches (Chrome, Firefox, Safari), app caches in `~/Library/Caches`, conda package caches, log files in `~/Library/Logs`, and developer caches (pip, uv, npm); prompts for confirmation before deleting (bypass with `--yes`)
|
|
32
|
+
- **`--dry-run`** flag — shows exactly what *would* be deleted and how much space would be freed, without touching anything
|
|
33
|
+
- **`scan`** — finds files and folders larger than a configurable size that haven't been accessed in over 90 days (configurable), printing them as warnings
|
|
34
|
+
- **`find-large`** — scans `~/Downloads`, `~/Documents`, and `/Applications` for large, unused items; shows type (App, ZIP archive, Folder, Video, Image, Document, or File) with context-specific cleanup tips
|
|
35
|
+
- **`clean-docker`** — removes unused Docker containers, images, volumes, and build cache via `docker system prune`
|
|
36
|
+
- **`history`** — displays a table of past cleaning runs with totals and per-category breakdown
|
|
37
|
+
- **`schedule`** / **`unschedule`** — installs or removes a monthly launchd job that runs a dry-run scan on the 1st of each month at 9am and sends a macOS notification
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
- macOS
|
|
42
|
+
- [uv](https://docs.astral.sh/uv/) (`brew install uv`)
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Install from GitHub
|
|
48
|
+
uv tool install "git+https://github.com/prithvikochhar/Mac_Storage_Cleaner"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or install from a local clone:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv tool install .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or run without installing:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uv run mac-storage-cleaner <command>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
### Preview what would be cleaned (safe — no deletions)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
mac-storage-cleaner clean --dry-run
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Actually clean junk files
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
mac-storage-cleaner clean
|
|
75
|
+
# You will be prompted to confirm before any files are deleted.
|
|
76
|
+
# To skip the prompt (e.g. in scripts):
|
|
77
|
+
mac-storage-cleaner clean --yes
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
After cleaning, a disk space summary is always printed (both dry-run and real runs):
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Free space: 45.2 GB → 52.7 GB (freed 7.5 GB)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For dry-run, the estimated free space after is shown instead.
|
|
87
|
+
|
|
88
|
+
### Clean only specific categories
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Clean only browser/app caches and log files
|
|
92
|
+
mac-storage-cleaner clean --categories caches,logs
|
|
93
|
+
|
|
94
|
+
# Clean only developer tool caches
|
|
95
|
+
mac-storage-cleaner clean --categories developer
|
|
96
|
+
|
|
97
|
+
# Clean everything including Docker (adds docker system prune)
|
|
98
|
+
mac-storage-cleaner clean --categories caches,logs,conda,developer,docker
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Available categories: `caches`, `logs`, `conda`, `developer`, `docker`.
|
|
102
|
+
If `--categories` is not specified, all categories except `docker` are cleaned (default behaviour unchanged).
|
|
103
|
+
A note is printed at the top showing which categories are active.
|
|
104
|
+
|
|
105
|
+
### Exclude specific apps or cache folders from clean
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Skip Spotify and Chrome caches
|
|
109
|
+
mac-storage-cleaner clean --exclude Spotify,Chrome
|
|
110
|
+
|
|
111
|
+
# Combine with other flags
|
|
112
|
+
mac-storage-cleaner clean --dry-run --exclude npm,pip
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Matching is case-insensitive against any component of the path. Skipped items are shown in yellow with a `skipped (excluded)` note.
|
|
116
|
+
|
|
117
|
+
### Find large stale files (default: >1 GB, not accessed in 90+ days)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mac-storage-cleaner scan
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Scan with custom thresholds
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Find items larger than 500 MB not accessed in 60+ days
|
|
127
|
+
mac-storage-cleaner scan --min-size 500MB --days 60
|
|
128
|
+
|
|
129
|
+
# Scan a specific directory
|
|
130
|
+
mac-storage-cleaner scan --path ~/Downloads --min-size 100MB
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Find large unused items in Downloads, Documents, and Applications
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
mac-storage-cleaner find-large
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This scans:
|
|
140
|
+
- `~/Downloads` and `~/Documents` — items >100 MB not accessed in 30+ days
|
|
141
|
+
- `/Applications` — apps >500 MB not opened in 180+ days
|
|
142
|
+
|
|
143
|
+
Each result shows its **type** (App, ZIP archive, Folder, Video, Image, Document, or File) with a context-specific note:
|
|
144
|
+
- ZIP archives are flagged as likely safe to delete
|
|
145
|
+
- Apps remind you to drag to Trash in Finder (not just delete)
|
|
146
|
+
- Old folders in Downloads prompt you to inspect before deleting
|
|
147
|
+
|
|
148
|
+
Output ends with a **How to clean these up:** guide.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Customize thresholds for Downloads/Documents
|
|
152
|
+
mac-storage-cleaner find-large --min-size 200MB --days 60
|
|
153
|
+
|
|
154
|
+
# Interactively delete items one by one
|
|
155
|
+
mac-storage-cleaner find-large --interactive
|
|
156
|
+
# or: mac-storage-cleaner find-large -i
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
After showing the results table, `--interactive` prompts for each non-app item:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Delete ~/Downloads/old-backup.zip? [y/n/q(uit)]:
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- `y` deletes the item and prints how much was freed
|
|
166
|
+
- `n` skips to the next item
|
|
167
|
+
- `q` exits the interactive session without deleting remaining items
|
|
168
|
+
- Items inside `/Applications` are always skipped with a reminder to use Finder
|
|
169
|
+
- A summary is printed at the end: `Deleted X items, freed Y GB`
|
|
170
|
+
|
|
171
|
+
### View cleaning history
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
mac-storage-cleaner history
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Displays a table of every past `clean` run with timestamp, total freed, and per-category breakdown. The log is stored at `~/.mac-storage-cleaner/history.log`.
|
|
178
|
+
|
|
179
|
+
### Schedule monthly scans
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Install a launchd job: runs a dry-run scan on the 1st of each month at 9am
|
|
183
|
+
# and sends a macOS notification when complete
|
|
184
|
+
mac-storage-cleaner schedule
|
|
185
|
+
|
|
186
|
+
# Check whether the scheduler is installed
|
|
187
|
+
mac-storage-cleaner schedule --status
|
|
188
|
+
|
|
189
|
+
# Remove the scheduler
|
|
190
|
+
mac-storage-cleaner unschedule
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The notification reads: *"Monthly scan complete. Run mac-storage-cleaner history to see results."*
|
|
194
|
+
|
|
195
|
+
### Clean up unused Docker data
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# See what would be freed (no deletions)
|
|
199
|
+
mac-storage-cleaner clean-docker --dry-run
|
|
200
|
+
|
|
201
|
+
# Actually prune unused Docker data
|
|
202
|
+
mac-storage-cleaner clean-docker
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Requires Docker to be installed and Docker Desktop to be running. If Docker is not installed the command prints a notice and exits cleanly.
|
|
206
|
+
|
|
207
|
+
### Help
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
mac-storage-cleaner --help
|
|
211
|
+
mac-storage-cleaner clean --help
|
|
212
|
+
mac-storage-cleaner scan --help
|
|
213
|
+
mac-storage-cleaner find-large --help
|
|
214
|
+
mac-storage-cleaner clean-docker --help
|
|
215
|
+
mac-storage-cleaner history --help
|
|
216
|
+
mac-storage-cleaner schedule --help
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## What gets cleaned
|
|
220
|
+
|
|
221
|
+
| Category | Paths |
|
|
222
|
+
|---|---|
|
|
223
|
+
| Chrome cache | `~/Library/Caches/Google/Chrome`, `~/Library/Application Support/Google/Chrome/Default/Cache` |
|
|
224
|
+
| Firefox cache | `~/Library/Caches/Firefox` |
|
|
225
|
+
| Safari cache | `~/Library/Caches/com.apple.Safari`, `~/Library/Safari/LocalStorage` |
|
|
226
|
+
| App caches | All subdirectories of `~/Library/Caches` |
|
|
227
|
+
| Conda cache | `~/Library/Caches/conda`, `~/.conda/pkgs` (only if present) |
|
|
228
|
+
| Log files | All items in `~/Library/Logs` |
|
|
229
|
+
| Developer caches | pip, uv, and npm caches (only for tools that are installed) |
|
|
230
|
+
|
|
231
|
+
> **Tip:** Always run `--dry-run` first to preview what will be deleted.
|
|
232
|
+
|
|
233
|
+
## Development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Install dependencies
|
|
237
|
+
uv sync
|
|
238
|
+
|
|
239
|
+
# Run during development
|
|
240
|
+
uv run mac-storage-cleaner clean --dry-run
|
|
241
|
+
```
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# mac-storage-cleaner
|
|
2
|
+
|
|
3
|
+
A fast, safe macOS CLI tool to reclaim disk space by removing known junk files and identifying large stale items.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **`clean`** — deletes browser caches (Chrome, Firefox, Safari), app caches in `~/Library/Caches`, conda package caches, log files in `~/Library/Logs`, and developer caches (pip, uv, npm); prompts for confirmation before deleting (bypass with `--yes`)
|
|
8
|
+
- **`--dry-run`** flag — shows exactly what *would* be deleted and how much space would be freed, without touching anything
|
|
9
|
+
- **`scan`** — finds files and folders larger than a configurable size that haven't been accessed in over 90 days (configurable), printing them as warnings
|
|
10
|
+
- **`find-large`** — scans `~/Downloads`, `~/Documents`, and `/Applications` for large, unused items; shows type (App, ZIP archive, Folder, Video, Image, Document, or File) with context-specific cleanup tips
|
|
11
|
+
- **`clean-docker`** — removes unused Docker containers, images, volumes, and build cache via `docker system prune`
|
|
12
|
+
- **`history`** — displays a table of past cleaning runs with totals and per-category breakdown
|
|
13
|
+
- **`schedule`** / **`unschedule`** — installs or removes a monthly launchd job that runs a dry-run scan on the 1st of each month at 9am and sends a macOS notification
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- macOS
|
|
18
|
+
- [uv](https://docs.astral.sh/uv/) (`brew install uv`)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Install from GitHub
|
|
24
|
+
uv tool install "git+https://github.com/prithvikochhar/Mac_Storage_Cleaner"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or install from a local clone:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uv tool install .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or run without installing:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv run mac-storage-cleaner <command>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Preview what would be cleaned (safe — no deletions)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mac-storage-cleaner clean --dry-run
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Actually clean junk files
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
mac-storage-cleaner clean
|
|
51
|
+
# You will be prompted to confirm before any files are deleted.
|
|
52
|
+
# To skip the prompt (e.g. in scripts):
|
|
53
|
+
mac-storage-cleaner clean --yes
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
After cleaning, a disk space summary is always printed (both dry-run and real runs):
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Free space: 45.2 GB → 52.7 GB (freed 7.5 GB)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For dry-run, the estimated free space after is shown instead.
|
|
63
|
+
|
|
64
|
+
### Clean only specific categories
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Clean only browser/app caches and log files
|
|
68
|
+
mac-storage-cleaner clean --categories caches,logs
|
|
69
|
+
|
|
70
|
+
# Clean only developer tool caches
|
|
71
|
+
mac-storage-cleaner clean --categories developer
|
|
72
|
+
|
|
73
|
+
# Clean everything including Docker (adds docker system prune)
|
|
74
|
+
mac-storage-cleaner clean --categories caches,logs,conda,developer,docker
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Available categories: `caches`, `logs`, `conda`, `developer`, `docker`.
|
|
78
|
+
If `--categories` is not specified, all categories except `docker` are cleaned (default behaviour unchanged).
|
|
79
|
+
A note is printed at the top showing which categories are active.
|
|
80
|
+
|
|
81
|
+
### Exclude specific apps or cache folders from clean
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Skip Spotify and Chrome caches
|
|
85
|
+
mac-storage-cleaner clean --exclude Spotify,Chrome
|
|
86
|
+
|
|
87
|
+
# Combine with other flags
|
|
88
|
+
mac-storage-cleaner clean --dry-run --exclude npm,pip
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Matching is case-insensitive against any component of the path. Skipped items are shown in yellow with a `skipped (excluded)` note.
|
|
92
|
+
|
|
93
|
+
### Find large stale files (default: >1 GB, not accessed in 90+ days)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mac-storage-cleaner scan
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Scan with custom thresholds
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Find items larger than 500 MB not accessed in 60+ days
|
|
103
|
+
mac-storage-cleaner scan --min-size 500MB --days 60
|
|
104
|
+
|
|
105
|
+
# Scan a specific directory
|
|
106
|
+
mac-storage-cleaner scan --path ~/Downloads --min-size 100MB
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Find large unused items in Downloads, Documents, and Applications
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
mac-storage-cleaner find-large
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This scans:
|
|
116
|
+
- `~/Downloads` and `~/Documents` — items >100 MB not accessed in 30+ days
|
|
117
|
+
- `/Applications` — apps >500 MB not opened in 180+ days
|
|
118
|
+
|
|
119
|
+
Each result shows its **type** (App, ZIP archive, Folder, Video, Image, Document, or File) with a context-specific note:
|
|
120
|
+
- ZIP archives are flagged as likely safe to delete
|
|
121
|
+
- Apps remind you to drag to Trash in Finder (not just delete)
|
|
122
|
+
- Old folders in Downloads prompt you to inspect before deleting
|
|
123
|
+
|
|
124
|
+
Output ends with a **How to clean these up:** guide.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Customize thresholds for Downloads/Documents
|
|
128
|
+
mac-storage-cleaner find-large --min-size 200MB --days 60
|
|
129
|
+
|
|
130
|
+
# Interactively delete items one by one
|
|
131
|
+
mac-storage-cleaner find-large --interactive
|
|
132
|
+
# or: mac-storage-cleaner find-large -i
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
After showing the results table, `--interactive` prompts for each non-app item:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Delete ~/Downloads/old-backup.zip? [y/n/q(uit)]:
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- `y` deletes the item and prints how much was freed
|
|
142
|
+
- `n` skips to the next item
|
|
143
|
+
- `q` exits the interactive session without deleting remaining items
|
|
144
|
+
- Items inside `/Applications` are always skipped with a reminder to use Finder
|
|
145
|
+
- A summary is printed at the end: `Deleted X items, freed Y GB`
|
|
146
|
+
|
|
147
|
+
### View cleaning history
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
mac-storage-cleaner history
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Displays a table of every past `clean` run with timestamp, total freed, and per-category breakdown. The log is stored at `~/.mac-storage-cleaner/history.log`.
|
|
154
|
+
|
|
155
|
+
### Schedule monthly scans
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Install a launchd job: runs a dry-run scan on the 1st of each month at 9am
|
|
159
|
+
# and sends a macOS notification when complete
|
|
160
|
+
mac-storage-cleaner schedule
|
|
161
|
+
|
|
162
|
+
# Check whether the scheduler is installed
|
|
163
|
+
mac-storage-cleaner schedule --status
|
|
164
|
+
|
|
165
|
+
# Remove the scheduler
|
|
166
|
+
mac-storage-cleaner unschedule
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The notification reads: *"Monthly scan complete. Run mac-storage-cleaner history to see results."*
|
|
170
|
+
|
|
171
|
+
### Clean up unused Docker data
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# See what would be freed (no deletions)
|
|
175
|
+
mac-storage-cleaner clean-docker --dry-run
|
|
176
|
+
|
|
177
|
+
# Actually prune unused Docker data
|
|
178
|
+
mac-storage-cleaner clean-docker
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Requires Docker to be installed and Docker Desktop to be running. If Docker is not installed the command prints a notice and exits cleanly.
|
|
182
|
+
|
|
183
|
+
### Help
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
mac-storage-cleaner --help
|
|
187
|
+
mac-storage-cleaner clean --help
|
|
188
|
+
mac-storage-cleaner scan --help
|
|
189
|
+
mac-storage-cleaner find-large --help
|
|
190
|
+
mac-storage-cleaner clean-docker --help
|
|
191
|
+
mac-storage-cleaner history --help
|
|
192
|
+
mac-storage-cleaner schedule --help
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## What gets cleaned
|
|
196
|
+
|
|
197
|
+
| Category | Paths |
|
|
198
|
+
|---|---|
|
|
199
|
+
| Chrome cache | `~/Library/Caches/Google/Chrome`, `~/Library/Application Support/Google/Chrome/Default/Cache` |
|
|
200
|
+
| Firefox cache | `~/Library/Caches/Firefox` |
|
|
201
|
+
| Safari cache | `~/Library/Caches/com.apple.Safari`, `~/Library/Safari/LocalStorage` |
|
|
202
|
+
| App caches | All subdirectories of `~/Library/Caches` |
|
|
203
|
+
| Conda cache | `~/Library/Caches/conda`, `~/.conda/pkgs` (only if present) |
|
|
204
|
+
| Log files | All items in `~/Library/Logs` |
|
|
205
|
+
| Developer caches | pip, uv, and npm caches (only for tools that are installed) |
|
|
206
|
+
|
|
207
|
+
> **Tip:** Always run `--dry-run` first to preview what will be deleted.
|
|
208
|
+
|
|
209
|
+
## Development
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Install dependencies
|
|
213
|
+
uv sync
|
|
214
|
+
|
|
215
|
+
# Run during development
|
|
216
|
+
uv run mac-storage-cleaner clean --dry-run
|
|
217
|
+
```
|
|
File without changes
|