diff --git a/wp-cli/civicrm.php b/wp-cli/civicrm.php
index f093e165ec90027bb70a2e16c605d3f96d56c960..c740547873478451d092101c4a2ee393348bdfdb 100644
--- a/wp-cli/civicrm.php
+++ b/wp-cli/civicrm.php
@@ -165,6 +165,12 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
 				return WP_CLI::error( "Unrecognized command - '$command'" );
 			}
 
+			# if --path is set, save for later use by Civi
+			global $civicrm_paths;
+			if (!empty(WP_CLI::get_config('path'))) {
+				$civicrm_paths['cms.root']['path'] = WP_CLI::get_config('path');
+			}
+
 			# run command
 			return $this->{$command_router[ $command ]}();