Skip to Content

Configuration reference

Every config key, generated from the schema that validates it.

purgeit uses the nearest config, searching from the working directory upward: the first of purgeit.config.ts, .mts, .js, .mjs, .cjs, .json, or the purgeit key of a package.json. If none is found it uses a user-level config.* in ~/.config/purgeit/ (the platform's config directory), then the defaults. The nearest config wins outright — configs are not merged. --config <file> names one explicitly, --no-config ignores all of them, and purgeit init writes a starter. TypeScript configs load directly. Unknown keys and bad values are rejected with the file and the problem named. For recipes see Custom rules.

KeyTypeDefaultMeaning
defaultsbooleantrueStart from purgeit's built-in rules.
safestring[][]Directory names that are safe to delete wherever they appear.
gatedobject[][]Directory names that are only deletable when `when` holds beside them.
markersobject[][]
disablestring[][]Built-in rule names to switch off.
ignorestring[][]Directory names that are never entered.
excludestring[][]Globs, relative to each scan root, that are skipped entirely.
groupsobject{}Named sets of rules, selectable with `--only <group>`.
minAgestringOnly offer artifacts untouched for at least this long.
minSizestringOnly offer artifacts at least this large.
includeEmptybooleanOffer artifacts that contain no files (normally dropped).
dormantAfterstringA project untouched for this long is dormant (default 30d). Drives sorting, the interactive R key and --stale.
depthintegerNever descend deeper than this.

Rule shapes

gated:   [{ name: 'out', when: { file: 'project.toml' }, description?: string }]
markers: [{ name: 'MYTOOL.TAG', file: '.mytool-cache', signature: 'mytool-cache-v1' }]

when is one condition, or a list of which any one suffices:

ConditionHolds when…
{ file: 'package.json' }that file sits beside the directory
{ glob: '*.xcodeproj' }any sibling matches
{ grep: { file, pattern } }that sibling's contents match the regex — only the first megabyte is read; unreadable ⇒ no proof
{ inside: 'pyvenv.cfg' }that file exists inside the directory itself

Names are plain file names, never paths. file and glob are answered from the directory listing the scanner already has, so they cost nothing.

Schema

The JSON Schema ships with the package as purgeit/schema.json and is used for editor completion:

{ "$schema": "https://purgeit.nandan.fyi/schema.json" }

The same file ships in the package as purgeit/schema.json (./node_modules/purgeit/schema.json)

On this page