About local-wp-cli
A WP-CLI skill for Local by Flywheel that runs commands against a named Local site through its bundled wrapper script. It requires the wrapper rather than bare `wp` commands and prompts for a site name when one is not provided.
Key features
- 01Run WP-CLI through a wrapper script
- 02Select a target by Local site name
- 03List available sites
- 04Require the target site to be running
Use cases
- 01Inspect plugins on a chosen site
- 02Check the WordPress core version
- 03List site users
- 04Manage plugin status
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ aslamdoctor/ local-wp-cli --skill local-wp-cliAfter installing, type/local-wp-cliin Claude Code to confirm it loaded.
Bundled filesREADME.mdscripts/wp
Details
From the project READMEWP-CLI for Local by Flywheel
Run all WP-CLI commands using the wrapper script bundled with this skill:
bash {{SKILL_DIR}}/scripts/wp <site-name> <command>
Never run bare wp commands. Always use the full path above.
Usage
The first argument is the Local site name (as shown in the Local app), followed by any WP-CLI command.
WP="bash {{SKILL_DIR}}/scripts/wp"
# Examples with different sites
$WP my-site plugin list
$WP my-site core version
$WP my-site user list
If the user doesn't specify a site name, ask them which Local site to use. You can run the script with no arguments to list available sites.
Environment
- OS: macOS Apple Silicon
- WP-CLI: Global install (
/usr/local/bin/wp) - Sites config:
~/Library/Application Support/Local/sites.json
Requirements
- The target Local site must be running (started in the Local app)
- Site name must match exactly as shown in Local
Common Commands
WP="bash {{SKILL_DIR}}/scripts/wp"
SITE="my-site" # replace with actual site name
# Plugin management
$WP $SITE plugin list
$WP $SITE plugin activate <slug>
$WP $SITE plugin deactivate <slug>
$WP $SITE plugin status <slug>
# Cache / transients
$WP $SITE cache flush
$WP $SITE transient delete --all
# Options
$WP $SITE option get <key>
$WP $SITE option update <key> <value>
$WP $SITE option list --search="<pattern>"
# Database
$WP $SITE db query "SELECT * FROM wp_options WHERE option_name LIKE '<pattern>%' LIMIT 10;"
$WP $SITE db export backup.sql
$WP $SITE db import backup.sql
# Eval PHP
$WP $SITE eval 'echo get_option("siteurl");'
$WP $SITE eval-file script.php
# Rewrites / cron
$WP $SITE rewrite flush
$WP $SITE cron event list
$WP $SITE cron event run <hook>
# User / site info
$WP $SITE user list
$WP $SITE option get siteurl
$WP $SITE core version
Comments
Markdown supported