Doctor
dkit doctor
A short report of a few things about your machine that are worth knowing. It only looks:
- It changes nothing. It does not fix, move or remove anything, and it does not offer to.
- It needs no administrator rights and never asks for them.
- It reads no app’s data. It looks at whether files exist and parse, not at what they say.
Each check ends in one of three states. There is no “critical” level: the report tells you what it saw and leaves deciding what matters to you.
| State | Meaning |
|---|---|
ok |
Nothing to say. One quiet line. |
note |
Something you may want to know, with what you can do about it yourself. Listed first. |
unknown |
The check could not be made, with the reason. It says nothing either way. |
On a healthy machine the report is a handful of lines ending in “Nothing needs attention.”
What is checked
| Check | Looks at | Says something when | System |
|---|---|---|---|
| Disk space | Free space on the disk that holds your home folder | Under a tenth of the disk, or under 10 GB, is free | macOS, Linux, Windows |
| Disk health | What the startup disk reports about itself (its SMART status) | The status is anything other than “Verified” or “Not Supported” | macOS |
| Startup items | The files in ~/Library/LaunchAgents, each of which starts a program when you log in |
A file names a program, by its full path, that is no longer there | macOS |
| Settings files | The files directly in ~/Library/Preferences |
A file cannot be read as a property list | macOS |
| Time Machine snapshots | The local snapshots Time Machine keeps on the startup disk | Never: the count and the day of the oldest are shown under “Nothing to note” | macOS |
| Logs | The size of ~/Library/Logs |
It holds more than 500 MB | macOS |
On Linux and Windows only the disk space check exists so far, and the report says so. The others read places and tools that only macOS has, and nothing has been guessed for the other systems.
What each check does not claim
Startup items. Only one claim is made: this file names a program that is not there. A leftover like that often comes from an app that was removed without its startup item. Removing the file, or installing the app again, resolves it; Deskit does neither. Everything short of proof is counted as “could not be checked” and never as missing:
- a file that starts its program through a shell or another launcher, such as
/bin/sh,/usr/bin/env,/usr/bin/openorpython3, since the launcher being there says nothing about what it runs; - a program given by a relative path, or as a path inside an app’s bundle;
- a program on another disk under
/Volumes, which may only be unplugged; - a file that cannot be read.
A file with no program in it at all is counted as fine. The startup items in /Library/LaunchAgents and /Library/LaunchDaemons are not looked at: changing those takes administrator rights. Login items set in System Settings are not looked at either, because reading them makes macOS ask for permission.
Settings files. A file counts only when it fails to parse. Empty files, lock files, and the few files macOS keeps private to itself are left out. An app usually makes its settings file again, starting from its defaults, if the damaged one is moved away.
Time Machine snapshots. Having some is how Time Machine normally works, so they are counted and not flagged. Snapshots that system updates leave on the same list are not counted. macOS removes local snapshots itself when the space is needed. How much they hold cannot be read without administrator rights, so only the count and the oldest day are shown.
Logs. dkit clean --dry-run shows which logs can be removed.
Disk health. This is the one line the disk reports about itself. A disk can fail without it changing, so it is no substitute for a backup.
Output
dkit doctor --plain # the same report, never anything interactive
dkit doctor --json # for scripts
dkit doctor has no interactive view. In a terminal it prints the report once; from the menu, it waits for a key before going back.
With --json:
{
"checked_unix": 1795939298,
"checks": [
{
"id": "startup_items",
"title": "Startup items",
"state": "note",
"summary": "1 startup item points to a program that is no longer there: com.example.updater.",
"items": [
{
"name": "com.example.updater",
"path": "/Users/sam/Library/LaunchAgents/com.example.updater.plist",
"detail": "/Applications/Example.app/Contents/MacOS/updater"
}
],
"advice": "Removing the item's file from ~/Library/LaunchAgents, or installing the app again, resolves it. Deskit leaves these files alone."
}
],
"limits": null
}
idis one ofdisk_space,disk_health,startup_items,settings_files,local_snapshots,logs. Which are present depends on the system.stateisok,noteorunknown.itemsis what a note is about, and is empty otherwise.detailis the program a startup item names, or the reason a settings file could not be read.adviceis set for a note only.limitsis text on systems where only some of the checks exist, andnullon macOS.
The exit code is 0 whatever the report says. A check that cannot be made becomes unknown; it does not fail the command.
Good to know
- The checks run the system’s own tools (
plutil,tmutil,diskutil) by their full paths. One that is missing, fails or takes longer than five seconds makes its own checkunknownand leaves the rest alone. - The whole report takes about half a second.
- Only macOS has been run on a real machine.
From docs/commands/doctor.md at v0.1.0-alpha.2.