Lightning-fast WordPress site scaffolding CLI tool
WPMax is a powerful command-line tool that automates WordPress site creation, making it incredibly fast and easy to spin up new WordPress installations with your preferred configuration.
- ⚡ Lightning Fast - Create a complete WordPress site in seconds
- 🔧 Fully Configurable - Override any setting via CLI flags or config file
- 🎯 Smart Defaults - Sensible defaults that work out of the box
- 🔌 Plugin Management - Install plugins from WordPress.org or local ZIPs
- 🗄️ Auto-Detection - Automatically detects MySQL connection (TCP or socket)
- 📦 Self-Contained - Bundles WP-CLI (downloads on first run)
- 🔐 Laravel Herd Integration - Automatic HTTPS setup with Herd
- ⚙️ Config System - Save common settings for reuse
- 📊 Site Management - List, view info, and delete sites with ease
- 🏥 Health Checks - Diagnose system issues before creating sites
- 🔄 Auto-Updates - Stay up-to-date with automatic update checks
npm install -g wpmax- PHP 7.4+ (required by WordPress and WP-CLI)
- MySQL or MariaDB
- Node.js 16+
# Create a new WordPress site
wpmax my-site
# Or use the 'new' alias
wpmax new my-site
# That's it! Your site is ready at http://my-site.test# Interactive mode (prompts for site name)
wpmax
# Specify site name
wpmax my-site
# Custom WordPress version
wpmax my-site --wp-version 6.4.2
# Include default WP themes and plugins
wpmax my-site --with-contentBy "site name" we mean the directory name where the site files will be created. It can contain letters, numbers, dashes, and underscores. Example: "my-site It will also be used as the database name and domain.
# Custom database settings
wpmax my-site \
--dbname custom_db \
--dbuser myuser \
--dbpass secret \
--dbhost 192.168.1.100 \
--dbprefix custom_
# Skip database creation (only create wp-config.php)
wpmax my-site --no-db# Custom admin credentials
wpmax my-site \
--admin-user john \
--admin-pass SecurePass123 \
--admin-email [email protected]# Custom URL and title
wpmax my-site \
--url mysite.local \
--title "My Awesome Site"WPMax provides several commands for managing your WordPress sites:
Check your system requirements and diagnose issues before creating sites:
wpmax doctorThis command verifies:
- WP-CLI installation and version
- PHP version and required extensions
- MySQL/MariaDB connectivity
- Laravel Herd status (if installed)
- File permissions
- Configuration file
Example Output:
🔍 Running diagnostics...
✓ WP-CLI: 2.9.0
✓ PHP: 8.2.0
✓ MySQL: Connected via 127.0.0.1
✓ Herd: Installed (Herd 1.24.1)
✓ Permissions: OK
✓ Config: Found with settings
Environment:
OS: darwin 25.1.0
Node: v20.10.0
Arch: arm64
Shell: /bin/zsh
Config: ~/.config/wpmax
✅ All checks passed! You're ready to create WordPress sites.
View all WordPress sites created with WPMax:
wpmax listShows site name, URL, creation date, and disk usage:
My Sites (3 total):
• my-site my-site.test 2 days ago 145 MB
• demo-shop demo-shop.test 1 week ago 289 MB
• client-site client-site.test 3 weeks ago 102 MB
Display detailed information about a specific site:
wpmax info [name]If no name is provided, you'll see an interactive list to choose from.
Example Output:
Site: my-site
──────────────────────────────────────────────────
Path: /Users/user/Sites/my-site
URL: my-site.test
Created: 2 days ago
Size: 145 MB
WordPress: 6.4.2
PHP: 8.2.0
Database: my_site (12 tables, 2.3 MB)
Admin: admin
Email: [email protected]
Plugins: 3 active
• woocommerce
• yoast-seo
• query-monitor
Theme: Twenty Twenty-Four
Completely remove a WordPress site including directory, database, and registry entry:
wpmax delete [name]Without a name, you'll see an interactive list to select from.
Options:
--yes- Skip confirmation prompt--keep-db- Keep the database--keep-files- Keep the directory--dry-run- Preview what would be deleted
Examples:
# Interactive deletion with confirmation
wpmax delete my-site
# Skip confirmation
wpmax delete my-site --yes
# Only remove files, keep database
wpmax delete my-site --keep-db
# Preview what would be deleted
wpmax delete my-site --dry-runAdd an existing WordPress site to the WPMax registry. This allows you to manage sites not originally created with WPMax.
wpmax register [path]Options:
-n, --name <name>- Custom name for the site (default: directory name)
Examples:
# Register current directory
cd /path/to/existing-wordpress
wpmax register
# Register with a specific path
wpmax register /path/to/wordpress-site
# Register with custom name
wpmax register /path/to/site --name my-custom-name
# From current directory with custom name
wpmax register --name my-siteWhat it does:
- Validates the directory contains a WordPress installation
- Parses
wp-config.phpfor database configuration - Queries WordPress database for site URL and admin info
- Shows detected information for review
- Registers the site after confirmation
Example Output:
Detected Information:
Name: my-existing-site
Path: /Users/user/Sites/my-existing-site
URL: example.local
Database: wp_database
DB User: root
DB Host: localhost
Admin: admin
Email: [email protected]
? Register this site? Yes
✅ Site "my-existing-site" registered successfully!
You can now use wpmax commands with this site.
Once registered, the site appears in wpmax list and works with all WPMax commands.
Manage WordPress users from the command line. These commands work in any WordPress directory (wpmax-created or existing).
Create a new WordPress user. Run this command from within a WordPress site directory.
wpmax user add <username> [options]Options:
-e, --email <email>- Email address (default:<username>@test.com)-p, --password <password>- Password (default:admin)-r, --role <role>- User role (default:administrator)
Examples:
# Navigate to your WordPress site
cd /path/to/wordpress-site
# Create user with defaults
wpmax user add john
# Creates: john / [email protected] / admin / administrator
# Create user with custom email and password
wpmax user add sarah -e [email protected] -p SecurePass123
# Create editor user
wpmax user add editor1 -r editor -p editor123
# Create subscriber
wpmax user add subscriber1 -r subscriberAvailable Roles:
administrator- Full access (default)editor- Publish and manage postsauthor- Publish own postscontributor- Write posts (pending review)subscriber- Read-only access
Example Output:
✅ User created successfully!
User Details:
Username: sarah
Email: [email protected]
Password: SecurePass123
Role: administrator
If the user already exists, you'll see:
User "john" already exists.
Update a WordPress user's password. Run this command from within a WordPress site directory.
wpmax user password <username> [password]Examples:
# Navigate to your WordPress site
cd /path/to/wordpress-site
# Reset to default password (admin)
wpmax user password john
# Set custom password
wpmax user password john NewSecurePass456
# Reset admin password
wpmax user password adminExample Output:
✅ Password updated successfully!
User Details:
Username: john
Password: NewSecurePass456
Important Notes:
- Both user commands must be run from within a WordPress site directory
- Works with any WordPress installation (not just wpmax-created sites)
- If not in a WordPress directory, you'll see:
Not in a WordPress site directory
Check for and install the latest version of WPMax:
# Check and install updates
wpmax update
# Only check without installing
wpmax update --check
# Skip confirmation
wpmax update --yesThe tool also automatically checks for updates once per day and shows a gentle reminder if one is available.
WPMax stores configuration in ~/.config/wpmax/config.json and site registry in ~/.config/wpmax/sites.json for tracking created sites.
wpmax config --list# Database defaults
wpmax config --set dbuser maxcelos
wpmax config --set dbhost 127.0.0.1
wpmax config --set dbprefix wp_
# Admin defaults
wpmax config --set admin-user john
wpmax config --set admin-email [email protected]
# Site defaults
wpmax config --set tld ".local"
# Plugin path
wpmax config --set default-plugins-path "/path/to/plugins"Configure plugins to install from WordPress.org automatically:
# Set list of plugins
wpmax config --set public-plugins "woocommerce,contact-form-7,yoast-seo"
# Add plugins to list
wpmax config --add public-plugins "woocommerce"
wpmax config --add public-plugins "contact-form-7"
# Remove plugins from list
wpmax config --remove public-plugins "woocommerce"Paths:
default-plugins-path- Directory containing local plugin ZIPsdefault-themes-path- Directory containing local theme ZIPs
Database:
dbuser- Default database username (default:root)dbhost- Default database host (default: auto-detected)dbprefix- Default table prefix (default:wp_)
Admin:
admin-user- Default admin username (default:admin)admin-email- Default admin email (default:[email protected])
Site:
tld- Default TLD for sites (default:.test)
Plugins:
public-plugins- Array of plugin slugs from WordPress.org
WPMax supports two types of plugins:
Configure in config file, select during installation:
wpmax config --add public-plugins "woocommerce,yoast-seo"
wpmax my-site
# You'll see a checkbox list with both local and public pluginsPlace ZIP files in a directory and configure the path:
wpmax config --set default-plugins-path "/Users/me/plugins"
wpmax my-site
# Plugins from directory will appear in selection listDuring installation, you'll see an interactive checkbox list:
? Select plugins to install:
◉ acf-pro.zip (local)
◉ woocommerce (WordPress.org)
◉ yoast-seo (WordPress.org)
Use space to toggle, enter to confirm.
Settings are applied in this order (highest priority first):
CLI flags → Config file → Built-in defaults
Example:
# Config file has: dbuser=maxcelos
wpmax my-site --dbuser=root
# Result: Uses dbuser=root (CLI flag wins)wpmax [name] [options]
Options:
--help Show help
--version Show version
WordPress Options:
--with-content Include default WordPress themes and plugins
--wp-version <version> WordPress version (default: latest)
Database Options:
--dbname <name> Database name (default: slug with underscores)
--dbuser <user> Database username (default: root)
--dbpass <password> Database password (default: empty)
--dbhost <host> Database host (default: auto-detected)
--dbprefix <prefix> Table prefix (default: wp_)
--no-db Skip database creation
Admin Options:
--admin-user <username> Admin username (default: admin)
--admin-pass <password> Admin password (default: admin)
--admin-email <email> Admin email (default: [email protected])
Site Options:
--url <url> Site URL (default: {slug}.test)
--title <title> Site title (default: auto-generated)
Debug Options:
--verbose, --debug Show detailed configuration output
Advanced:
-d, --docker Use Docker (coming soon)Show detailed configuration information during site creation:
wpmax my-site --verbose
# Example output:
🚀 Scaffolding WordPress in my-site...
[DEBUG] Configuration:
slug: my-site
dbName: my_site
dbUser: root
dbHost: auto-detect
dbPrefix: wp_
url: my-site.test
title: My Site
adminUser: admin
adminEmail: [email protected]
wpVersion: latest
withContent: falseUse --verbose or --debug (alias) for troubleshooting or to verify your configuration before installation.
WPMax supports convenient aliases for common commands:
# Creating sites
wpmax my-site # Standard command
wpmax new my-site # Alias for create
# Listing sites
wpmax list # Standard command
wpmax ls # Alias for list
# Deleting sites
wpmax delete my-site # Standard command
wpmax rm my-site # Alias for deleteAll aliases support the same options as their standard counterparts:
# These are equivalent:
wpmax rm my-site --yes
wpmax delete my-site --yeswpmax dev-sitewpmax production-site \
--admin-user admin_secure \
--admin-pass "$(openssl rand -base64 32)" \
--admin-email [email protected] \
--dbprefix prod_# First, configure WooCommerce
wpmax config --add public-plugins "woocommerce"
# Then create site
wpmax my-store# Create site without DB
wpmax my-network --no-db
# Manually configure multisite in wp-config.php
# Then run wp core multisite-install# Install WordPress 6.3
wpmax legacy-site --wp-version 6.3
# Install latest
wpmax new-site --wp-version latestIf Laravel Herd is detected, WPMax will offer to:
- Run
herd linkto create the.testdomain - Run
herd secureto add HTTPS certificate
wpmax my-site
# ...installation proceeds...
? Laravel Herd detected. Run "herd link" and "herd secure"? (Y/n)Result: Site available at https://my-site.test 🔒
WPMax automatically detects your MySQL connection by trying:
-
TCP/IP (recommended)
127.0.0.1localhost
-
Unix Sockets (fallback)
/tmp/mysql_3306.sock(Laravel Herd)/tmp/mysql.sock(Homebrew)/var/run/mysqld/mysqld.sock(Linux)- Other common locations
Override with --dbhost if needed:
wpmax my-site --dbhost 192.168.1.100Error: Could not detect MySQL connection
Solutions:
- Ensure MySQL is running:
mysql --version - Test connection:
mysql -u root -e "SELECT 1" - Specify host manually:
wpmax my-site --dbhost 127.0.0.1 - Check MySQL is listening on TCP:
netstat -an | grep 3306
Error: PHP is not installed or not in PATH
Solution:
- Install PHP:
brew install php(macOS) orapt install php(Linux) or Laravel Herd (Windows and macOS—Recommended) - Verify:
php --version
Error: Permission denied when creating directory
Solution:
- Run from a directory where you have write permissions
- Don't use
sudowith wpmax
Behavior: WPMax automatically resets existing databases
If you want to keep an existing database, use a different site name.
Error: Failed to download WP-CLI
Solutions:
- Check internet connection
- Check firewall isn't blocking GitHub
- Download manually and place in
bin/wp-cli.phar
After successful site creation, you'll see your access information:
✅ Done! Your WordPress site is ready.
Site URL:
http://my-site.test
⚠️ Frontend is blank (no theme installed)
Install a theme via wp-admin or use --with-content flag
Admin Dashboard:
http://my-site.test/wp-admin
Login Credentials:
Username: admin
Password: admin
Note: By default, WPMax installs WordPress without themes (--skip-content flag). This keeps the installation lean and fast, perfect for developers who want to start fresh. The frontend will appear blank until you install a theme.
To include default WordPress themes and plugins:
wpmax my-site --with-contentClick the wp-admin link to access your dashboard, install a theme, and start building!
WPMax automates these steps:
- Downloads WP-CLI (first run only)
- Creates project directory
- Downloads WordPress core via WP-CLI
- Detects MySQL connection (TCP or socket)
- Creates wp-config.php with your settings
- Creates database (or resets if exists)
- Installs WordPress with admin user
- Installs plugins (public + local)
- Optional: Laravel Herd setup (link + secure)
# Clone repository
git clone https://github.com/maxcelos/wpmax.git
cd wpmax
# Install dependencies
pnpm install
# Link for local testing
npm link
# Test the CLI
wpmax test-site
# Unlink when done
npm unlink wpmaxContributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Completed features:
- Site registry and management (
list,info,delete) - Health checks and diagnostics (
doctor) - Auto-update checking and installation (
update)
Upcoming features:
- Docker Compose support
- Theme installation
- WordPress multisite
- Site templates/presets
- Batch site creation
- Backup & restore
- Site cloning
PRs welcome!
MIT
- Issues: GitHub Issues
- Discussions: GitHub Discussions