Command: wifi

Manage Wi-Fi connections on macOS.

Usage

Usage: m wifi [OPTIONS] [ARGUMENTS]

Description: Manage your wifi connections on macOS

Options:
  --help                      Show this help message
  --status                    Show current wifi status
  --scan                      Scan for available wifi networks
  --showpassword [ESSID]      Show the password for a wifi network
  --list                      List known wifi networks
  --forget ESSID              Forget a wifi network
  --history                   Show wifi connection history
  --disable                   Turn off wifi
  --enable                    Turn on wifi
  --connect ESSID [PASSWORD]  Connect to a wifi network (prompt for password if not provided)

Note: Some commands like --status, --scan, and --history use the deprecated airport utility and may not function on recent versions of macOS.

Options

--enable / --disable

Turns the Wi-Fi interface on or off.

Example:

m wifi --disable

--scan

Scans for and lists nearby Wi-Fi networks.

Example:

m wifi --scan

--list

Lists all Wi-Fi networks that your Mac has saved (preferred networks).

Example:

m wifi --list

--connect ESSID [PASSWORD]

Connects to a Wi-Fi network. If the password is not provided as an argument, you will be prompted to enter it securely.

Example:

# Connect, and be prompted for the password
m wifi --connect "MyHomeNetwork"

# Connect and provide the password
m wifi --connect "MyHomeNetwork" "s3cr3t_p@ssw0rd"

--showpassword [ESSID]

Retrieves and displays the saved password for a known Wi-Fi network from the system Keychain.

Example:

m wifi --showpassword "MyHomeNetwork"

--forget ESSID

Removes a network from your list of preferred networks. Requires sudo privileges.

Example:

sudo m wifi --forget "OldCoffeeShopWiFi"