MacOS Launch Agent CLI - easily create, list, update, and delete launch agent PLIST files for MacOS login items.
- Python 100%
Set up mcquack as a proper uv package with flat layout (no src/ directory). Uses hatchling build backend to support single-file module structure. Added pytest as dev dependency with fixtures for testing against temporary directories instead of actual macOS LaunchAgent paths. - Rename list() to list_agents() to avoid shadowing builtin (Python 3.14 compat) - Add mock_dirs fixture that monkeypatches LAUNCH_AGENTS_DIR and LOGS_DIR - Add mock_script and mock_launchctl fixtures - 26 tests covering list, create, edit, show, delete commands - Parameterized tests for argument handling - XML validation tests independent of plistlib Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| .python-version | ||
| conftest.py | ||
| mcquack.py | ||
| pyproject.toml | ||
| README.md | ||
| test_mcquack.py | ||
| uv.lock | ||
mcquack
A simple macOS LaunchAgent manager for executable scripts.
Named after Launchpad McQuack, the fearless (if accident-prone) pilot from DuckTales.
Requirements
- macOS (uses launchctl and ~/Library/LaunchAgents)
- uv
Installation
No installation required! Run directly with:
uvx git+https://github.com/eblume/mcquack
Or clone and run the script directly (it's already executable).
Usage
# List all mcquack-managed LaunchAgents
mcquack list
# Create and load an executable as a LaunchAgent
mcquack create /path/to/your/script
# Create with additional arguments for the script
mcquack create /path/to/your/script -- --arg1 value1 --arg2
# Kickstart (immediately run) the LaunchAgent
mcquack launch /path/to/your/script
# Show the current arguments configured in the plist
mcquack show /path/to/your/script
# Edit the arguments in the plist
mcquack edit /path/to/your/script -- --new-arg1 --new-arg2
# Unload (stop) the LaunchAgent
mcquack unload /path/to/your/script
# Delete the LaunchAgent plist file
mcquack delete /path/to/your/script
How it works
mcquack creates plist files in ~/Library/LaunchAgents/ with the naming convention:
mcquack.eblume.<scriptname>.plist
The generated plist configures the script to:
- Run at load
- Keep alive (restart if it exits)
- Log stdout/stderr to
~/Library/Logs/mcquack.<scriptname>.{out,err}.log
License
MIT