Apple doesn't expose a way to achieve this in macOS. Windows has had this feature forever. So I created this free and open source tool that finally gives you this option!
Clamshell mode without closing the lid!
Just install it with brew or click the download button in the Github page and you're ready to go