Instantly share a Wi-Fi connection using a QR code.
Scan it with a phone to connect automatically.
This repository is a maintained fork of thanosgn/wifi-share. It adds current packaging, tests, and platform-specific support while preserving the original terminal workflow.
- Python 3.10 or newer.
- Linux: NetworkManager with
nmcliavailable onPATH. - macOS: the built-in
networksetup,ipconfig,system_profiler, andsecuritytools. Swift is used only as a final SSID-detection fallback when available. - Windows:
netsh; English and Italian system output are supported.
Linux installations using only iwd, wpa_supplicant, or systemd-networkd are not currently supported.
uv is the recommended installer on all three platforms.
git clone https://github.com/alsd4git/wifi-share.git
cd wifi-share
uv tool install .
wifi-sharegit clone https://github.com/alsd4git/wifi-share.git
Set-Location wifi-share
uv tool install .
wifi-shareThe optional Makefile is a convenience wrapper around the same uv tool commands:
make install
make uninstallIt does not require sudo and is not needed on Windows.
For development, create the repository-local environment and run the entrypoint with:
uv sync --locked
uv run wifi-sharepyproject.toml is the canonical dependency declaration; uv.lock provides reproducible development and CI installations.
Running without arguments reads the active Wi-Fi connection and prints a QR code in the terminal:
wifi-shareCommon examples:
# Select a saved network interactively
wifi-share --list
# Supply the SSID and password without reading system credentials
wifi-share --ssid "Guest Wi-Fi" --password "secret"
# Write an SVG using a safe filename derived from the SSID
wifi-share --image
# Write to an explicit PNG path
wifi-share --image guest.pngUse wifi-share --help for the complete option list.
--verbose includes the retrieved Wi-Fi password in terminal output. Use it only when exposing that credential in the current terminal is acceptable.
macOS may hide the current SSID unless Location Services access is available. Wi-Fi Share tries the built-in network tools first, uses CoreWLAN through Swift only as a final fallback, and then offers the saved-network picker.
Saved credentials are read from Keychain with security. macOS may show an authorization prompt the first time a password is requested.
Profiles and credentials are read using netsh. English and Italian output, including open networks, are covered by automated tests. Other Windows display languages are not guaranteed.
Wi-Fi Share reads the active NetworkManager connection directly and uses its profile to retrieve the SSID and saved PSK. If multiple saved profiles share an SSID, --list displays the associated profile name so the intended one can be selected.
uv run python -m unittest discover -s tests -v
uv run ruff format --check wifi_share.py tests
uv run ruff check --select E9,F63,F7,F82 wifi_share.py tests
uv run python -m compileall -q wifi_share.py tests
uv buildGitHub Actions runs these checks on Ubuntu, macOS, and Windows with every supported Python minor version. The hosted runners validate parsing, CLI behavior, and packaging with mocked system output; they cannot access real Wi-Fi hardware or saved credentials.
Before a release, manually smoke-test each platform with an active network, --list, an open network, a saved password, SVG output, and PNG output.
Changes that remain useful to the original project can be proposed upstream as focused pull requests after they have passed this repository's cross-platform tests.
