CLI reference
Every command and option, generated from the CLI itself.
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 agentsFlags 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]| Option | Description | Default |
|---|---|---|
| --discover | also 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-only | skip 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 | |
| --stale | only artifacts in dormant projects (not worked on for 30 days; see dormantAfter) | |
| --include-empty | keep artifacts that contain no files | |
| --config <file> | use this config file instead of searching the working directory | |
| --no-config | ignore any config file |
scan
list artifacts without deleting anything
$ purgeit scan [dirs…] [options]| Option | Description | Default |
|---|---|---|
| --discover | also 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-only | skip 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 | |
| --stale | only artifacts in dormant projects (not worked on for 30 days; see dormantAfter) | |
| --include-empty | keep artifacts that contain no files | |
| --config <file> | use this config file instead of searching the working directory | |
| --no-config | ignore 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]| Option | Description | Default |
|---|---|---|
| --discover | also 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-only | skip 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 | |
| --stale | only artifacts in dormant projects (not worked on for 30 days; see dormantAfter) | |
| --include-empty | keep artifacts that contain no files | |
| --config <file> | use this config file instead of searching the working directory | |
| --no-config | ignore any config file | |
| --plan <file> | delete exactly what a reviewed `scan --format json` report lists | |
| -y, --yes | do not ask for confirmation | |
| -n, --dry-run | run 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]| Option | Description | Default |
|---|---|---|
| --min-age <duration> | the recent-activity window to judge against (default 7d) | |
| --config <file> | use this config file | |
| --no-config | ignore any config file | |
| --format <format> | output format One of text, json. | text |
rules
list the rules in effect
$ purgeit rules [options]| Option | Description | Default |
|---|---|---|
| --category <id> | only this ecosystem, e.g. rust | |
| --only <rules> | only these rules | |
| --safe-only | only rules that need no proof | |
| --config <file> | use this config file | |
| --no-config | ignore any config file | |
| --format <format> | output format One of text, json. | text |
history
show what purgeit has deleted, newest first
$ purgeit history [options]| Option | Description | Default |
|---|---|---|
| -n, --limit <count> | how many records to show | 20 |
| --format <format> | output format One of text, json. | text |
init
write a starter purgeit.config.ts in the current directory
$ purgeit init [options]| Option | Description | Default |
|---|---|---|
| --json | write 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.fishprint a shell completion script (bash, zsh or fish)
$ purgeit completion <shell>skill
print the guide for AI agents that drive purgeit
$ purgeit skillExit codes
| Code | Meaning |
|---|---|
0 | success |
1 | some paths were skipped or failed, or you declined the confirmation |
2 | bad arguments, config or plan |
70 | internal error |
130 | interrupted |
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.