Testing a WordPress function usually means editing a file and reloading a page. wp shell lets you type it and see the answer.
wp shell
wp> get_bloginfo( 'name' );
wp> get_option( 'blogdescription' );
The handbook describes it as an interactive PHP console in a loaded WordPress environment. You can evaluate statements and expressions, and use WordPress functions, classes and globals as you would in a plugin. Its own example is get_bloginfo( 'name' );, which returns the site name.
Type restart to reload the shell in a new PHP process, so edited code is picked up. That needs pcntl_exec(). Without it the shell restarts in the same process, which resets variables but does not reload PHP files.
--basic forces WP-CLI’s built-in REPL even when Boris or PsySH is installed. --quiet suppresses the printed return value, so an assignment prints nothing.
The caveat is that this is the real site. Reading options or posts is harmless, but calls like update_option() or wp_delete_post() change the live database immediately, with no confirmation. Try the read-only function first, and take a backup with wp db export before anything that writes. The handbook also marks --watch and --hook as not yet in a stable release, so skip them unless you use the nightly build.
Further reading: WP-CLI: wp shell