WireGuard helper CLI (configs, clients, QR)
Project description
wg-helper-script
WireGuard helper CLI for initializing, validating, and emitting server/client configs with optional QR codes. Includes client management (add/disable/remove) and AmneziaWG parameters.
Features
- Initialize a secure YAML config (
init) with generated keys. - Validate configuration (
validate-cfg). - Emit server and client
.conffiles and client QR codes (emit-configs). - Manage clients:
client-add,client-disable,client-remove.
Install
python -m pip install wg-helper-script
Quickstart
wg-helper-script init -o config.yml --overwrite
wg-helper-script validate-cfg -c config.yml
wg-helper-script emit-configs -c config.yml
Run with module if not installed: python -m wg_helper_script ....
Requires Python 3.11+.
Configuration
- YAML file (default
./config.yml). Paths inside are relative to the config location. - Environment overrides: prefix
WGHS_(e.g.,WGHS_CONFIG,WGHS_SERVER_NAME,WGHS_SERVER_DNS).
Server keys: if both are omitted on init, a valid keypair is generated. Validation ensures keys are well‑formed and match when both present.
Commands
init: Generate initial config. Flags mirror env vars (e.g.,--server-name,--server-dns).validate-cfg: Load and validate a config file.emit-configs: Write server/client configs underserver-path/clients-path. Use--only-serveror--only-clients. QR generation can be disabled by (--qr/--no-qr).client-add NAME: Adds a client with next free IP, keys, psk.client-disable NAME: Marks a client disabled.client-remove NAME: Removes a client.
Init Options
The init command accepts flags and/or WGHS_* environment variables. Unspecified Amnezia fields are auto‑generated
within recommended ranges when Amnezia is enabled.
| Flag | Env var | Type | Default | Description |
|---|---|---|---|---|
-o, --output |
WGHS_OUTPUT |
path | config.yml |
Output config path |
--overwrite |
– | bool | false |
Overwrite existing file |
--clients-path |
WGHS_CLIENTS_PATH |
str | clients |
Relative clients dir |
--server-path |
WGHS_SERVER_PATH |
str | server |
Relative server dir |
--emit-qr --no-emit-qr |
WGHS_EMIT_QR |
bool | true |
Emit client QR PNGs |
--amnezia-enabled --no-amnezia-enabled |
WGHS_AMNEZIA_ENABLED |
bool | true |
Toggle AmneziaWG fields |
--amnezia-jc |
WGHS_AMNEZIA_JC |
str | random | Amnezia Jc |
--amnezia-jmin |
WGHS_AMNEZIA_JMIN |
str | random | Amnezia Jmin |
--amnezia-jmax |
WGHS_AMNEZIA_JMAX |
str | random | Amnezia Jmax |
--amnezia-s1 |
WGHS_AMNEZIA_S1 |
str | random | Amnezia S1 |
--amnezia-s2 |
WGHS_AMNEZIA_S2 |
str | random | Amnezia S2 |
--amnezia-h[1-4] |
WGHS_AMNEZIA_H[1-4] |
str | random | Amnezia H1-4 |
--amnezia-i[1-5] |
WGHS_AMNEZIA_I[1-5] |
str | none | Amnezia I1-5 |
--server-name |
WGHS_SERVER_NAME |
str | wg0 |
Interface name |
--server-private-key |
WGHS_SERVER_PRIVATE_KEY |
base64 | autogenerate | Server private key (32‑byte base64) |
--server-public-key |
WGHS_SERVER_PUBLIC_KEY |
base64 | autogenerate | Server public key (derived if both missing) |
--server-public-host |
WGHS_SERVER_PUBLIC_HOST |
str | – | Public host/IP for clients |
--server-address |
WGHS_SERVER_ADDRESS |
CIDR | 10.10.10.1/24 |
Server address/CIDR |
--server-listen-port |
WGHS_SERVER_LISTEN_PORT |
int | 51821 |
Server ListenPort |
--server-mtu |
WGHS_SERVER_MTU |
int | 1380 |
Interface MTU |
--server-dns |
WGHS_SERVER_DNS |
str | 1.1.1.1, 8.8.8.8 |
Comma‑separated DNS list |
--server-pre-up |
WGHS_SERVER_PRE_UP |
str | – | PreUp hook |
--server-post-up |
WGHS_SERVER_POST_UP |
str | – | PostUp hook |
--server-pre-down |
WGHS_SERVER_PRE_DOWN |
str | – | PreDown hook |
--server-post-down |
WGHS_SERVER_POST_DOWN |
str | – | PostDown hook |
Security Notes
- Do not commit real private keys. Examples are placeholders.
- Emitted configs and
config.ymlare written with0600permissions on POSIX.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wg_helper_script-0.1.0.tar.gz.
File metadata
- Download URL: wg_helper_script-0.1.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3751eb9691a944481fe7d924c30d8e5efb4882af9538685cc81f30528b7d0d4b
|
|
| MD5 |
156656142a1761af12ee5a47af790d93
|
|
| BLAKE2b-256 |
e3c7b0869c34486780cae2f327b1a739fd97cf77be2930b8d22fc46dbb5d7d9c
|
Provenance
The following attestation bundles were made for wg_helper_script-0.1.0.tar.gz:
Publisher:
release.yml on xobotyi/wg-helper-script
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wg_helper_script-0.1.0.tar.gz -
Subject digest:
3751eb9691a944481fe7d924c30d8e5efb4882af9538685cc81f30528b7d0d4b - Sigstore transparency entry: 482202452
- Sigstore integration time:
-
Permalink:
xobotyi/wg-helper-script@426fd4385e176be27ad6470934974bf43a2a6d6f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xobotyi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@426fd4385e176be27ad6470934974bf43a2a6d6f -
Trigger Event:
push
-
Statement type:
File details
Details for the file wg_helper_script-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wg_helper_script-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
665a125d5f2e4afc6922db31449b364c71e9034a473adb58166cfbe192b23fcb
|
|
| MD5 |
d035b00193cd040dbf82a52b819c2aba
|
|
| BLAKE2b-256 |
df6e75d17f0726a068bd5e32c7c115e2e0088df8088036232e4d3cb413d6a919
|
Provenance
The following attestation bundles were made for wg_helper_script-0.1.0-py3-none-any.whl:
Publisher:
release.yml on xobotyi/wg-helper-script
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wg_helper_script-0.1.0-py3-none-any.whl -
Subject digest:
665a125d5f2e4afc6922db31449b364c71e9034a473adb58166cfbe192b23fcb - Sigstore transparency entry: 482202467
- Sigstore integration time:
-
Permalink:
xobotyi/wg-helper-script@426fd4385e176be27ad6470934974bf43a2a6d6f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xobotyi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@426fd4385e176be27ad6470934974bf43a2a6d6f -
Trigger Event:
push
-
Statement type: