OnePlus 5 Gets TWRP and Root
Developers didn’t have to wait long to create a working recovery as XDA Senior Member xdvs23 provided a testing version of TWRP 3.1.1. By flashing a Magisk or SuperSU ZIP file, you should successfully obtain root access. Head over to the thread for details or simply grab the recovery image. Just remember to unlock your bootloader first.
Get the TWRP recovery for OnePlus 5