Launchd
@bixu/launchdv2026.04.24.36
01README
Manage macOS launchd daemons: lifecycle, observability, plist management, discovery, and reporting
02Models
@bixu/launchdv2026.03.20.2launchd_daemon.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| label | string | The launchd job label (e.g., com.example.mydaemon) |
| plistPath? | string | Path to the plist file. If omitted, searches standard launchd directories. |
| domain | enum | The launchd domain (system, gui, user) |
fn load()
Load (bootstrap) the daemon into launchd
fn unload()
Unload (bootout) the daemon from launchd
fn enable()
Enable the daemon (persists across reboots)
fn disable()
Disable the daemon (persists across reboots, does not unload)
fn start(force: boolean)
Start (kickstart) the daemon
| Argument | Type | Description |
|---|---|---|
| force | boolean | Force restart even if already running (-k flag) |
fn stop()
Stop the daemon by sending SIGTERM
fn restart()
Restart the daemon (stop + start)
fn sync()
Refresh stored daemon state from launchctl
fn detail()
Get detailed daemon info: program, environment, mach services, limits
fn blame()
Show why and how the daemon was started
fn diagnose()
Diagnose daemon issues: check exit codes, plist validity, loaded state
fn logs(lines: number, level: enum, since: string)
Fetch daemon logs from macOS unified logging
| Argument | Type | Description |
|---|---|---|
| lines | number | Max number of log lines to return |
| level | enum | Minimum log level |
| since | string | Time window (e.g., 1h, 30m, 1d) |
fn plistInfo()
Parse and validate the plist file for this daemon
fn createPlist(outputPath: string, programArguments: array, runAtLoad: boolean, keepAlive: boolean, startInterval?: number, startCalendarInterval?: record, watchPaths?: array, environmentVariables?: record, workingDirectory?: string, standardOutPath?: string, standardErrorPath?: string)
Generate a new plist file for a launchd daemon
| Argument | Type | Description |
|---|---|---|
| outputPath | string | Path to write the plist file (relative to repo or absolute) |
| programArguments | array | Command and arguments to run |
| runAtLoad | boolean | |
| keepAlive | boolean | |
| startInterval? | number | Run every N seconds |
| startCalendarInterval? | record | Cron-like schedule (Hour, Minute, Weekday, etc.) |
| watchPaths? | array | Paths to watch for changes |
| environmentVariables? | record | |
| workingDirectory? | string | |
| standardOutPath? | string | |
| standardErrorPath? | string |
fn list(outputPath: string, programArguments: array, runAtLoad: boolean, keepAlive: boolean, startInterval?: number, startCalendarInterval?: record, watchPaths?: array, environmentVariables?: record, workingDirectory?: string, standardOutPath?: string, standardErrorPath?: string)
List daemons loaded in the domain, filtered by status and pattern
| Argument | Type | Description |
|---|---|---|
| outputPath | string | Path to write the plist file (relative to repo or absolute) |
| programArguments | array | Command and arguments to run |
| runAtLoad | boolean | |
| keepAlive | boolean | |
| startInterval? | number | Run every N seconds |
| startCalendarInterval? | record | Cron-like schedule (Hour, Minute, Weekday, etc.) |
| watchPaths? | array | Paths to watch for changes |
| environmentVariables? | record | |
| workingDirectory? | string | |
| standardOutPath? | string | |
| standardErrorPath? | string |
fn vendors(status: enum)
Report daemons grouped by software vendor
| Argument | Type | Description |
|---|---|---|
| status | enum |
fn scan(pattern: string)
Scan plist directories to discover all installed daemons (loaded or not)
| Argument | Type | Description |
|---|---|---|
| pattern | string | Filter pattern for labels |
fn orphans(pattern: string)
Find orphaned daemons: loaded but no plist on disk, or plist exists but not loaded
| Argument | Type | Description |
|---|---|---|
| pattern | string | Filter pattern for labels |
fn diff()
Compare plist on disk vs loaded state in launchd (drift detection)
fn health(pattern: string)
Check health of daemons with KeepAlive or RunAtLoad that should be running
| Argument | Type | Description |
|---|---|---|
| pattern | string | Filter pattern for labels |
fn processes(pattern: string)
Show CPU and memory usage for running daemon processes
| Argument | Type | Description |
|---|---|---|
| pattern | string | Filter pattern for labels |
fn startup(pattern: string)
Report all daemons configured to start at login/boot (RunAtLoad or KeepAlive)
| Argument | Type | Description |
|---|---|---|
| pattern | string | Filter pattern for labels |
Resources
daemon(infinite)— Launchd daemon state
detail(infinite)— Detailed daemon info from launchctl print
logs(1d)— Daemon log output from unified logging
plistInfo(infinite)— Parsed plist file contents and validation
list(infinite)— List of daemons matching filters
vendors(infinite)— Daemons grouped by software vendor
scan(infinite)— Discovered plist files on disk
orphans(infinite)— Orphaned daemons (loaded without plist, or plist not loaded)
health(infinite)— Health check of daemons expected to be running
processes(1h)— Resource usage of running daemon processes
startup(infinite)— Daemons configured to start at login/boot
03Previous Versions
2026.04.24.35Apr 24, 2026
2026.04.24.1Apr 24, 2026
2026.04.24.34Apr 24, 2026
2026.04.23.33Apr 23, 2026
2026.04.23.1Apr 23, 2026
2026.03.21.31Mar 21, 2026
2026.03.21.1Mar 20, 2026
04Stats
Downloads
3
Archive size
24.9 KB
Not yet scored.
A score will be generated the next time this extension is published. The owner can also trigger scoring manually.
Repository
https://github.com/bixu/swamp-launchd05Platforms
06Labels