Terminal command to "unplug" and replug external monitor
Originally answered here -- This can be done by using uhubctl, which allows you to toggle and cycle power on individual ports for supported USB hubs.
You can use homebrew to install it as follows:
brew tap mvp/uhubctl https://github.com/mvp/uhubctl
brew install uhubctl