Edit: Ah once again I found it right after posting. I should've spent more time researching...
This can be accomplished by calling ConsoleExec
https://wowwiki.fandom.com/wiki/API_ConsoleExec
------
Original Post:
In the current beta client, there is a console command called showPlayer.
This can be ran by typing /console showPlayer
Is there any way to call this command from Lua?