aos network
Connectivity, addresses, and Wi-Fi
14 commands. Run aos network --help for the same list from the binary, or see every group.
Connectivity facts: the active interface and its address, the joined Wi-Fi network, and the local IP on its own for scripts. No display needed. public-ip asks Cloudflare’s trace endpoint (1.1.1.1/cdn-cgi/trace, no account) for the address the internet sees. vpn status|on|off drives the VPNs the OS itself manages (scutil --nc on macOS, NetworkManager on Linux, rasdial on Windows); VPN apps that run their own tunnel outside those settings do not show up. wifi on/wifi off switch the radio, and wifi join <ssid> joins a saved or open network; a password is only ever read from stdin with --password-stdin (Linux and Windows; macOS refuses new secured networks because its only route puts the password on the command line). wifi-qr prints the QR a phone camera scans to join the current network (WIFI:T:WPA;S:...;;) in the terminal, or as a PNG with --out; the saved password goes in only with --password, read from the keychain on macOS (security find-generic-password, which shows an authorization prompt), from netsh wlan show profile key=clear on Windows and from nmcli on Linux. macOS hides the network name from a terminal without Location access, so name it with --ssid there. ports lists listening TCP ports with the pid and process that own them; give a port to ask who holds it (exit 1 when nobody does), and free it with aos process kill --port=<n>. captive-portal asks connectivitycheck.gstatic.com/generate_204 over plain http without following redirects: a 204 is online, any other answer is a portal (with the login URL from its redirect or meta refresh when it gives one), no answer is offline; it exits 1 unless online. speed runs a small speed test against Cloudflare (speed.cloudflare.com, no account): a burst of empty requests for median ping and jitter, then 100 KB, 1 MB and the rest of a 5 MB download budget, then 2 MB up; --max-mb raises the budget.
Commands
Section titled “Commands”aos network captive-portal
Section titled “aos network captive-portal”Check whether a captive portal (hotel, airport Wi-Fi login) is intercepting the connection
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network captive-portal [--json]| flag | values | meaning |
|---|---|---|
--json |
Optional |
aos network captive-portal # online | portal <url> | offline; exit 1 unless onlineaos network captive-portal --json # state, portal, status, probeaos network ip
Section titled “aos network ip”Print the local address of the active interface
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network ipaos network ip # 192.168.1.20aos network ports
Section titled “aos network ports”List listening TCP ports with the pid and process that own them
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network ports [<port>] [--json]| flag | values | meaning |
|---|---|---|
<port> |
Optional positional argument | |
--json |
Optional |
aos network portsaos network ports 3000 # who is on port 3000; exit 1 if nobodyaos network ports --jsonaos network public-ip
Section titled “aos network public-ip”Print this machine’s public IP address as the internet sees it
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network public-ip [--json]| flag | values | meaning |
|---|---|---|
--json |
Optional |
aos network public-ipaos network public-ip --json # ip, country, sourceaos network speed
Section titled “aos network speed”Measure ping, jitter, download and upload speed against Cloudflare (~5 MB down, 2 MB up)
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network speed [--max-mb <n>] [--json]| flag | values | meaning |
|---|---|---|
<n> |
Optional positional argument | |
--max-mb |
Optional | |
--json |
Optional |
aos network speedaos network speed --json # ping_ms, jitter_ms, download_mbps, upload_mbpsaos network speed --max-mb 25 # bigger budget, steadier number on fast linksaos network status
Section titled “aos network status”Print the active interface, address, and Wi-Fi network
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network statusaos network statusaos network vpn off
Section titled “aos network vpn off”Disconnect a system VPN by name
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network vpn off <name>| flag | values | meaning |
|---|---|---|
<name> |
Required positional argument |
aos network vpn off "Work VPN"aos network vpn on
Section titled “aos network vpn on”Connect a system VPN by name
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network vpn on <name>| flag | values | meaning |
|---|---|---|
<name> |
Required positional argument |
aos network vpn on "Work VPN"aos network vpn status
Section titled “aos network vpn status”List the system’s VPN connections and which are connected
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network vpn status [--json]| flag | values | meaning |
|---|---|---|
--json |
Optional |
aos network vpn statusaos network vpn status --jsonaos network wifi
Section titled “aos network wifi”Print the Wi-Fi network currently joined
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network wifiaos network wifiaos network wifi join
Section titled “aos network wifi join”Join a Wi-Fi network; a password is read from stdin, never argv
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network wifi join <ssid> [--password-stdin]| flag | values | meaning |
|---|---|---|
<ssid> |
Required positional argument | |
--password-stdin |
Optional |
aos network wifi join HomeNet # saved or open networkprintf '%s' "$PW" | aos network wifi join HomeNet --password-stdinaos network wifi off
Section titled “aos network wifi off”Turn the Wi-Fi radio off (drops the connection; confirm first if you are remote)
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network wifi offaos network wifi offaos network wifi on
Section titled “aos network wifi on”Turn the Wi-Fi radio on
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network wifi onaos network wifi onaos network wifi-qr
Section titled “aos network wifi-qr”Show a QR code a phone can scan to join the current Wi-Fi (password only with –password)
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos network wifi-qr [--ssid=<name>] [--password] [--out=<file.png>] [--payload]| flag | values | meaning |
|---|---|---|
--ssid |
<name> |
Optional |
--password |
Optional | |
--out |
<file.png> |
Optional |
--payload |
Optional |
aos network wifi-qr # QR in the terminal, network name onlyaos network wifi-qr --password # include the saved password (macOS asks for authorization)aos network wifi-qr --password --out=wifi.pngaos network wifi-qr --ssid=GuestNet --payload # print the WIFI:... text instead of a QR