Skip to main content

A web UI for managing macOS LaunchAgents -- create, edit, start, stop, and reload agents from your browser

Project description

Mac Agents Manager

Web UI and CLI for managing macOS LaunchAgents.

CI PyPI Python License

Mac Agents Manager lets you create, view, edit, start, stop, and reload user LaunchAgents from a web dashboard or the mam CLI — no manual plist editing or raw launchctl commands required.

Features

  • Web Dashboard — Modern browser UI to browse, create, edit, and control LaunchAgents on localhost
  • Unified CLI — Single mam command for all operations (list, create, start, stop, logs, delete)
  • LaunchAgent Lifecycle — Load, unload, start, stop, restart, and delete agents with one command
  • Agent Creation — Create new keepalive or scheduled LaunchAgents from the CLI or web UI
  • Log Viewer — Tail stdout/stderr logs for any agent with follow mode
  • Auto-Start — Install Mac Agents Manager itself as a LaunchAgent so the dashboard starts at login
  • Localhost Only — Binds to 127.0.0.1 for single-user, local-only access

How It Works

┌────────────────────────────────────────────────────────────────┐
│                           Your Mac                             │
│                                                                │
│   🖥️ Web Dashboard (localhost:8081)    ⌨️ CLI (mam)            │
│   ├─ Browse all LaunchAgents           ├─ mam list             │
│   ├─ Create / Edit agents              ├─ mam create           │
│   ├─ Start / Stop / Restart            ├─ mam start <label>    │
│   └─ View logs                         └─ mam logs <label>     │
│           │                                    │               │
│           └────────────┬───────────────────────┘               │
│                        ▼                                       │
│      ┌───────────────────────────────────────────────┐         │
│      │      ~/Library/LaunchAgents/*.plist            │         │
│      │  User LaunchAgent property list files          │         │
│      └───────────────────────┬───────────────────────┘         │
│                              │                                 │
│                              ▼                                 │
│      ┌───────────────────────────────────────────────┐         │
│      │            launchctl (macOS)                   │         │
│      │  Load · Unload · Start · Stop · Status         │         │
│      └───────────────────────────────────────────────┘         │
│                                                                │
│      Everything runs locally. Nothing leaves your machine.     │
└────────────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

  • macOS (uses macOS-specific launchctl APIs)
  • Python 3.10+ — check with python3 --version. If below 3.10, install it:
    brew install python@3.10
    

Install

# From PyPI
pip3 install mac-agents-manager-ai

# Or with uv
uv pip install mac-agents-manager-ai

# Or in a dedicated virtual environment
mkdir -p ~/.mac_agents_manager
python3 -m venv ~/.mac_agents_manager/venv
source ~/.mac_agents_manager/venv/bin/activate
pip install mac-agents-manager-ai

Run

# Install as macOS service (auto-start at login)
mam service install

# Or start manually
mam serve

# Open the dashboard
mam open

The dashboard is at http://localhost:8081.

Verify

# Check service status
mam service status

# List all LaunchAgents
mam list

# Check version
mam --version

CLI Reference

mam                              # Start web server (default)
mam serve [-p PORT] [--debug]    # Start web server
mam service install              # Install as LaunchAgent (auto-start at login)
mam service uninstall            # Uninstall the LaunchAgent
mam service start|stop|restart   # Control the LaunchAgent service
mam service status               # Show service status
mam list                         # List all agents with status
mam show <label>                 # Show agent details and plist XML
mam create <name> -c CAT -s SCRIPT [-t keepalive|scheduled]
mam load <label>                 # Register agent with launchd
mam unload <label>               # Unregister agent from launchd
mam start <label>                # Start a loaded agent
mam stop <label>                 # Stop a running agent
mam restart <label>              # Restart an agent
mam delete <label> [-y]          # Unload and delete an agent
mam start-all                    # Start all stopped keepalive agents
mam logs <label> [-f] [--stderr] [-n N]  # View agent logs
mam open                         # Open dashboard in browser
mam --version                    # Version info

Architecture

src/mac_agents_manager/
├── __init__.py       # Package version
├── cli.py            # Unified CLI (argparse)
├── app.py            # Flask web dashboard and routes
├── models.py         # LaunchAgent parsing, serialization, and UI data
├── launchctl.py      # Thin wrapper around launchctl commands
├── templates/        # HTML templates (Jinja2)
└── static/           # CSS styles

Environment Variables

Variable Default Description
MAM_PORT 8081 Port to listen on
FLASK_DEBUG off Set to 1 or true to enable Flask debug mode
MAM_LABEL_PREFIXES Comma-separated extra label prefixes to include (e.g. com.myorg.,com.acme.)

Security

This tool binds to 127.0.0.1 only and is designed for single-user, localhost use. See SECURITY.md for the full security model and vulnerability reporting instructions.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request. This project follows the Contributor Covenant Code of Conduct.

Development

# Clone and install in dev mode
git clone https://github.com/pkasinathan/mac-agents-manager.git
cd mac-agents-manager
make dev

# Run linter
make lint

# Auto-format
make format

# Run tests
make test

# All quality checks
make check

Uninstall

mam service uninstall
pip3 uninstall mac-agents-manager-ai
rm -rf ~/.mac_agents_manager

License

Apache License 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac_agents_manager_ai-1.2.2.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_agents_manager_ai-1.2.2-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file mac_agents_manager_ai-1.2.2.tar.gz.

File metadata

  • Download URL: mac_agents_manager_ai-1.2.2.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mac_agents_manager_ai-1.2.2.tar.gz
Algorithm Hash digest
SHA256 993ec3e94be80a58eeb1fb850baf6ccdf819c776177db65b778663dc7bc4c77d
MD5 0d93002e7c4df78c9840c4b66a3dbbd5
BLAKE2b-256 a4b0bddec023f49b68b85e5eb5d3502dc34d3b66162c7cf3ac6b8716333d525a

See more details on using hashes here.

File details

Details for the file mac_agents_manager_ai-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mac_agents_manager_ai-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a1c6fb8b860d47071626e17c8bfaee4c4c735127a8d26f504fede3bc8b3a360a
MD5 5241b061d9c867b529c48cec96e8c3c0
BLAKE2b-256 b2f383e29395a4e7c138b18fc33210ccc3db4001c83d1aea232d595268a47a02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page