mcpField
W
wake-on-lan

wake-on-lan

github.com/wmy2981Cloud & DevOps154 installsUpdated 5w ago
Repository

About wake-on-lan

wake-on-lan is a command-line skill for sending UDP Magic Packets to WoL-compatible computers on a local network. It also manages saved host settings and returns results as JSON.

Key features

  1. 01Wake hosts with UDP Magic Packets
  2. 02Add, edit, and list host configurations
  3. 03Wake directly by MAC address
  4. 04Set broadcast, port, and packet count
  5. 05Return results as JSON

Use cases

  1. 01Wake a configured computer by its host name
  2. 02Wake a computer using only its MAC address
  3. 03Adjust packet count for a lossy network

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wmy2981/skills --skill wake-on-lan

After installing, type/wake-on-lanin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

.claude-plugin/
plugin.json
scripts/
.env.example
wol.py

Details

From the project README

Wake on LAN

Send Magic Packets via UDP broadcast to wake up WoL-compatible computers on the local network. Manage host configurations through the script — no manual YAML editing needed.

Execution Rule

Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration. If something is wrong, the script will fail with a clear error — check and fix only then.

Environment Variables

VariableRequiredDescription
WOL_CONFIG_PATH❌Custom path to hosts.yaml (default: ~/.wmyskills/wake-on-lan/hosts.yaml)

The script loads these from ~/.wmyskills/.env (shared across skills) automatically; a scripts/.env in the script directory takes priority if present. Use scripts/.env.example as the template — add the variables to ~/.wmyskills/.env, never overwriting an existing file.

Requirements

pip install pyyaml python-dotenv

Usage

Script: scripts/wol.py

Manage Hosts
# List all configured hosts
python scripts/wol.py list

# Add a host
python scripts/wol.py add my-pc AA:BB:CC:DD:EE:FF --ip 192.168.1.100

# Edit a host's fields
python scripts/wol.py edit my-pc --mac 00:11:22:33:44:55 --ip 192.168.1.10

# Remove a host
python scripts/wol.py remove my-pc
Wake a Host
# Wake by name (from host list)
python scripts/wol.py wake my-pc

# Wake with more packets (improves reliability on lossy networks)
python scripts/wol.py wake my-pc --count 5

# Wake by raw MAC address (no config needed)
python scripts/wol.py wake-mac AA:BB:CC:DD:EE:FF

# Wake by MAC with custom broadcast
python scripts/wol.py wake-mac AA:BB:CC:DD:EE:FF --broadcast 192.168.1.255 --port 9
Add Command Options
FlagDescription
--ip IPIP address (for display/reference)
--broadcast BCBroadcast address (default: 255.255.255.255)
--port PORTUDP port (default: 9)
--count NNumber of magic packets to send (default: 3)
Wake / Wake-MAC Options
FlagDescription
--broadcast BCOverride broadcast address
--port PORTOverride UDP port (default: 9)
--count NNumber of packets to send (default: 3; higher counts improve reliability)
Edit Options
FlagDescription
--new-name NAMERename the host
--mac MACChange MAC address
--ip IPChange IP address
--broadcast BCChange broadcast address
--port PORTChange UDP port
--count NChange packet count

Output Format

All output is JSON:

{"success": true, "host": "my-pc", "mac": "AA:BB:CC:DD:EE:FF", "broadcast": "255.255.255.255", "port": 9, "packets_sent": 3, "message": "Magic packet sent to AA:BB:CC:DD:EE:FF (3x via 255.255.255.255:9)"}

On failure:

{"success": false, "error": "Host 'xyz' not found", "available_hosts": ["my-pc", "my-server"]}

Notes

  • The target computer's network adapter and motherboard must support WoL and have it enabled in BIOS/UEFI.
  • Magic Packet is a UDP broadcast — it stays within the local subnet. Cross-subnet WoL requires directed broadcast or relay configuration.
  • Host configurations are stored in ~/.wmyskills/wake-on-lan/hosts.yaml by default. The script auto-creates this file on first run.
  • Dependencies: Python 3.8+, pyyaml. Standard library sockets used for packet construction.

Comments

Markdown supported