skills/macos/macos-launchd/SKILL.md
LaunchDaemons/LaunchAgents, plist, launchctl, login items, OpenClaw gateway service
npx skillsauth add alphaonedev/openclaw-graph macos-launchdInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill manages macOS launchd services, including LaunchDaemons and LaunchAgents, for tasks like running background processes, handling login items, and setting up the OpenClaw gateway service. It focuses on creating, loading, and controlling services via plist files and launchctl.
Use this skill when you need to automate macOS services, such as starting a script on system boot (LaunchDaemon), running an app on user login (LaunchAgent), or ensuring the OpenClaw gateway service persists across reboots. Apply it for system-level tasks requiring persistence or for integrating OpenClaw with macOS environments.
To accomplish tasks, first create a plist file in /Library/LaunchDaemons (for system-wide) or ~/Library/LaunchAgents (for user-specific). Use launchctl commands to manage it. For OpenClaw integration, embed the gateway command in the plist and reference env vars. Always validate plist syntax before loading. For programmatic access, use AppleScript to add login items, e.g., via osascript.
launchctl load [-w] /path/to/com.example.plist to load a service; the -w flag writes to persistent storage.launchctl unload [-w] /path/to/com.example.plist.launchctl start com.example.label or launchctl stop com.example.label.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.example.service</string>
<key>ProgramArguments</key><array><string>/usr/bin/python3</string><string>/path/to/script.py</string></array>
<key>RunAtLoad</key><true/>
</dict>
</plist>
launchctl list | grep openclaw to check status.SCDynamicStoreCopyConsoleUser() for user context.When integrating with OpenClaw, place the gateway service in a plist under ProgramArguments, e.g., <string>/path/to/openclaw-gateway --key $OPENCLAW_API_KEY</string>. Set the env var in the plist using <key>EnvironmentVariables</key><dict><key>OPENCLAW_API_KEY</key><string>your_key</string></dict>. Ensure the service runs as the correct user by adding <key>UserName</key><string>yourusername</string>. For cross-skill integration, reference the macos cluster; export paths like export PATH=$PATH:/usr/bin for launchctl access.
Check launchctl exit codes: 0 for success, non-zero for errors (e.g., 78 for invalid plist). Parse errors with plutil -lint /path/to/com.example.plist to validate before loading. If a service fails, use launchctl error <label> or check system logs with log show --predicate 'subsystem == "com.apple.launchd"'. For OpenClaw, if authentication fails, ensure $OPENCLAW_API_KEY is set and not expired; handle by restarting the service with launchctl kickstart -k com.openclaw.gateway. Always unload and reload services after edits to avoid conflicts.
launchctl load -w ~/Library/LaunchAgents/com.example.login.plist. To verify, use launchctl list | grep com.example.sudo launchctl load -w /Library/LaunchDaemons/com.openclaw.gateway.plist. Monitor with launchctl list com.openclaw.gateway.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui