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.
| Key | Type | Default | Meaning |
|---|---|---|---|
| defaults | boolean | true | Start from purgeit's built-in rules. |
| safe | string[] | [] | Directory names that are safe to delete wherever they appear. |
| gated | object[] | [] | Directory names that are only deletable when `when` holds beside them. |
| markers | object[] | [] | |
| disable | string[] | [] | Built-in rule names to switch off. |
| ignore | string[] | [] | Directory names that are never entered. |
| exclude | string[] | [] | Globs, relative to each scan root, that are skipped entirely. |
| groups | object | {} | Named sets of rules, selectable with `--only <group>`. |
| minAge | string | Only offer artifacts untouched for at least this long. | |
| minSize | string | Only offer artifacts at least this large. | |
| includeEmpty | boolean | Offer artifacts that contain no files (normally dropped). | |
| dormantAfter | string | A project untouched for this long is dormant (default 30d). Drives sorting, the interactive R key and --stale. | |
| depth | integer | Never 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:
| Condition | Holds 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)