wp cli output format with –porcelain

wp db export

Will output something like Succes: Exported to 'dbname-2018-09-16-2790c11.sql'
Often you need the filename.

--porcelain flag to the rescue!

wp db export --porcelain
dbname-2018-09-16-2790c11.sql

This will work on a lot of commands that have one item output.
Stuff like wp post create ....
Here is a complete list of commands that have the –porcelain flag

Commands that output more items usually have a --format flag to handle output.

wp-cli eval-file

wp-cli can be used to execute a php file with the eval-file command.
Biggest plus; WordPress is loaded when you execute that file.
The point it will call this file is after the init action and after the later wp_loaded action.