devtidy clean
devtidy clean [OPTIONS] [IDS]...Pass rule ids, or --safe for every item marked safe. clean always prints
the plan first.
| Option | Meaning |
|---|---|
--safe |
Clean every present item marked safe. Never selects caution or dangerous items. |
-n, --dry-run |
Show the plan and exit without changing anything. |
-y, --yes |
Do not ask for confirmation. Required when stdin is not a terminal. |
What happens
Section titled “What happens”- The selected rules are scanned again.
- A plan is printed: each item, its size, its safety level and the action. Items whose app is running (for example Xcode) are marked as skipped.
- You confirm with
y. A dangerous item instead asks you to type its id. - Each target is re-checked by the guard right before removal.
- The result lists each item and the space freed, measured on the volume.
$ devtidy clean --safe┌───────────────────┬─────────┬────────┬────────┬──────┐│ Item ┆ Size ┆ Safety ┆ Action ┆ Note │╞═══════════════════╪═════════╪════════╪════════╪══════╡│ Xcode DerivedData ┆ 18.2 GB ┆ safe ┆ delete ┆ ││ Gradle caches ┆ 12.1 GB ┆ safe ┆ delete ┆ │└───────────────────┴─────────┴────────┴────────┴──────┘Estimated to reclaim: 30.3 GB.Proceed? [y/N] y done Xcode DerivedData done Gradle caches
Freed 30.1 GB (measured on disk).Removal methods
Section titled “Removal methods”| Safety | Method |
|---|---|
safe |
Deleted permanently. |
caution |
Moved to the Trash. Space is freed when you empty it. |
dangerous |
Moved to the Trash, only when cleaned on its own. |
When a tool has its own cleanup command (npm cache clean --force,
pod cache clean --all, xcrun simctl delete all), DevTidy runs that
instead. Some rules fall back to removal if the tool is not installed.
In scripts
Section titled “In scripts”devtidy clean --safe --yes --json > cleanup.jsonExits with 1 if any action failed. Every cleanup is recorded in
history.