Skip to content

Command Line Interface

fzihak edited this page Nov 27, 2026 · 1 revision

Command line interface

The installer ships freemydisk-cli.exe: the same engine as the app, for scripts and scheduled tasks. It uses the same safety rules, journal and Recycle Bin behaviour as the app.

Where it is

freemydisk-cli.exe sits in the install folder:

Install type Path
Current user only %LOCALAPPDATA%\FreeMyDisk\freemydisk-cli.exe
All users C:\Program Files\FreeMyDisk\freemydisk-cli.exe

The installer doesn't add it to PATH. To call it as freemydisk-cli from any folder, add the install folder to your user PATH, or set an alias in your PowerShell profile:

Set-Alias freemydisk-cli "C:\Program Files\FreeMyDisk\freemydisk-cli.exe"

Common options

Option Meaning
-f, --format <text|json|csv> Output format. Default text. Available on every command.
-y, --yes Don't ask for confirmation. Use it in scripts.
-h, --help Help for a command, for example freemydisk-cli clean --help.
-V, --version Show the version.

Commands

Command What it does
scan Show what each cleanup rule can remove
clean Clean with the cleanup rules
large-files Find large files
duplicates Find and clean duplicate files
artifacts Developer build artifacts such as node_modules, target and .venv
analyze Folder size tree
heavy-folders Folders of 1 GB or more
apps Installed apps and leftovers
privacy Browser traces, cookies and activity logs
startup Startup apps and their boot impact
maintenance Windows repair tasks
rescue Emergency Rescue
virtualization WSL2 and Docker disks
vitals Hardware, memory and drive information

scan

freemydisk-cli scan [--category <system|browser|application|development|ai>] [--rules-path <dir>]

--rules-path loads rules from a folder instead of the built-in set, which is useful for testing a new rule.

clean

freemydisk-cli clean [--category <name>] [--dry-run] [--permanent] [--yes]
Option Meaning
--dry-run Show exactly what would happen. Nothing is moved or deleted.
--always-trash Send files to the Recycle Bin. This is the default.
--permanent Delete permanently instead of using the Recycle Bin.

Tip

Always run clean --dry-run first when you write a script.

large-files

freemydisk-cli large-files [--roots <dirs>] [--min-size <MB>] [--limit <n>] [--trash <path>] [--trash-all] [--yes]

Defaults: current folder, 100 MB minimum, 50 results. --trash moves one file to the Recycle Bin. --trash-all moves every result.

duplicates

freemydisk-cli duplicates [--roots <dirs>] [--min-size <MB>] [--clean] [--heuristic <rule>] [--yes]

--clean moves duplicate copies to the Recycle Bin and keeps one copy per group. --heuristic picks the copy to keep: keep-oldest (default), keep-newest, keep-shortest or keep-longest (path length).

artifacts

freemydisk-cli artifacts [--roots <dirs>] [--min-size <MB>] [--inactive-days <n>] [--clean] [--yes]

Searches common development folders unless you give --roots. --inactive-days 30 shows only projects not changed for 30 days. --clean moves the artifacts to the Recycle Bin.

analyze

freemydisk-cli analyze [--path <dir>] [--depth <n>]

Default: current folder, depth 3.

heavy-folders

freemydisk-cli heavy-folders [--path <dir>] [--min-size-gb <GB>] [--depth <n>]

Default: 1 GB minimum, depth 6.

apps

freemydisk-cli apps [--leftovers] [--clean-leftovers] [--yes]

privacy

freemydisk-cli privacy [--category <cache|history|cookies|downloads|sessions|system_activity>] [--clean | --clean-all] [--close-browsers] [--whitelist <domains>] [--yes]
Option Meaning
--clean Clean safe traces: caches and activity logs
--clean-all Also clean cookies and history
--close-browsers Close running browsers first, so their databases unlock
--whitelist github.com,google.com Keep cookies for these domains

startup

freemydisk-cli startup

maintenance

freemydisk-cli maintenance --list
freemydisk-cli maintenance --task <id>     # e.g. icon_cache, dns_flush, search_index, update_cache
freemydisk-cli maintenance --all           # every recommended safe task

rescue

freemydisk-cli rescue [--yes]

virtualization

freemydisk-cli virtualization --list
freemydisk-cli virtualization --compact <distro>

Lists WSL2 distributions with their virtual disk sizes and Docker status, and compacts a distribution's VHDX.

vitals

freemydisk-cli vitals --format json

Recipes

Weekly developer-cache cleanup with Task Scheduler

& "C:\Program Files\FreeMyDisk\freemydisk-cli.exe" clean --category development --yes --format json |
  Out-File "$env:USERPROFILE\freemydisk-weekly.json"

Find the 20 biggest files on D:

freemydisk-cli large-files --roots "D:\" --min-size 500 --limit 20

Export duplicate photos as CSV for review

freemydisk-cli duplicates --roots "D:\Photos" --min-size 5 --format csv > duplicates.csv

Clone this wiki locally