MacOS Launch Agent CLI - easily create, list, update, and delete launch agent PLIST files for MacOS login items.
Find a file
Erich Blume c7a0b04573 Add uv package structure and pytest test framework
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>
2026-01-11 19:18:17 -08:00
.gitignore Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
.python-version Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
conftest.py Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
mcquack.py Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
pyproject.toml Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
README.md Initial commit 2026-01-11 18:22:16 -08:00
test_mcquack.py Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00
uv.lock Add uv package structure and pytest test framework 2026-01-11 19:18:17 -08:00

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