How to select the Bluetooth device using command line?
This open-source CLI app BluetoothConnector seems like a good solution. I tested and confirmed it's working as recently as macOS 10.15.2.

It's available on GitHub as well as Homebrew:

$ brew install bluetoothconnector
$ BluetoothConnector --connect 00-11-22-33-44-55 --notify
$ BluetoothConnector --disconnect 00-11-22-33-44-55