Turn Bluetooth On & Off via Terminal
Blueutil, a command-line utility for macOS that lets us turn Bluetooth on and off with one command!

Start by installing blueutil with HomeBrew:

brew install blueutil


The -p flag is a switch for turning Bluetooth on and off:

Turn bluetooth off

blueutil -p 0


Turn bluetooth on

blueutil -p 1