Skip to content

Command line ​

opendisk uses the same engine as the app. Cleaning is a dry run unless you pass --execute.

Build it from source with cargo build --release -p opendisk-cli; the binary is target/release/opendisk.

Commands ​

opendisk scan [PATH] ​

Shows where the space goes. PATH defaults to your home folder; use /System/Volumes/Data for the whole data volume.

Option
--depth NLevels of folders to print, and to include with --json (default 2)
--top NChildren shown per folder (default 10)
--jsonMachine-readable output
--no-indexDon't save the scan in the local scan history

opendisk findings ​

Lists what the rules found, grouped by category, largest first.

Option
--min-size SIZEHide items smaller than this, e.g. 100MB (default 1MB)
--allShow every matched path, not only the top 5 per rule
--jsonMachine-readable output

opendisk clean ​

Plans a clean, prints it, and runs every safety check. Without --execute nothing is changed. With no --rule or --safety, it selects every regenerable finding.

Option
--rule IDOnly these rules (repeatable; see opendisk rules)
--safety LEVELOnly these safety levels: regenerable, review, personal (repeatable)
--min-size SIZESkip items smaller than this (default 1MB)
--executeReally clean. Asks for confirmation
--yes, -yDon't ask for confirmation (needed without a terminal)
--delete-regenerableDelete regenerable caches instead of moving them to the Trash
--allow-permanentAllow emptying the Trash
--jsonPrint the report as JSON
bash
opendisk clean --rule npm-cache --rule pip-cache                 # dry run
opendisk clean --rule npm-cache --execute --delete-regenerable  # frees the space now

After a real clean it prints the space really freed and the run id for undo.

opendisk undo RUN_ID ​

Puts back everything that run moved to the Trash.

opendisk rules ​

Lists the built-in rules: id, safety, category and name. Details are in Built-in rules.

opendisk snapshots ​

Lists APFS local snapshots with an explanation.

opendisk fda [--open] ​

Shows whether the terminal has Full Disk Access; --open opens the settings pane.

Global options ​

--home DIR makes every command treat DIR as the home folder: rules, denylist, journal and scan history all follow it. This is how the test suite runs against fake folder trees, and a safe way to try OpenDisk on a copy.

Released under the MIT License.