Skip to content
baken667Public

About

macOS app that uninstalls apps completely and cleans caches. Everything goes to the Trash.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

diskman

A small macOS app that frees disk space without deleting anything behind your back.

It does two things:

  • Uninstalls apps completely. Pick an app and diskman lists everything it keeps on disk: the bundle, its containers, preferences, caches, logs, launch agents, plug-ins and installer receipts.
  • Cleans caches and logs. Build caches, package manager downloads, browser caches and logs are found by a list of declarative rules, sized, and shown before anything is touched.

How it stays safe

A tool that removes files should be boring about it:

  • Everything goes to the Trash. There is one code path for removal and it only moves items to the Trash. Nothing is deleted permanently; space is freed when you empty the Trash yourself.
  • You see it first. The uninstaller lists every item with its path, its size and the reason it is listed. The cleanup screen shows each rule with its total size; expand a rule to see its items and untick the ones you want to keep.
  • Some things are only measured. Simulator devices, virtual machine disks and device backups are shown with their size and, where one exists, the command of the tool that owns them. diskman never removes those.
  • It tells you what it reads. Help › What diskman Reads lists the folders and rules it looks at, generated from the same tables the scanners use.
  • A second copy changes nothing. If the app you remove has a twin elsewhere on the Mac, only the copy itself is ticked; the shared data stays unless you tick it.
  • Unsure means unchecked. Leftovers that may belong to another product (a bundle ID with an unknown suffix, a same-vendor ID, dot folders in your home folder) and cleanup rules that are not fully regenerable are shown but never preselected.
  • The app goes first. If an app bundle cannot be moved to the Trash, its data is left alone.
  • No helper running as root. What needs an administrator (apps installed by a package, files in /Library) is handed to Finder, which asks for the password itself. macOS asks once whether diskman may control Finder.
  • Running apps are left alone. An app cannot be removed while it is running, and a cleanup rule tied to specific apps is blocked until they quit. Catch-all cache rules cannot know which apps are running, so they are opt-in.
  • Rules stay inside their folder. A cleanup rule cannot match anything outside the path it names, and a symlink it finds there is neither followed nor removed.

Requirements

  • A Mac with Apple silicon. Intel Macs are not supported.
  • macOS 26 or later
  • Xcode 27.2 or later to build

Install

Download the latest disk image from Releases, open it and drag diskman to Applications. Releases are signed with a Developer ID and notarized by Apple.

Updates

When it opens, diskman asks GitHub for the number of the latest release and shows a note in the sidebar if a newer one is out. That request and the update you ask for are the only times the app uses the network, and the request carries nothing about you or your disk. Click Update and Restart and diskman downloads that release, checks that it is signed by the same developer, replaces itself and reopens. Nothing is installed until you click. Turn the check off in Settings.

Shortcuts

Check What diskman Can Clean is available as an action in Shortcuts and Spotlight. It measures the safe caches and logs and removes nothing; cleaning always goes through the preview in the app.

Build

git clone https://github.com/baken667/diskman.git
cd diskman
open diskman.xcodeproj

Select the diskman scheme and run. Signing is set to automatic, so choose your own team in Signing & Capabilities first.

Full Disk Access

macOS hides other apps' containers and a few Library folders from every app by default. Without Full Disk Access diskman still works, but it finds fewer leftovers. The app shows a banner with a button that opens the right pane in System Settings; nothing is blocked if you decline.

macOS ties the permission to the app's code signature, so a build signed without a team may ask for it again after you rebuild.

Project layout

Path What it is
DiskmanCore/ Swift package with all disk logic and no UI: finding leftovers, expanding cleanup rules, sizing, moving to the Trash.
DiskmanCore/Sources/DiskmanCore/Resources/cleanup-rules.json The built-in cleanup rules.
diskman/ The SwiftUI app, a thin layer over the package.

Run the tests of the core package:

cd DiskmanCore
swift test

The tests never write outside temporary folders and never move anything to the Trash.

Adding a cleanup rule

Rules live in cleanup-rules.json. A rule is one JSON object:

{"id": "firefox.cache", "group": "Browsers", "kind": "caches", "isSafe": true,
 "name": "Firefox Cache",
 "description": "Web pages, scripts and graphics Firefox stored to load sites faster (history, passwords and logins are kept); sites load a bit slower until it fills again.",
 "paths": ["~/Library/Caches/Firefox/*"], "appBundleIDs": ["org.mozilla.firefox"]}
Field Meaning
id Unique, stable identifier.
group Section the rule is listed under.
kind What the items are, for example caches or logs.
isSafe true only if everything the rule matches is rebuilt automatically with no loss. Safe rules are checked by default; the rest are opt-in.
name, description Shown to the user. The description must say what happens after removal.
paths Patterns starting with ~/. Any path component may be a glob (*, *.log). A pattern must contain at least one glob, and only items inside its literal prefix are matched.
appBundleIDs Apps that must be quit before the rule can run. May be empty.
reportOnly Optional. true for data that only its own tool can shrink safely: it is measured and explained, never removed. Must not be isSafe.
hint Optional, report-only rules only. A command of the owning tool, shown to copy and never run. Only add one you have run yourself.

Guidelines:

  • Order matters. A path belongs to the first rule that claims it, so put specific rules above catch-all ones.
  • Check the path on a real machine, and check what the tool does after its cache is gone.
  • When in doubt, set isSafe to false.

Releasing

Move the entries under Unreleased in CHANGELOG.md to a section for the new version; that section becomes the release notes. Then push a tag, which builds, signs, notarizes and publishes that version:

git tag v1.1
git push origin v1.1

The version number comes from the tag. The release workflow needs these repository secrets:

Secret What it is
DEVELOPER_ID_P12 The "Developer ID Application" certificate with its private key, exported as .p12 and base64-encoded.
DEVELOPER_ID_P12_PASSWORD The password chosen when exporting it.
ASC_KEY_P8 An App Store Connect API key (the contents of the .p8 file), used for notarization.
ASC_KEY_ID That key's ID.
ASC_ISSUER_ID The issuer ID shown above the key list in App Store Connect.

License

MIT

About

macOS app that uninstalls apps completely and cleans caches. Everything goes to the Trash.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages