#launch-agent #macos #service #bootstrap #startup #plist

lunchctl

Library for convenient management of background services and startup items in macOS

4 releases

0.2.2 Sep 25, 2025
0.2.1 Sep 25, 2025
0.2.0 Sep 25, 2025
0.1.0 Sep 10, 2025

#9 in #startup

Download history 2/week @ 2025-10-07 9/week @ 2025-10-14 26/week @ 2025-10-21 7/week @ 2025-10-28 1/week @ 2025-11-04 6/week @ 2025-11-18 12/week @ 2025-11-25 38/week @ 2025-12-02 29/week @ 2025-12-09 36/week @ 2025-12-30 48/week @ 2026-01-06 5/week @ 2026-01-13 284/week @ 2026-01-20

373 downloads per month
Used in betterdisplay-kvm

MIT license

21KB
371 lines

lunchctl

Lightweight Rust library for creating and controlling macOS Launch Agents (launchd) via launchctl. It generates plist files in ~/Library/LaunchAgents, starts/stops agents, and lets you query their state.

Features

Create plist-backed Launch Agents, bootstrap/bootout them via launchctl, check running state, and read existing agent configs with a minimal API.

Installation

Add lunchctl to your Cargo.toml from Git: lunchctl = { git = "https://github.com/mishamyrt/lunchctl" }.

Quick start

Use LaunchAgent to define a job (label, program_arguments, run_at_load, keep_alive), then call write(), bootstrap(), is_running(), boot_out(), and remove().

Read an existing agent

Use LaunchAgent::exists(label) and LaunchAgent::from_file(label) to load an agent and inspect fields like program_arguments.

Examples

See examples/basic.rs for an end-to-end flow; run it with cargo run --example basic.

Requirements

Requires macOS with launchctl and writes to ~/Library/LaunchAgents for the current user.

License

MIT — see LICENSE for details.

Dependencies

~5.5MB
~100K SLoC