You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-17Lines changed: 58 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
ModCleaner is a small desktop utility for cleaning a game folder with a simple keep-list.
8
8
9
-
It works by comparing the current contents of a game directory against a `#keeplist.txt`file. Anything not covered by the keeplist is treated as removable. This makes it useful for returning a heavily modded game install to a known-good state without manually sorting through every file.
9
+
It works by comparing the current contents of a game directory against the active keeplist file. By default that file is `#keeplist.txt`. If a keeplist prefix is active, the file becomes `#<prefix>-keeplist.txt`. Anything not covered by the active keeplist is treated as removable. This makes it useful for returning a heavily modded game install to a known-good state without manually sorting through every file.
10
10
11
11
## What It Does
12
12
@@ -18,13 +18,16 @@ ModCleaner provides three main actions:
18
18
19
19
### Generate Keeplist
20
20
21
-
Creates or overwrites `#keeplist.txt` inside the selected game folder.
21
+
Creates or overwrites the active keeplist inside the selected game folder.
22
22
23
23
The generated file contains the current folder contents as relative paths. In other words, it takes a snapshot of what exists right now and treats those paths as files to preserve later.
24
24
25
+
> [!IMPORTANT]
26
+
> `Generate Keeplist` overwrites the active keeplist file. If you maintain manual keep rules or `!rename` directives, keep a copy or re-add them after generating.
27
+
25
28
### Scan
26
29
27
-
Reads `#keeplist.txt`, evaluates the keep rules, and shows:
30
+
Reads the active keeplist, evaluates the keep rules, and shows:
28
31
29
32
- planned file removals
30
33
- planned rename operations
@@ -35,17 +38,25 @@ Reads `#keeplist.txt`, evaluates the keep rules, and shows:
35
38
36
39
Applies the current cleanup plan:
37
40
38
-
-deletes files not covered by the keeplist
41
+
-removes files not covered by the keeplist
39
42
- applies any valid `!rename` directives
40
-
- removes empty parent directories left behind by deleted files
43
+
- removes empty parent directories left behind by removed files
44
+
45
+
`Clean` supports two modes:
46
+
47
+
-`Delete` permanently removes files
48
+
-`Quarantine` moves files into `.modcleaner_quarantine/<timestamp>/` inside the selected game folder
49
+
50
+
Neither mode uses the OS recycle bin.
41
51
42
-
`Clean` is destructive. Deleted files are not moved to a recycle bin.
52
+
> [!WARNING]
53
+
> `Delete` permanently removes files. `Quarantine` is safer because it moves removable files into `.modcleaner_quarantine/<timestamp>/`, but it is not a full rollback system.
43
54
44
55
## Intended Workflow
45
56
46
57
1. Select your game folder.
47
58
2. Run `Generate Keeplist` to capture the current files.
48
-
3. Edit `#keeplist.txt` if needed.
59
+
3. Edit the active keeplist if needed.
49
60
4. Run `Scan` to review what would happen.
50
61
5. Run `Clean` only after confirming the scan output.
51
62
@@ -59,22 +70,45 @@ A common pattern is:
59
70
60
71
This tool is snapshot-based.
61
72
62
-
That means if you install new mods or add files after generating `#keeplist.txt`, those new files are not automatically preserved. If you want to keep them, you must either:
73
+
> [!IMPORTANT]
74
+
> If you add mods or other files after generating the active keeplist, those files are not automatically preserved. Regenerate the keeplist or add keep rules manually before cleaning.
75
+
76
+
If you want to keep them, you must either:
63
77
64
78
- regenerate the keeplist, or
65
79
- add keep rules manually
66
80
67
81
Also:
68
82
69
-
-`#keeplist.txt`is never deleted by the cleaner
70
-
-`Scan` requires a valid `#keeplist.txt`
71
-
-`Clean` requires a valid `#keeplist.txt`
83
+
-keeplist files matching `#keeplist.txt`or `#<prefix>-keeplist.txt` are never deleted by the cleaner.
84
+
-`Scan` requires a valid active keeplist
85
+
-`Clean` requires a valid active keeplist
72
86
- an empty keeplist is treated as an error
73
87
- file ordering and planning are deterministic
74
88
89
+
### Keeplist Prefixes
90
+
91
+
ModCleaner supports an optional in-memory keeplist prefix system.
92
+
93
+
- default keeplist: `#keeplist.txt`
94
+
- prefixed keeplist: `#<prefix>-keeplist.txt`
95
+
96
+
The prefix UI is intentionally hidden behind `Ctrl+K`. This is to avoid confusion for users who just want a single keeplist file.
97
+
If you want to use prefixes, press `Ctrl+K` and enter a prefix to switch to a different keeplist file. You can have as many keeplist files as you want, but only one is active at a time.
98
+
99
+
> [!NOTE]
100
+
> Keeplist prefixes are an advanced feature. They do not add extra scanning behavior; they only change which keeplist filename `Generate`, `Scan`, and `Clean` use.
101
+
102
+
Rules:
103
+
104
+
- prefixes are stored in memory only
105
+
- an empty prefix returns to `#keeplist.txt`
106
+
- valid prefixes may contain only letters, numbers, `_`, and `-`
107
+
- invalid prefixes are rejected and do not change the active keeplist
108
+
75
109
## Keeplist Format
76
110
77
-
`#keeplist.txt` is line-based.
111
+
The active keeplist is line-based.
78
112
79
113
Blank lines are ignored.
80
114
@@ -150,7 +184,11 @@ A rename can end in one of these states:
150
184
151
185
Other rename I/O failures are fatal.
152
186
153
-
There is no rollback for partial progress during `Clean`. (This is why `Scan` is important to review beforehand. This may be improved in the future.)
187
+
There is no automatic rollback for partial progress during `Clean`.
188
+
189
+
In `Delete` mode, removed files are gone unless you have your own backup or can restore them another way.
190
+
191
+
In `Quarantine` mode, removed files are moved into `.modcleaner_quarantine/<timestamp>/`, which gives you a manual recovery path, but rename operations and other partial-progress cases are still not rolled back automatically.
154
192
155
193
## Example Keeplist
156
194
@@ -168,11 +206,14 @@ mods/**
168
206
169
207
Review the scan output before cleaning.
170
208
171
-
This tool permanently deletes files that are not matched by the keeplist. It is best used when:
209
+
> [!WARNING]
210
+
> `Scan` is the review step. `Clean` applies the current plan and does not provide automatic rollback for partial progress.
211
+
212
+
This tool can permanently delete files that are not matched by the keeplist. It is best used when:
172
213
173
214
- you understand the folder you are targeting
174
-
- you have a backup or can re-verify game files if needed
175
-
- you have reviewed `#keeplist.txt`
215
+
- you have a backup, can re-verify game files, or are intentionally using quarantine mode
216
+
- you have reviewed the active keeplist
176
217
177
218
## Development
178
219
@@ -203,4 +244,4 @@ ModCleaner is a deterministic keep-list cleaner for game folders.
203
244
204
245
It does not try to detect which files are mods automatically. Instead, it gives you a simple rule:
205
246
206
-
If a file is not covered by `#keeplist.txt`, it is removable.
247
+
If a file is not covered by the active keeplist, it is removable.
0 commit comments