Deskit

Installers

Removes installer files you have finished with: the disk images and packages left in Downloads or on the Desktop after the program in them was installed.

dkit installers --dry-run    # see what could be removed; changes nothing
dkit installers              # review, untick what should stay, confirm

It looks at the top of two folders, ~/Downloads and ~/Desktop, and nowhere else. It takes no folder to look in.

On macOS, the first time a terminal reads Downloads or Desktop the system may ask whether to allow it. If you say no, the report lists the folder under “Could not look inside”.

If your Desktop or Downloads folder is kept in sync by a cloud service, it is not looked in at all. Taking a file out of it would remove the file from your other devices too, and listing it can make the service download files that are not on this disk. The commonest case is macOS with iCloud’s “Desktop & Documents Folders” on: Downloads is still looked in, the Desktop is not. The report says so under “Synced folders, left alone”; with --json the folder is in skipped with a synced_by field. There is no option to override this. Purge lists what counts as synced.

What counts as an installer

A name alone is never enough. The file’s name has to end like a known kind of installer, and its content has to prove it is one:

Kind Name ends with Content must show System it comes from
disk-image .dmg a disk image trailer in its last 512 bytes macOS
mac-package .pkg, .mpkg a package archive header at its start macOS
debian-package .deb an archive whose first entry is debian-binary Linux
rpm-package .rpm an RPM lead followed by an RPM header Linux
windows-installer .msi a compound file marked as a Windows Installer package Windows

So a letter you saved as notes.dmg is left alone, and so is a download that stopped halfway. Every kind is looked for on every system: a .msi in Downloads on a Mac is as finished with as one on Windows.

dkit installers --kinds prints this list.

All of these have the same cost: once gone, the file has to be downloaded again.

Only installers that have been there a while

By default a file is only selected when it arrived at least 7 days ago. A file that came today is probably still waiting to be installed.

A file’s age is counted from when it was created on this machine or when it last changed, whichever is later. Some downloads carry the date the file was made elsewhere, which would make a file from this morning look years old; the creation time corrects that where the system records one.

Newer installers are still listed, under “Arrived in the last 7 days”, but are not selected. In the review they start unticked and you can tick them.

dkit installers --dry-run --min-age 30   # only installers at least 30 days old
dkit installers --dry-run --min-age 0    # every installer found, however new

Undo

Installers are moved aside, not deleted, and always held for 7 days:

dkit undo                                           # put back everything the last run is holding
dkit history 20261128-153045                        # every file of one run, and what became of it
dkit undo 20261128-153045 ~/Downloads/Editor.dmg    # put back only that file
dkit release                                        # delete what is being held, freeing the space now
  • The space is not free until the 7 days are over, or until you run dkit release.
  • There is no option to delete installers at once, and no key for it in the confirmation. This is different from clean and purge, which have --release.

See Undo, history and release for the details.

A file on another disk than your home folder cannot be moved aside yet. It is reported and left where it is.

What it never does

These limits are built into the program:

  • Only the top of ~/Downloads and ~/Desktop. Never a file in a folder inside them, and never Documents or anywhere else.
  • Only ordinary files. Never a folder, even one named Something.mpkg, and never a symbolic link. If Downloads or Desktop is itself a link, it is not looked in.
  • Never from a folder a cloud service keeps in sync. A synced Desktop or Downloads is not listed, and a file in one is refused again at the moment of moving, before its content is read.
  • Never by name alone. A file with the right ending and the wrong content is left alone, and reported as such with --json.
  • Never by content alone. A disk image named backup.bin is not touched.
  • Never .exe, .AppImage, .iso or .zip. A Windows installer cannot be told from a program you keep, an AppImage is the app itself, and the other two can hold anything.
  • Never hidden files, whose names start with a dot.
  • Your keep list is respected. dkit keep add ~/Downloads/Editor.dmg protects that file; adding ~/Downloads protects everything in it.
  • Everything is checked twice: when planning, and again at the moment each file is moved. If a file was replaced by something else in between, it stays.

Everything else in those folders is none of this command’s business. Your other files are not listed, counted or read.

Known limits

  • Whether you actually ran an installer cannot be known. Age is the only sign used, so check the preview.
  • A disk image that is still mounted is not detected as such.
  • A read/write disk image has no trailer and is not recognised. Images made for handing out apps are compressed or read-only, and those are.
  • A .pkg, .deb, .rpm or .msi is recognised from its first bytes, so one that is still downloading under its final name can pass. It will be new, so it is not selected unless you pass --min-age 0.
  • Downloads and Desktop are looked for under those names in your home folder. If your system keeps them elsewhere or under a translated name, they are not found. That includes a Desktop that OneDrive has moved into its own folder on Windows: it is not looked in, which is also what a synced folder calls for.
  • A synced folder is recognised by where it is, as purge describes. A sync client set up to mirror Downloads in some other way is not recognised.
  • Where the system does not record when a file was created (some Linux setups), only the time it last changed is used.
  • Only macOS has been run on a real machine. The Linux and Windows file types were checked against real files of each type, on macOS.

From docs/commands/installers.md at v0.1.0-alpha.2.