I had to include the file.
require (ABSPATH . WPINC . '/pluggable.php');
Then it all works.
global $current_user;
\get_currentuserinfo(); // the slash is because I use namespaces and called this from within a plugin.
echo "userid is " . $current_user->UUID;
var_dump($current_user);