Scripting and CI¶
JSON¶
Every document has "schemaVersion": 1. Fields are only removed or changed in a new
schema version. A scan looks like:
{
"schemaVersion": 1,
"olderThan": "30d",
"bytes": 97500000000,
"prunableBytes": 64200000000,
"sources": [
{
"id": "npm", "name": "npm cache", "found": true,
"locations": ["/Users/you/.npm"],
"bytes": 41300000000, "items": 48210,
"prunableBytes": 33800000000, "prunableItems": 39102
},
{
"id": "node_modules", "name": "node_modules", "found": true,
"bytes": 11200000000, "prunableBytes": 5400000000, "prunableItems": 5,
"projects": [{ "path": "/Users/you/code/shop/node_modules", "bytes": 1900000000, "idleDays": 140 }]
}
]
}
estimate: true marks sources where the tool decides what goes (pnpm, Docker), so
prunableBytes is the most that can be freed. clean --json adds plan, results
(per source: freedBytes, removed, skipped, notes, errors) and freedBytes.
Exit codes¶
| Code | Meaning |
|---|---|
| 0 | Success (including "nothing to free" and answering no) |
| 1 | Error |
| 2 | Wrong usage, such as an unknown flag or source |
| 3 | clean finished, but some items could not be removed |
Free space on CI runners¶
On GitHub Actions, use the diskdiet action:
- uses: roystondwork-dev/diskdiet@v0.7.1 # x-release-please-version
with:
remove-preinstalled: android,dotnet
Elsewhere, run the CLI directly:
A weekly clean on your machine¶
Or use the desktop app's Clean automatically setting.