Skip to content
jc-rs
GitHub

wg-show

--wg-showv1.0.0

Converts `wg show all dump` command output to JSON

LinuxmacOSFreeBSDcommand
$ wg show | jc-rs --wg-show

A real pair

From the reference corpus (windows/windows-10/wg_show.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

wg showwindows-10
wg0     Xa4Bq8AUFrjKp+Z283VDzEUVeOOn2wX/uuLTMUkkJens=    mL2Co/VecYWtXSY6YUZAI6cAsFZDCEV+9iZKibNcWTu=    45321   off
wg0     bN9QoMEqlKUpncq0Q8ye9yURczKwmbXzwVsG7A+RV2B=    (none)  123.45.67.89:51820      0.0.0.0/0       0       0       1532    off
wg0     yJ3PoNAqlNUpmcq0P7xv8zURdyKwmbZwwUsG9B+SV3C=    kP2Lo/WfgVWtYSY7ZUZAJ7cBsEZECFV+8jYKidOcVTv=    53211   off
wg0     dQ5AoNAqpOUlncq0P9ze8xURayLwmbYwwVsH8C+TV4D=    (none)  203.0.113.4:51820       192.168.1.0/24  0       0       2001    off
wg0     pR6DoOBqmNUlncq0P1wq9zUSeyJwmbVxxWsF7D+RU5E=    qN2Mo/XghWWtXSY8YVZBK8cDsFZDCFQ+7kZKjbNcWTx=    67514   off
wg0     tA8AoPCqoPUlncq0P8xe7xUSayKwmbWxxVsG8E+UV6F=    (none)  198.51.100.15:51820     10.0.0.0/8      0       0       1403    off
wg0     zU9CoQCqmQUlncq0P4wo6yUTbyJwmbYyyWsF9F+SV7G=    vM2Ko/YigXWtYSY9YUZCJ9dCsGZECFV+5lZLjcOcVVy=    79812   off
wg0     xC7DoRDqnRUlncq0P2wq9yUScyKwmbXzyWsH8F+TU8H=    (none)  172.16.0.1:51820        172.16.0.0/16   0       0       1872    off
wg0     rE4AoSCqnSUlncq0P7wv9zURdyLwmbZxzWsG9G+UV9I=    fN2Oo/ZjhYUtXSZ0YUZDK8eDsFZDCFQ+4jYKjcNcVVw=    91114   off
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "device": "wg0",
    "private_key": "Xa4Bq8AUFrjKp+Z283VDzEUVeOOn2wX/uuLTMUkkJens=",
    "public_key": "mL2Co/VecYWtXSY6YUZAI6cAsFZDCEV+9iZKibNcWTu=",
    "listen_port": 45321,
    "fwmark": null,
    "peers": [
      {
        "public_key": "bN9QoMEqlKUpncq0Q8ye9yURczKwmbXzwVsG7A+RV2B=",
        "preshared_key": null,
        "endpoint": "123.45.67.89:51820",
        "latest_handshake": 0,
        "transfer_rx": 0,
        "transfer_sx": 1532,
        "persistent_keepalive": -1,
        "allowed_ips": [
          "0.0.0.0/0"
        ]
      }
    ]
  },
  {
    "device": "wg0",
    "private_key": "yJ3PoNAqlNUpmcq0P7xv8zURdyKwmbZwwUsG9B+SV3C=",
    "public_key": "kP2Lo/WfgVWtYSY7ZUZAJ7cBsEZECFV+8jYKidOcVTv=",
    "listen_port": 53211,
    "fwmark": null,
    "peers": [
      {
        "public_key": "dQ5AoNAqpOUlncq0P9ze8xURayLwmbYwwVsH8C+TV4D=",
        "preshared_key": null,
        "endpoint": "203.0.113.4:51820",
        "latest_handshake": 0,
        "transfer_rx": 0,
        "transfer_sx": 2001,
        "persistent_keepalive": -1,
        "allowed_ips": [
          "192.168.1.0/24"
        ]
      }
    ]
  },
  {
    "device": "wg0",
    "private_key": "pR6DoOBqmNUlncq0P1wq9zUSeyJwmbVxxWsF7D+RU5E=",
    "public_key": "qN2Mo/XghWWtXSY8YVZBK8cDsFZDCFQ+7kZKjbNcWTx=",
    "listen_port": 67514,
    "fwmark": null,
    "peers": [
      {
        "public_key": "tA8AoPCqoPUlncq0P8xe7xUSayKwmbWxxVsG8E+UV6F=",
        "preshared_key": null,
        "endpoint": "198.51.100.15:51820",
        "latest_handshake": 0,
        "transfer_rx": 0,
        "transfer_sx": 1403,
        "persistent_keepalive": -1,
        "allowed_ips": [
          "10.0.0.0/8"
        ]
      }
    ]
  },
  {
    "device": "wg0",
    "private_key": "zU9CoQCqmQUlncq0P4wo6yUTbyJwmbYyyWsF9F+SV7G=",
    "public_key": "vM2Ko/YigXWtYSY9YUZCJ9dCsGZECFV+5lZLjcOcVVy=",
    "listen_port": 79812,
    "fwmark": null,
    "peers": [
      {
        "public_key": "xC7DoRDqnRUlncq0P2wq9yUScyKwmbXzyWsH8F+TU8H=",
        "preshared_key": null,
        "endpoint": "172.16.0.1:51820",
        "latest_handshake": 0,
        "transfer_rx": 0,
        "transfer_sx": 1872,
        "persistent_keepalive": -1,
        "allowed_ips": [
          "172.16.0.0/16"
        ]
      }
    ]
  },
  {
    "device": "wg0",
    "private_key": "rE4AoSCqnSUlncq0P7wv9zURdyLwmbZxzWsG9G+UV9I=",
    "public_key": "fN2Oo/ZjhYUtXSZ0YUZDK8eDsFZDCFQ+4jYKjcNcVVw=",
    "listen_port": 91114,
    "fwmark": null,
    "peers": []
  }
]

Fixture coverage

2/2oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs wg showjc-rs runs the command itself and parses what it prints. Recognised for: `wg show`

Source: crates/jc-rs-parsers/src/security/wg_show.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare