Keep list
Your own list of what Deskit must never remove, whatever its rules say. dkit clean, dkit purge, dkit installers and dkit uninstall all obey it.
dkit keep # show the list
dkit keep add ~/.cache/huggingface # never clean this folder or file
dkit keep add ~/code/client-site # never purge this project's build folders
dkit keep remove ~/.cache/huggingface # allow it to be cleaned again
You can give several paths at once, and paths relative to the folder you are in.
What it protects
- Anything on the list, and anything inside a folder on it. Listing a project folder protects every build folder in that project.
- A folder that contains something on the list is left alone as a whole, because moving the folder would take the kept item with it. If you list one file inside an app’s cache folder, that whole cache folder stays.
- Things that do not exist yet. You can list a path before anything is there.
The list is checked when planning and again at the moment each item is moved, so adding a path between a preview and the real run still protects it.
A kept item shows up in a preview’s count of things left alone. --json lists each one with the reason on your keep list or contains something on your keep list.
What it does not do
- It does not block undo. An item cleaned before you listed its location can still be put back with
dkit undo. - It does not touch what is already held. Listing a path does not bring back an item that was cleaned earlier; use
dkit undofor that. - It only ever stops removal. Nothing is cleaned because of the list, so changing it needs no confirmation and no
--yes.
The file
The list is a text file, keep.txt in Deskit’s data folder, with one full path per line. Lines starting with # are ignored. You can edit it by hand.
If a line is not a full path (for example it starts with ~ or is relative), dkit clean and dkit purge stop with an error that names the line, instead of guessing. Cleaning something you asked to keep is worse than not cleaning at all.
Paths are stored as they really are on disk. If you add a path that goes through a symbolic link, the folder it points to is what gets listed.
Known limits
- No patterns: each entry is one exact path.
~/code/*/node_modulesis not understood. - The built-in protections (Documents, keys, app data and the rest, see what can never be cleaned) are separate and cannot be switched off from here.
From docs/commands/keep.md at v0.1.0-alpha.2.