A comprehensive command-line interface for managing WordPress multisite installations across multiple environments. Automates S3 synchronization, EC2 management, and local development workflows.
- Tool Introduction - What is wfuwp and how to get started
- Built-in Help System - Use
wfuwp --helpandwfuwp docs --listfor complete, current documentation - Developer Documentation - Technical architecture and development guides
- Developer Guide β Architecture, APIs, and contribution guidelines
- Admin Guide β Configuration and usage for WordPress admins
- User Guide β Features visible to website visitors
A Claude Code skill that drives the wfuwp maintenance command (the
wfu.edu down/maintenance page switch) with built-in preflight gates.
- Source of truth (version controlled):
skills/wfu-maintenance/SKILL.md - Distributed via the WFU internal S3 bucket:
s3://wfu-umc-wp-team-internal-docs/skills/wfu-maintenance/SKILL.md(the same private, account-scoped bucket the docs wiki uses; downloading it requires an authenticated WFU AWS session, which the skill needs anyway). - The skill enforces, before any action:
wfuwpinstalled and >= 0.30.0 (auto-updates vianpm i -g wfuwp@latestif not), AWS CLI installed, and an authenticated AWS session for the WFU account (841310976649). If a gate fails it stops rather than acting.
You need an authenticated AWS session for the WFU account first
(aws sso login). Paste this to Claude Code:
Run
aws s3 cp s3://wfu-umc-wp-team-internal-docs/skills/wfu-maintenance/SKILL.md ~/.claude/skills/wfu-maintenance/SKILL.md(create the~/.claude/skills/wfu-maintenance/directory first if needed), then confirm the skill is installed.
Or run it directly:
mkdir -p ~/.claude/skills/wfu-maintenance && \
aws s3 cp s3://wfu-umc-wp-team-internal-docs/skills/wfu-maintenance/SKILL.md \
~/.claude/skills/wfu-maintenance/SKILL.mdTo update the skill later, re-run the same command (it overwrites with the latest published version).
The repo is the source of truth; the S3 copy is the distribution mirror.
After changing skills/wfu-maintenance/SKILL.md on main, publish it:
aws s3 cp skills/wfu-maintenance/SKILL.md \
s3://wfu-umc-wp-team-internal-docs/skills/wfu-maintenance/SKILL.md \
--content-type text/markdownNote: Database migration functionality has been moved to a dedicated tool: wfu-migrate
Install it with:
npm install -g wfu-migrateSee the wfu-migrate documentation for usage.
npm install -g wfuwpgit clone <repository-url>
cd wfu-wp-cli
npm install
npm run build
npm link- Node.js 16.0.0 or higher
- AWS CLI installed and configured with appropriate credentials
- Access to WFU WordPress S3 buckets
Make sure you have the AWS CLI installed and configured:
# Install AWS CLI (if not already installed)
# macOS
brew install awscli
# Configure with your credentials
aws configurewfuwp <command> [options] [arguments]Note: For complete command documentation, see the Commands Reference or Quick Reference
Synchronizes WordPress site files between different S3 environments.
wfuwp syncs3 <site-id> <from-env> <to-env> [options]Arguments:
site-id: Numeric site identifier (e.g., 43)from-env: Source environment (dev,uat,pprd,prod)to-env: Destination environment (dev,uat,pprd,prod)
Options:
-d, --dry-run: Preview what would be synced without making changes-f, --force: Skip confirmation prompt-v, --verbose: Show detailed output including all synced files-h, --help: Display help for command
Examples:
# Basic sync with confirmation
wfuwp syncs3 43 uat pprd
# Dry run to preview changes
wfuwp syncs3 43 uat pprd --dry-run
# Force sync without confirmation
wfuwp syncs3 43 uat pprd --force
# Show detailed output with all file transfers
wfuwp syncs3 43 uat pprd --verboseLists IP addresses of running EC2 instances for a given environment.
wfuwp listips <environment> [options]Arguments:
environment: Environment name (dev,uat,pprd,prod)
Options:
--private: Show private IP addresses (default behavior)--public: Show public IP addresses--json: Output as JSON for scripting-h, --help: Display help for command
Examples:
# List private IPs (default)
wfuwp listips uat
# List public IPs
wfuwp listips prod --public
# Get JSON output for scripting
wfuwp listips dev --jsonSSH into EC2 instances for a given environment with flexible authentication.
wfuwp sshaws <environment> [options]Arguments:
environment: Environment name (dev,uat,pprd,prod)
Options:
--all: Connect to all instances sequentially (default: first instance only)--list: List available instances without connecting--key <path>: Path to SSH private key file (optional)--user <username>: SSH username (default: ec2-user)--dry-run: Show what SSH commands would be executed-h, --help: Display help for command
Examples:
# SSH to first instance (uses system SSH defaults)
wfuwp sshaws uat
# SSH to all instances sequentially
wfuwp sshaws prod --all
# List instances without connecting
wfuwp sshaws dev --list
# Use specific SSH key
wfuwp sshaws pprd --key ~/.ssh/my-aws-key.pem
# Use different username
wfuwp sshaws dev --user ubuntu
# Preview SSH commands
wfuwp sshaws uat --dry-runManage database connection settings and other configuration options. Configuration is stored securely with encrypted passwords.
wfuwp config <subcommand> [arguments]Subcommands:
# Set configuration values
wfuwp config set <key> <value>
# Get configuration values
wfuwp config get <key>
# List all configuration
wfuwp config list
# Reset all configuration
wfuwp config resetMulti-Environment Configuration:
environments.dev.host: Development database hostnameenvironments.dev.user: Development database usernameenvironments.dev.password: Development database password (encrypted)environments.dev.database: Development database nameenvironments.uat.host: UAT database hostnameenvironments.uat.user: UAT database usernameenvironments.uat.password: UAT database password (encrypted)environments.uat.database: UAT database nameenvironments.pprd.host: Pre-production database hostnameenvironments.pprd.user: Pre-production database usernameenvironments.pprd.password: Pre-production database password (encrypted)environments.pprd.database: Pre-production database nameenvironments.prod.host: Production database hostnameenvironments.prod.user: Production database usernameenvironments.prod.password: Production database password (encrypted)environments.prod.database: Production database name
S3 Configuration (Optional):
s3.bucket: S3 bucket name for backup archivals3.region: AWS region for S3 bucket (default: us-east-1)s3.prefix: Prefix for organized S3 storage (default: backups)
Local Backup Configuration (Alternative to S3):
backup.localPath: Local directory for backup storage (default: ~/.wfuwp/backups)
Examples:
# Multi-Environment Setup (Interactive Wizard Recommended)
wfuwp config wizard
# Manual Multi-Environment Configuration
wfuwp config set environments.prod.host prod-db.wfu.edu
wfuwp config set environments.prod.user wp_prod
wfuwp config set environments.prod.password prod_password
wfuwp config set environments.prod.database wp_production
wfuwp config set environments.uat.host uat-db.wfu.edu
wfuwp config set environments.uat.user wp_uat
wfuwp config set environments.uat.password uat_password
wfuwp config set environments.uat.database wp_uat
# S3 Configuration for Backup Archival
wfuwp config set s3.bucket wfu-wp-backups
wfuwp config set s3.region us-east-1
wfuwp config set s3.prefix backups
# Local Backup Alternative
wfuwp config set backup.localPath /path/to/local/backups
# Check current configuration
wfuwp config list
# Verify environment-specific configuration
wfuwp config verify
# Reset all settings
wfuwp config resetTest and verify database connections for all configured environments.
wfuwp db <subcommand>Subcommands:
test <env>- Test database connection for an environmentlist- List all configured database environments
Examples:
# Test production database connection
wfuwp db test prod
# List all configured environments
wfuwp db listπ Documentation: See wp-docs/db.md for detailed usage and troubleshooting.
Restore WordPress database from SQL backup files.
wfuwp restore <sql-file> --to <env> [options]Examples:
# Restore backup to UAT environment
wfuwp restore ./backup.sql --to uat
# Preview restore without making changes
wfuwp restore ./backup.sql --to dev --dry-run
# Restore with increased timeout for large files
wfuwp restore ./large_backup.sql --to pprd --timeout 60π Documentation: See wp-docs/restore.md for detailed usage and recovery workflows.
Comprehensive ClickUp integration for managing tasks directly from the command line.
wfuwp clickup <subcommand> [options]Key Features:
- Create and manage ClickUp tasks with full metadata support
- List and filter tasks with advanced filtering options
- Export tasks in CSV, JSON, and Markdown formats
- Batch create tasks from text or JSON files
- Navigate workspace hierarchies and search across workspaces
- Secure encrypted storage of API credentials
Quick Start:
# Configure API token
wfuwp clickup config set token pk_your_api_token
# Create a task
wfuwp clickup create "Fix login bug" --priority high --assignee USER_ID
# List your tasks
wfuwp clickup tasks --my-tasks
# Export tasks to CSV
wfuwp clickup tasks --export csvπ Detailed Documentation: See wp-docs/clickup.md for comprehensive usage instructions, batch operations, export formats, and troubleshooting.
Complete local development environment management for WFU WordPress sites with DDEV integration, domain management, and automated setup workflows.
β All phases complete:
- Domain management (modify /etc/hosts)
- Environment status and health checks
- Automated dependency installation
- Environment control (start/stop/restart)
- Content management (refresh/reset)
- Configuration management
wfuwp local <subcommand> [options]Available Subcommands:
domain- Manage local development domains (/etc/hosts)status- Show environment status and health checksinstall- Install and setup development dependenciesstart- Start local development environmentstop- Stop local development environmentrestart- Restart local development environmentrefresh- Refresh database from productionreset- Reset entire local environmentconfig- Configure local development settings
Key Features:
- Cross-platform support: macOS, Linux, Windows/WSL
- Docker/DDEV integration: Automated container management
- Domain management: Separate /etc/hosts markers from DNS spoofing
- Environment health: Comprehensive dependency checking
- Database refresh: Download from S3 production backups
- Interactive setup: Configuration wizard for first-time users
Examples:
# First-time setup workflow
wfuwp local install # Install Docker, DDEV, dependencies
wfuwp local config wizard # Configure settings
sudo wfuwp local domain add 43 # Add domain for site 43
wfuwp local install database # Download production database
wfuwp local start 43 # Start development environment
# Daily development workflow
wfuwp local status # Check environment health
wfuwp local start 43 # Start site 43
wfuwp local refresh database # Refresh with latest prod data
wfuwp local stop 43 # Stop when done
# Environment management
wfuwp local domain list # Show configured domains
wfuwp local reset site43 --deep # Complete environment reset
wfuwp local install --force # Reinstall dependenciesPrerequisites:
- Docker (will be installed automatically if missing)
- DDEV (will be installed automatically if missing)
- Sudo access (for domain management only)
System Requirements:
- macOS: Homebrew for automated installation
- Linux: Native package managers (apt, yum, pacman)
- Windows: WSL recommended, manual installation links provided
Turn the wfu.edu down/maintenance page on or off per environment. This drives an Application Load Balancer listener rule (not a WordPress plugin); when ON every visitor sees the page except the app loopback and explicit bypass IPs.
wfuwp maintenance <subcommand> --env <dev|uat|pprd|prod>Available Subcommands:
status- Show ON/OFF, which page, bypass IPs, and verify the live URLon- Turn the page ON (--page maintenance|down, defaultmaintenance;--allow-meto keep your own access on non-prod)off- Turn the page OFF, restore prior state, and clear any bypassallow-me/revoke-me- Add/clear your public IP on the bypass rule (not prod)init- Provision the standardized ALB rules (dev/uat only)
wfuwp maintenance status --env prod
wfuwp maintenance on --env prod # planned work
wfuwp maintenance on --env prod --page down # unplanned outage
wfuwp maintenance off --env prodSee the Commands Reference for full details and notes.
UAT sleeps when nobody needs it and wakes in a few minutes. While it sleeps, every UAT address shows an "asleep" page; while it wakes, a "waking" page with the walking deacon reloads on its own and lands the visitor where they were going once WordPress is healthy. Waking never changes UAT's code; builds still go through Jenkins.
wfuwp uat status # ASLEEP, WAKING, AWAKE, or MIXED, with ASG and health detail
wfuwp uat down # asleep page ON, web and worker ASGs to 0
wfuwp uat up # waking page ON, ASGs to 1, wait for healthy, page OFF
wfuwp uat up --timeout 30 # wait longer before giving up (minutes, default 25)
wfuwp uat build --base main --with wfu-golinks:feature-wp-1234-x --dry-run
wfuwp uat build --base dev # UAT gets each package's dev branch
wfuwp uat build # back to the uat branchesuat build chooses the code UAT builds from: uat (each package's uat
branch, the default), dev (each package's dev branch, a shared playground,
so not for sign-off), or main (released versions). --with pins one WFU
package to a branch and can be repeated. The choice is committed to the app
repository's uat branch as uat-build.json, so the baseline is recorded and
reproducible, and Jenkins rebuilds UAT from it. Building is always separate
from waking; a wake never changes UAT's code.
The branded pages live in uat-pages/ and are served from the UAT CDN at
https://uat.wp.cdn.aws.wfu.edu/uat-status/. They share the down page
stylesheet at wakealert.wfu.edu/downpage/style.css, so they follow its
branding. After editing them, publish with:
for f in asleep.html waking.html; do
aws s3 cp uat-pages/$f s3://wfu-cer-wordpress-uat-us-east-1/uat-status/$f \
--content-type "text/html; charset=utf-8" --cache-control "max-age=60"
done
aws s3 cp uat-pages/uat-status.css s3://wfu-cer-wordpress-uat-us-east-1/uat-status/uat-status.css \
--content-type text/css --cache-control "max-age=60"The load balancer shows each page in a full-screen frame, the same way the
maintenance page is framed. Both frames are ALB fixed responses on the Maintenance Mode rule, so they reuse
the maintenance command's saved OFF state; wfuwp maintenance status --env uat
reports them as uat-asleep or uat-waking. down refuses to replace a
non-UAT maintenance page unless you pass --force.
While UAT sleeps, the three rules ahead of the page (login, the maintenance dashboard, and admin assets) serve the same page, so no UAT address returns a bare 503. The nightly 7 PM sleep puts the page up through the UatWake service in app-serverless-aws-wordpress. Until Information Security changes the UAT template, the weekday 6 AM scale-out still starts the web server behind the asleep page and the worker does not sleep on its own.
New to wfuwp? Start with the Tool Introduction and use the built-in documentation system for complete guidance.
# 1. Install the tool
npm install -g wfuwp
# 2. Check system prerequisites
wfuwp doctor
# 3. Run configuration wizard
wfuwp config wizard
# 4. Verify your setup
wfuwp config verify
wfuwp db list
# 5. Explore built-in documentation
wfuwp --help # See all commands
wfuwp docs --list # Browse documentation topics
wfuwp docs getting-started # Detailed setup guide- Site IDs must be positive integers
- Only valid environment names are accepted
- Source and destination environments cannot be the same
- Interactive confirmation before executing sync operations
- Use
--forceflag to bypass confirmations in automated scripts
- Use
--dry-runto preview what files would be synced - No actual changes are made in dry-run mode
- Database passwords are encrypted when stored locally
- Configuration files are stored in user's home directory (
~/.wfuwp/config.json)
- Checks if AWS CLI is installed and accessible
- Provides helpful error messages if prerequisites are missing
"AWS CLI is not installed or not in PATH"
- Install AWS CLI: https://aws.amazon.com/cli/
- Ensure it's in your system PATH
"Site ID must be a positive integer"
- Ensure you're using a numeric site ID (e.g., 43, not "abc")
"Invalid source/destination environment"
- Use only valid environment names:
dev,uat,pprd,prod
"Source and destination environments cannot be the same"
- Ensure you're specifying different environments for source and destination
"Database configuration incomplete"
- Set up database connection using
wfuwp config setcommands - Ensure all required fields are configured: host, user, password, name
# General help
wfuwp --help
# Command-specific help
wfuwp syncs3 --help
wfuwp config --help
# Display version
wfuwp --versiongit clone <repository-url>
cd wfu-wp-cli
npm install
npm run buildnpm run build # Compile TypeScript
npm run dev # Run with ts-node for development
npm run test # Run tests
npm run lint # Run ESLint
npm run format # Format code with Prettierwfu-wp-cli/
βββ src/
β βββ commands/
β β βββ syncs3.ts # S3 sync command implementation
β β βββ listips.ts # EC2 IP listing command
β β βββ sshaws.ts # SSH connection command
β β βββ removehostkey.ts # SSH host key removal command
β β βββ config.ts # Configuration management command
β βββ utils/
β β βββ config.ts # Configuration storage utilities
β βββ index.ts # Main CLI entry point
βββ bin/
β βββ wfuwp # Binary wrapper
βββ dist/ # Compiled JavaScript (generated)
βββ tests/ # Test files
βββ docs/ # Additional documentation
βββ package.json # Package configuration
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
npm test - Run linting:
npm run lint - Commit your changes:
git commit -m "feat: add new feature" - Push to the branch:
git push origin feature-name - Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Check the troubleshooting section above
- Search existing issues in the repository
- Create a new issue with detailed information about the problem