Skip to main content

Wake-on-LAN magic packet sender with VLAN support

Project description

wol-cli

CI PyPI version 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. To create a new release:

  1. Update the version in pyproject.toml and src/wol_cli/__init__.py
  2. Commit the changes
  3. Create and push a tag:
    git tag v0.1.0
    git push origin v0.1.0
    

The workflow will automatically:

  • Run tests
  • Build binaries for Linux, Windows, and macOS
  • Build the Python package
  • Publish to PyPI
  • Create a GitHub release with all artifacts

PyPI Setup

To enable PyPI publishing, add a PYPI_API_TOKEN secret to your repository:

  1. Go to PyPI Account Settings
  2. Create an API token
  3. Add it as a repository secret named PYPI_API_TOKEN

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-0.1.0.tar.gz (9.8 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-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wol_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 602fd1c73f389c359c5979e9f5da185488880b71a2ef8e9bb45be9dc21bfed2f
MD5 fccd647cdb23b42ca1f5a0a008522102
BLAKE2b-256 f298b61f928218a2b63ad6b8c60a279980c7d2f9c3c95ef076e5d289ccee6d8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wol_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04e6dd43749d1c13ef6dffdefb28d8ab148b9670012716db9f4f5e39117c3bd6
MD5 d1a744e79384560df5e10565777ffdfa
BLAKE2b-256 484d8fab00360c140ba4709dbf8f79eec7eacbfe89b55d49796f2b84a1c8f2c5

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