Title: WP-CLI commands
Last modified: August 31, 2016

---

# WP-CLI commands

 *  Resolved [Cristian Romanello](https://wordpress.org/support/users/cristian95/)
 * (@cristian95)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp-cli-commands/)
 * Hi, I’d like to run a (manual) Sync via PHP code. I read about WP-CLI but I didn’t
   understand how to use it..
 * I tried to upload the wp-cli.phar file to my FTP and then add in the PHP code:
 * include ‘[http://mysite.com/wp-cli.phar&#8217](http://mysite.com/wp-cli.phar&#8217);;
   
   WP_CLI::launch(‘wp mailchimp-sync all’):
 * but nothing change, anyone could help me with this trick please?
 * Thanks so much!
    – Chris
 * [https://wordpress.org/plugins/mailchimp-sync/](https://wordpress.org/plugins/mailchimp-sync/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-commands/#post-7197987)
 * Hi Chris,
 * The WP-CLI commands are actually to be called from the command line since that
   would give you a huge speed boost over calling it from code like that. If you
   have WP-CLI installed then you can call the command like this.
 *     ```
       wp mailchimp-sync all
       ```
   
 * (Provided the `wp-cli.phar` file is in your path, as explained [here](http://wp-cli.org/).)
 * If you want to call that from code then I would use something like this.
 *     ```
       shell_exec( 'wp mailchimp-sync all' );
       ```
   
 * Hope that helps. If not, let me know!

Viewing 1 replies (of 1 total)

The topic ‘WP-CLI commands’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mailchimp-sync_cfeefa.svg)
 * [MC4WP: Mailchimp User Sync](https://wordpress.org/plugins/mailchimp-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-sync/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-commands/#post-7197987)
 * Status: resolved