Skip to Content

CLI reference

Every command and option, generated from the CLI itself.

purgeit --help
purgeit [dirs…]            browse and select in the interactive UI (default)purgeit scan [dirs…]       list projects and artifacts, delete nothingpurgeit clean [dirs…]      delete artifactspurgeit explain <path>     why a directory is matched, skipped or protectedpurgeit rules              list the rules in effectpurgeit history            show what has been deletedpurgeit init               write a starter configpurgeit completion <sh>    shell completions (bash, zsh, fish)purgeit skill              print the guide for AI agents

Flags beat the config file. Sizes use binary units (1KB = 1024 bytes); durations accept ms, s, m, h, d, w, y (and 0). Output formats are described in Output formats.

browse

The default command: running purgeit with directories (or none) opens this. See the interactive UI guide.

browse and select artifacts to delete in an interactive terminal UI (default) (alias: tui)

$ purgeit browse [dirs…] [options]
OptionDescriptionDefault
--discoveralso scan the folders where this machine keeps projects
-x, --exclude <glob>skip directories matching a glob (repeatable)
--only <rules>only look for these rules or groups (repeatable, comma-separated)
--safe-onlyskip rules that need a sibling manifest as proof
--min-size <size>ignore artifacts smaller than this, e.g. 50MB
--min-age <duration>ignore artifacts touched more recently than this, e.g. 7d. Nothing is ever refused in the UI unless you set this.
--depth <n>never descend deeper than this
--staleonly artifacts in dormant projects (not worked on for 30 days; see dormantAfter)
--include-emptykeep artifacts that contain no files
--config <file>use this config file instead of searching the working directory
--no-configignore any config file

scan

list artifacts without deleting anything

$ purgeit scan [dirs…] [options]
OptionDescriptionDefault
--discoveralso scan the folders where this machine keeps projects
-x, --exclude <glob>skip directories matching a glob (repeatable)
--only <rules>only look for these rules or groups (repeatable, comma-separated)
--safe-onlyskip rules that need a sibling manifest as proof
--min-size <size>ignore artifacts smaller than this, e.g. 50MB
--min-age <duration>ignore artifacts touched more recently than this, e.g. 7d. Default: 0.
--depth <n>never descend deeper than this
--staleonly artifacts in dormant projects (not worked on for 30 days; see dormantAfter)
--include-emptykeep artifacts that contain no files
--config <file>use this config file instead of searching the working directory
--no-configignore any config file
--format <format>output format One of text, json, ndjson.text
--by <unit>list per project, or every artifact One of project, artifact.project

clean

delete artifacts, re-verifying each one at the moment of deletion

$ purgeit clean [dirs…] [options]
OptionDescriptionDefault
--discoveralso scan the folders where this machine keeps projects
-x, --exclude <glob>skip directories matching a glob (repeatable)
--only <rules>only look for these rules or groups (repeatable, comma-separated)
--safe-onlyskip rules that need a sibling manifest as proof
--min-size <size>ignore artifacts smaller than this, e.g. 50MB
--min-age <duration>ignore artifacts touched more recently than this, e.g. 7d. Also the window nothing recently active is deleted within. Default: 7d.
--depth <n>never descend deeper than this
--staleonly artifacts in dormant projects (not worked on for 30 days; see dormantAfter)
--include-emptykeep artifacts that contain no files
--config <file>use this config file instead of searching the working directory
--no-configignore any config file
--plan <file>delete exactly what a reviewed `scan --format json` report lists
-y, --yesdo not ask for confirmation
-n, --dry-runrun every check but delete nothing
--format <format>output format One of text, json.text

--min-age defaults to 7d for clean and doubles as a guard: anything with a change inside that window is skipped at deletion time, whatever the scan said. See Clean safely.

explain

Runs the same checks clean runs against one directory and reports what it finds — the fastest way to understand a surprising result.

explain why a directory is (or is not) matched, protected, and what clean would do

$ purgeit explain <path> [options]
OptionDescriptionDefault
--min-age <duration>the recent-activity window to judge against (default 7d)
--config <file>use this config file
--no-configignore any config file
--format <format>output format One of text, json.text

rules

list the rules in effect

$ purgeit rules [options]
OptionDescriptionDefault
--category <id>only this ecosystem, e.g. rust
--only <rules>only these rules
--safe-onlyonly rules that need no proof
--config <file>use this config file
--no-configignore any config file
--format <format>output format One of text, json.text

history

show what purgeit has deleted, newest first

$ purgeit history [options]
OptionDescriptionDefault
-n, --limit <count>how many records to show20
--format <format>output format One of text, json.text

init

write a starter purgeit.config.ts in the current directory

$ purgeit init [options]
OptionDescriptionDefault
--jsonwrite purgeit.config.json (with a $schema) instead

completion

source <(purgeit completion bash)                                    # ~/.bashrc
source <(purgeit completion zsh)                                     # ~/.zshrc
purgeit completion fish > ~/.config/fish/completions/purgeit.fish

print a shell completion script (bash, zsh or fish)

$ purgeit completion <shell>

skill

print the guide for AI agents that drive purgeit

$ purgeit skill

Exit codes

CodeMeaning
0success
1some paths were skipped or failed, or you declined the confirmation
2bad arguments, config or plan
70internal error
130interrupted

Environment

purgeit honours NO_COLOR. History lives in ~/Library/Logs/purgeit/history.jsonl on macOS, $XDG_STATE_HOME/purgeit/ (default ~/.local/state/purgeit/) on Linux and %LOCALAPPDATA%\purgeit\Log\ on Windows.

On this page