This post explains how to emulate a real request in a WP CLI shell so that all global variables are populated correctly — the same way as if you requested that URL in the browser.
CentOS, wp-cli, and rkhunter
This story was told by my colleague. She had a CentOS 7 server with a bunch of WordPress installations, and she needed to update them all. She obviously did not want to do that manually and preferred to use wp-cli.