Skip to main content

Wake-on-LAN magic packet sender with VLAN support

Project description

wol-cli

CI PyPI version PyPI downloads Python versions License: MIT

A Wake-on-LAN magic packet sender with VLAN support.

Features

  • UDP Broadcast: Standard Wake-on-LAN via UDP broadcast
  • Directed Broadcast: Auto-compute broadcast address from CIDR notation
  • 802.1Q VLAN Support: Send tagged Ethernet frames directly (Linux only, requires root)

Installation

From PyPI

pip install wol-cli

From GitHub Releases (standalone binary)

Download the appropriate binary for your platform from the Releases page:

  • wol-linux-amd64 - Linux x86_64
  • wol-windows-amd64.exe - Windows x86_64
  • wol-macos-amd64 - macOS x86_64

From source

pip install .

For development:

pip install -e ".[dev]"

Usage

Plain UDP Broadcast (same subnet)

wol AA:BB:CC:DD:EE:FF

Directed Broadcast

Auto-computes the broadcast address from a CIDR network:

wol AA:BB:CC:DD:EE:FF --network 192.168.10.0/24

802.1Q Tagged Frame (Linux only)

Send a VLAN-tagged raw Ethernet frame (requires root):

sudo wol AA:BB:CC:DD:EE:FF --vlan-id 10 --interface eth0

Options

Option Description
--ip IP Explicit broadcast/unicast IP (default: 255.255.255.255)
--port PORT UDP port (default: 9)
--network CIDR Subnet for directed broadcast (e.g., 192.168.10.0/24)
--vlan-id ID 802.1Q VLAN ID (1-4094)
--interface IFACE Network interface for 802.1Q mode
--version Show version

Library Usage

from wol_cli import send_udp, send_dot1q, build_magic_packet

# Send via UDP broadcast
send_udp("AA:BB:CC:DD:EE:FF")

# Send via directed broadcast
send_udp("AA:BB:CC:DD:EE:FF", ip="192.168.10.255")

# Build a magic packet manually
packet = build_magic_packet("AA:BB:CC:DD:EE:FF")

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest -v

Run linter:

ruff check src/ tests/

Run type checker:

mypy src/

Releasing

Releases are automated via GitHub Actions.

How to Release

  1. Update version in both files (must match):

    • pyproject.toml: version = "X.Y.Z"
    • src/wol_cli/__init__.py: __version__ = "X.Y.Z"
  2. Create a PR and merge to main/master

  3. The workflow automatically:

    • Validates versions match
    • Creates tag vX.Y.Z (if it doesn't exist)
    • Builds binaries for Linux, Windows, and macOS
    • Creates GitHub release with all artifacts
    • Publishes to PyPI

Note: If the tag already exists, no release is created (idempotent).

License

MIT

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

wol_cli-1.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

wol_cli-1.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file wol_cli-1.1.0.tar.gz.

File metadata

  • Download URL: wol_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wol_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 28c7d72b2cb316cb9fbed57afb192bbdc6a3ee32d9629b5463fd0369971a218f
MD5 ab9044fc5b28b83737d8a103dab67d77
BLAKE2b-256 71fba04d4f60dfad3e714789551b25595deac640301eafbf09abca65634d4406

See more details on using hashes here.

File details

Details for the file wol_cli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: wol_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wol_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13545e6d3050a76a0b136785bbaf2b81864084e9b626685a0536afa585f88ac4
MD5 957aa82f663fb1c90e197cff5a6a4451
BLAKE2b-256 96b467bb0df221071390ed6c49ee58a2e64c5d6f8965255185f26f0c991469b5

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