This can be done via ADB if you have access to to a shell:
adb shell su 0 service call wifi 11
This will invoke WifiManager.startScan()
or you could try the following:
Once you can access a shell prompt, follow these steps:
- Send an intent to the Wi-Fi service that includes the SSID of your local network. Your board must support the network protocol and frequency band of the wireless network in order to establish a connection.
$ am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect
I looked up the documentation and you can get access to a shell can be done with a serial cable:

Alternatively, you could try writing an app to help you out (in the onCreate()) have not tested in Android things though:
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.wifi.WifiSettings");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
EDIT
If you REALLY want to avoid the use of extra cables, you could mount the SD card to your normal pc (assuming linux I show how to mount here) and add the following to /data/misc/wifi/wpa_supplicant.conf:
network={
ssid="[WIFI NAME]"
key_mgmt=WPA-PSK
psk="[PASSWORD]"
}
If you don't want your password stored in plain test you can generate the hash on the command line (and assuming you have the SD card mounted (I stole this from a script I wrote):
wpa_passphrase $1 $2 | awk '(NR != 3)' | sudo tee -a /data/misc/wifi/wpa_supplicant.conf > /dev/null
Where $1 is the name of the wifi and $2 is the password.