A modern, lightning-fast CLI tool to scaffold WordPress sites effortlessly within the Laravel Herd environment.
create-wp is an interactive Node.js command-line tool designed to completely automate local WordPress development setup when using Laravel Herd.
Instead of manually downloading WordPress, configuring the database, running through the 5-minute install, and adding SSL certificates, this tool does it all automatically—including downloading and activating your favorite premium themes and plugins from a private package server.
- Backup website
- Restore website
- 🚀 Interactive Setup: Simple wizard for choosing site names, themes, and plugins.
- ⚡ Smart Caching: WordPress core, themes, and plugins are cached locally in
~/.config/create-wordpress/cache/to prevent redundant downloads on future runs. - 🗄️ Database Automation: Automatically creates MySQL databases via
mysql2. - 🔒 Automatic SSL: Seamless integration with
herd secureto instantly provision local HTTPS (https://site-name.test). - 📦 Private Package Server: Connects to a private update server to download premium themes and plugins.
- 🛠️ Settings Editor: Use
--settingsto update the saved CLI defaults inconfig.json. - ⚙️ Site Configuration: Use
--configto change admin credentials, install configured themes/plugins, find packages by slug, or apply saved WordPress tweaks to existing sites. - 🗄️ Backup & Restore: Create full-source
.zipbackups or AI1WM.wpressbackups, then restore them into fresh local sites. - 🧹 Easy Cleanup: Use
--deleteto instantly wipe a site directory and drop its database.
Before using this tool, make sure your system has the following installed:
- Node.js (v18.0.0 or higher)
- Laravel Herd (Must be currently running)
- WP-CLI (Must be available in your system
PATH)
Important
If WP-CLI or Laravel Herd are not detected in your PATH, the CLI will throw an error or skip certain steps. On Windows, make sure Herd's injected paths are accessible globally.
npm install -g https://github.com/HungNth/create-wordpress.gitnpm install -g @thienhungdev/create-wpNote
On first run, the tool will launch a one-time setup wizard to configure your paths, database credentials, and default admin details. Settings are saved to ~/.config/create-wordpress/config.json.
create-wp
create-wp --config
create-wp --backup
create-wp -b
create-wp --restore
create-wp -r
create-wp --delete
create-wp --delete my-site-name
create-wp --settings
create-wp --version
create-wp -v
create-wp --help
create-wp -hcreate-wpWhat happens step by step
- Config check — Loads
~/.config/create-wordpress/config.json, or runs the setup wizard on first run. - Site name — Prompts for a name (normalised to kebab-case). Validates that no directory or database collision exists.
- Theme selection — Choose from a list of themes defined in your config.
- Plugin selection — Multi-select checkbox to pick plugins.
- Provisioning:
- Creates the site directory in your Herd path.
- Creates a blank MySQL database.
- Downloads WordPress core (uses cache on subsequent runs).
- Generates
wp-config.phpand runs the WP install via WP-CLI. - Installs and activates the selected theme and plugins.
- Provisions an SSL cert via
herd secure.
create-wp --settingsOpens an interactive editor for ~/.config/create-wordpress/config.json so you can update the saved defaults after first run.
This is useful when you want to change:
- websites path
- database username, password, port, or socket
- default WordPress admin username, password, or email
- package server URL or API key
- theme list, default theme, or plugin list
wp_tweaks—config_set,rewrite_structure,option_update,language_core,site
Changes are only written when you choose Save & Exit.
create-wp --versioncreate-wp -vPrints the installed package version and exits.
create-wp --helpcreate-wp -hPrints the full usage guide and exits.
create-wp --configLaunches the site configuration wizard with 5 options:
| Option | Description |
|---|---|
| 🔐 Change admin credentials | Update admin username (via MySQL), password and email (via WP-CLI). Reads DB_NAME and $table_prefix directly from wp-config.php. |
| ⚙️ Apply WordPress configuration | Applies each entry in wp_tweaks from config.json to the selected site via WP-CLI. Supports all 5 tweak types. |
| 🔍 Find and install package(s) by slug | Enter one or more comma-separated slugs, resolve them from the private package server, and install each package automatically. |
| 🎨 Install theme | Pick a theme from your config list and install it on the selected site. |
| 🔌 Install plugins | Multi-select checkbox to install one or more plugins from your config list. |
Apply WordPress configuration reads the wp_tweaks array from config.json and runs each tweak in order:
| Type | WP-CLI command |
|---|---|
config_set |
wp config set <KEY> <VALUE> (+ --raw for booleans / integers) |
rewrite_structure |
wp rewrite structure <VALUE> --hard |
option_update |
wp option update <KEY> <VALUE> |
language_core |
wp language core <KEY> <VALUE> (KEY = install | activate | update) |
site |
wp site <KEY> <VALUE> (for multisite sub-commands) |
Find and install package(s) by slug lets you install packages that are available on your private package server but are not necessarily saved in the local themes or plugins lists.
Example input:
flatsome, advanced-custom-fields-pro, wp-rocket
For each slug, the CLI fetches metadata from the package server, downloads or reuses the cached ZIP, then tries to install it as a plugin first. If plugin installation fails, it falls back to installing it as a theme. A result summary is printed after all slugs are processed.
Important
Find and install package(s) by slug requires both server_url and package_api_key in config.json.
create-wp --backupcreate-wp -bLaunches an interactive backup wizard:
| Method | Output | Details |
|---|---|---|
Full source code |
full-source_<site>_<timestamp>.zip |
Exports the database to a temporary .sql, zips the entire site folder, then removes the loose SQL file from the site root. |
All-in-One WP Migration |
ai1wm-<site>_<timestamp>.wpress |
Installs/activates the AI1WM plugin, runs wp ai1wm backup, then moves the generated backup into the shared backups folder. |
All backups are saved to:
<websites_path>/backups/The backup picker excludes the backups directory itself, so only actual sites are listed.
create-wp --restorecreate-wp -rLaunches an interactive restore wizard with 2 modes:
| Method | Input | What the CLI does |
|---|---|---|
Restore from full source backup |
.zip |
Extracts the archive into a new site directory, creates/reuses the database, updates or creates wp-config.php, imports the bundled .sql, updates siteurl and home, then runs herd secure. |
Restore from All-in-One WP Migration |
.wpress |
Creates a fresh WordPress site, installs the AI1WM plugin, copies the .wpress file into wp-content/ai1wm-backups/, runs wp ai1wm restore, then provisions SSL. |
For both restore modes:
- you choose a new site name, and it is normalized to kebab-case
- if the target directory already exists, the CLI asks before overwriting it
- the restored site is secured with Herd and ends up at
https://<site-name>.test
Important
Restoring from .wpress requires the plugin all-in-one-wp-migration-unlimited-extension to exist in config.plugins. If it is hosted on your private package server, server_url and package_api_key must also be configured.
Interactive mode — shows a multi-select list of all existing sites:
create-wp --deleteDirect mode — delete a specific site immediately:
create-wp --delete my-site-nameBoth modes show a summary of what will be deleted (directory + database) and ask for a single confirmation before any destructive action.
Config file location:
- macOS:
~/.config/create-wordpress/config.json - Windows:
~/.config/create-wordpress/config.json
You can edit this file manually, or run:
create-wp --settingsCache directory:
- WordPress core ZIPs:
~/.config/create-wordpress/cache/wordpress-core/ - Theme and plugin ZIPs:
~/.config/create-wordpress/cache/packages/ - Version metadata:
~/.config/create-wordpress/data.json
{
"websites_path": "F:\\laravel-herd\\wordpress",
"server_url": "https://your-private-repo.com/api",
"package_api_key": "YOUR_SECRET_KEY",
"default_admin_username": "admin",
"default_admin_password": "password123",
"default_admin_email": "admin@example.com",
"database_port": 3306,
"db_username": "root",
"db_password": "",
"default_theme_slug": "flatsome",
"themes": [
{ "name": "Flatsome", "slug": "flatsome" },
{ "name": "Bricks", "slug": "bricks" }
],
"plugins": [
{
"name": "Advanced Custom Fields PRO",
"slug": "advanced-custom-fields-pro"
},
{ "name": "WP Rocket", "slug": "wp-rocket" }
],
"wp_tweaks": [
{ "type": "config_set", "key": "WP_DEBUG", "value": "true", "raw": true },
{ "type": "rewrite_structure", "value": "/%category%/%postname%/" },
{
"type": "option_update",
"key": "timezone_string",
"value": "Asia/Ho_Chi_Minh"
},
{ "type": "language_core", "key": "install", "value": "vi" },
{ "type": "language_core", "key": "activate", "value": "vi" }
]
}Note
If server_url and package_api_key are left empty, the CLI skips theme and plugin downloads - WordPress core setup still works perfectly.
- Unified config path: On both macOS and Windows, configuration is stored in
~/.config/create-wordpress/config.json. - Smart caching: WordPress core ZIPs live in
~/.config/create-wordpress/cache/wordpress-core/, theme and plugin ZIPs live in~/.config/create-wordpress/cache/packages/, and versions are tracked in~/.config/create-wordpress/data.json. - Cross-platform binary resolution: On Windows, Herd injects WP-CLI as
wp.bat. The tool detects.bat/.cmdextensions and routes viacmd.exe /cto avoid the Node.jsDEP0190shell warning. - Admin ID resolution: When changing admin credentials, the tool runs
wp user list --field=ID --number=1to find the real admin user ID (which may not be1), falling back to a direct MySQL query if WP-CLI is unavailable. - DB name from config:
DB_NAMEand$table_prefixare parsed directly from the site'swp-config.php, so the tool works correctly with existing sites that have a different directory name vs. database name.