$ show imothee/tmpdisk
TmpDisk is a macOS status-bar utility for creating and managing RAM-backed temporary disks (tmpfs/hdiutil volumes). It is a native AppKit/Cocoa application composed of four targets: a menu bar app, a privileged XPC helper installed via launchd, a sandboxed login launcher, and a command-line tool. The main app exposes create/eject/save/list workflows through the status bar menu and a GUI, while privileged operations such as mounting and configuring filesystems are delegated to an XPC helper that validates clients via audit tokens. The CLI communicates with the app through a named pipe, and volume configurations are persisted as .tmpdisk JSON metadata. The system relies heavily on macOS system tools such as hdiutil, diskutil, mount_tmpfs, mdutil, and rsync, and uses Sparkle for updates. This is purely an application repository; there are no data pipelines, notebooks, or research components.
The LLM identified 4 files worth highlighting for reuse:
Core data model for a RAM disk volume with backward-compatible decoding via decodeIfPresent, so old persisted configurations survive schema evolution. It also enforces a strict allowlist for volume names to prevent shell injection when those names are used in privileged command strings. This is a clean example of version-tolerant serialization combined with security-conscious input validation, and it can be extracted as a model pattern for any macOS utility that persists user-defined disk/volume metadata.
Shared module that generates and executes macOS disk commands for RAM disk creation, tmpfs mounts, ejection, indexing, and rsync-based folder synchronization. It centralizes the fragile command-line surface of the app and keeps command construction in one auditable place. The rsync sync-on-eject logic and parameterized diskutil/hdiutil command generation are reusable patterns for any macOS tool that needs to drive shell-level disk operations with careful escaping and error handling.
XPC server for a privileged helper tool that validates incoming connections using audit-token-based client checking before performing privileged disk operations. This demonstrates the correct macOS pattern for separating privileged work from an unprivileged UI app: a launchd-installed helper, a defined XPC protocol, and caller validation. It can be reused as a reference implementation for other macOS apps that need to perform privileged operations without prompting for a password on every call.
A lightweight argument parser for the command-line interface, handling subcommands such as create, eject, save, list, and help. It is self-contained and not coupled to the AppKit UI, making it a reusable pattern for Swift command-line tools that need deterministic, testable argument parsing without pulling in a heavyweight dependency.