A Claude Code skill that lets you run WP-CLI commands against any Local by Flywheel site directly from Claude Code.
npx skills add aslamdoctor/local-wp-cliOr install globally (available across all projects):
npx skills add aslamdoctor/local-wp-cli -g- macOS (Apple Silicon or Intel)
- Local by Flywheel installed
- WP-CLI installed globally (
/usr/local/bin/wp) - The target Local site must be running (started in the Local app)
Once installed, just ask Claude Code to run WP-CLI commands against your Local sites:
- "List all plugins on my-site"
- "Activate the woocommerce plugin on my-site"
- "Flush the cache on my-site"
- "Run a database query on my-site"
- "Export the database from my-site"
If you don't specify a site name, Claude will ask which Local site to target.
> wp-cli list plugins on my-site
> activate plugin woocommerce on my-site
> flush cache on my-site
> wp option get siteurl on my-site
> wp db query "SELECT * FROM wp_options LIMIT 10;" on my-site
The skill includes a wrapper script (scripts/wp) that:
- Reads your Local by Flywheel
sites.jsonto find the site configuration - Locates the correct PHP and MySQL binaries for the site's configured versions
- Uses the site-specific
php.ini(which contains the MySQL socket path) to run WP-CLI with a proper database connection
This avoids the common "Error establishing a database connection" issue when running wp directly against Local sites.
All standard WP-CLI commands are supported, including:
- Plugin management -
plugin list,plugin activate,plugin deactivate - Cache/transients -
cache flush,transient delete --all - Options -
option get,option update,option list - Database -
db query,db export,db import - PHP eval -
eval,eval-file - Rewrites/cron -
rewrite flush,cron event list - Users/site info -
user list,core version
MIT