lunchctl
Lightweight Rust library for creating and controlling macOS Launch Agents (launchd) via launchctl. It helps you generate plist files in ~/Library/LaunchAgents, start/stop agents, and query their state.
Features
- Create and serialize Launch Agents to plist
- Bootstrap (start) and bootout (stop) agents via
launchctl - Check agent running state
- Read existing agent configs from disk
- Small, focused API
Installation
Add the dependency to your Cargo.toml:
[]
= { = "https://github.com/mishamyrt/lunchctl" }
Quick start
use ;
Read an existing agent
use LaunchAgent;
if exists
Examples
- Basic end-to-end example:
examples/basic.rs
Run with:
Requirements
- macOS with
launchctl - The library writes plist files to
~/Library/LaunchAgentsfor the current user
License
MIT — see LICENSE for details.