Crates.io | lunchctl |
lib.rs | lunchctl |
version | 0.2.2 |
created_at | 2025-09-10 11:17:10.350018+00 |
updated_at | 2025-09-25 21:36:26.241333+00 |
description | Library for convenient management of background services and startup items in macOS. |
homepage | https://github.com/mishamyrt/lunchctl |
repository | https://github.com/mishamyrt/lunchctl |
max_upload_size | |
id | 1832405 |
size | 34,375 |
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.
Create plist-backed Launch Agents, bootstrap/bootout them via launchctl
, check running state, and read existing agent configs with a minimal API.
Add lunchctl
to your Cargo.toml
from Git: lunchctl = { git = "https://github.com/mishamyrt/lunchctl" }
.
Use LaunchAgent
to define a job (label, program_arguments
, run_at_load
, keep_alive
), then call write()
, bootstrap()
, is_running()
, boot_out()
, and remove()
.
Use LaunchAgent::exists(label)
and LaunchAgent::from_file(label)
to load an agent and inspect fields like program_arguments
.
See examples/basic.rs
for an end-to-end flow; run it with cargo run --example basic
.
Requires macOS with launchctl
and writes to ~/Library/LaunchAgents
for the current user.
MIT — see LICENSE
for details.