wifi-cli-macos
v2.3.2
Published
Wi-Fi CLI MacOS is a command line utility for managing network connections on MacOS
Downloads
666
Maintainers
Readme
🛜 Wi-Fi CLI MacOS
Wi-Fi CLI MacOS is a command line utility for managing network connections on MacOS.

Features
- 📡 Scan and connect to nearby Wi-Fi networks
- 📱 Detect nearby iPhone hotspots via BLE
- 🔒 Manage your saved networks and retrieve passwords from keychain
- 🌐 Configure DNS, IP, MAC, and router addresses
- 🔁 Built-in DNS presets (Cloudflare, Google, OpenDNS, Quad9)
- 📷 Generate QR codes to share your Wi-Fi
- 🚀 Run speed tests against Apple servers
- 🎭 Spoof your MAC address
Commands
wifi connect (c) [network] [password] # Connect to a Wi-Fi network
wifi disconnect (dc) # Disconnect from current Wi-Fi network
wifi dns [servers...] # Display or set DNS servers
wifi forget (f) [network] # Forget a Wi-Fi network
wifi info (i) # Display current Wi-Fi connection details
wifi ip [address] # Display or set IP address
wifi list (ls) # List nearby Wi-Fi networks
wifi mac [address] # Display or set MAC address
wifi on # Turn Wi-Fi on
wifi off # Turn Wi-Fi off
wifi password (p) [network] # Display Wi-Fi network password
wifi qr # Display a QR code to join the network
wifi reset [target] # Reset DNS, IP, MAC, router to defaults
wifi restart (r) # Turn Wi-Fi off and on again
wifi router [address] # Display or set router address
wifi saved (s) # List saved Wi-Fi networks
wifi spoof # Randomize MAC address
wifi test (t) # Test network upload/download speedInstallation
brew install stevelacey/tap/wifi-cliOr via npm:
npm install -g wifi-cli-macosXcode Command Line Tools are required. If not installed, you'll be prompted on first use.
Basic usage
wifi list
Network 1 ▁▂▃▄▅▆ 2.4/5GHz WPA2
Network 2 ▁▂▃▄▅▆ 5GHz WPA2/3
Network 3 ▁▂▃▄ 2.4GHz WPA2Running wifi connect with no arguments opens an interactive network selector:
◆ Select a network to join
│ ● Network 1 ▁▂▃▄▅▆ 2.4/5GHz WPA2
│ ○ Network 2 ▁▂▃▄▅▆ 5GHz WPA2/3
│ ○ Network 3 ▁▂▃▄ 2.4GHz WPA2Or supply credentials directly:
wifi connect "Network 1" passwordConnection details
wifi info
Network: Network 1
IP: 192.168.1.100 (dhcp)
Router: 192.168.1.1
DNS: 1.1.1.1 1.0.0.1 (default: 192.168.1.1)
MAC: a1:b2:c3:d4:e5:f6 (default: b0:be:83:12:9c:d6)DNS
wifi dns
Current: 1.1.1.1 1.0.0.1
Default: 192.168.1.1
Presets:
cloudflare: 1.1.1.1 1.0.0.1
google: 8.8.8.8 8.8.4.4
opendns: 208.67.222.222 208.67.220.220
quad9: 9.9.9.9 149.112.112.112wifi dns cloudflare
wifi dns 1.1.1.1 8.8.8.8
wifi reset dnsIP, router, and MAC
wifi ip 192.168.1.99
wifi router 192.168.1.254
wifi mac a1:b2:c3:d4:e5:f6
wifi spoof
wifi reset ip
wifi reset macQR code
wifi qr
Network: Network 1
Password: hunter2
[QR code]Speed test
wifi test
156.1 Mbps ↓ / 45.2 Mbps ↑ (12 ms)