Skip to content

Commit cae150a

Browse files
adamzielshimotmkdeployment_botbrandonpayton
authored
[CLI] Add --wordpress-install-mode flag (#2803)
## Motivation for the change, related issues Studio noted they can't easily used a local, unzipped WordPress directory: > Playground CLI always tries to download and install WordPress if we don't have the skipWordpressSetup flag This PR separates skipping the download from skipping the installation. ## Implementation This PR adds a new CLI option called `--wordpress-install-mode` with the following supported values: * download-and-install (default) * install-from-existing-files * install-from-existing-files-if-needed * assume-already-installed Supersedes #2786 ### Testing instructions Run ``` alias pgcli="node --no-warnings=ExperimentalWarning --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts" # This should install an already downloaded WordPress pgcli server --wordpress-install-mode=download-and-install --mount-before-install=./unzipped-wp-directory:/wordpress # This should install WordPress without downloading it first pgcli server --wordpress-install-mode=install-from-existing-files --mount-before-install=./unzipped-wp-directory:/wordpress ``` cc @bcotrim @brandonpayton --------- Co-authored-by: tomoki shimomura <shimotmk1104@gmail.com> Co-authored-by: deployment_bot <deployment_bot@users.noreply.github.com> Co-authored-by: Brandon Payton <brandon@happycode.net>
1 parent 2c0cf55 commit cae150a

File tree

27 files changed

+1804
-3934
lines changed

27 files changed

+1804
-3934
lines changed

CHANGELOG.md

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,153 +4,146 @@ All notable changes to this project are documented in this file by a CI job
44
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
55
format.
66

7-
## [v3.0.19] (2025-11-04)
7+
## [v3.0.19] (2025-11-04)
88

99
### Enhancements
1010

11-
- [CLI] Support .0 versions, e.g. 6.4.0. ([#2848](https://github.com/WordPress/wordpress-playground/pull/2848))
11+
- [CLI] Support .0 versions, e.g. 6.4.0. ([#2848](https://github.com/WordPress/wordpress-playground/pull/2848))
1212

1313
### Documentation
1414

15-
- [Docs] Remove kapa AI button. ([#2849](https://github.com/WordPress/wordpress-playground/pull/2849))
15+
- [Docs] Remove kapa AI button. ([#2849](https://github.com/WordPress/wordpress-playground/pull/2849))
1616

1717
### PHP WebAssembly
1818

19-
- Fix unmount of nested mounts in PHP runtime hotswap. ([#2859](https://github.com/WordPress/wordpress-playground/pull/2859))
19+
- Fix unmount of nested mounts in PHP runtime hotswap. ([#2859](https://github.com/WordPress/wordpress-playground/pull/2859))
2020

2121
### Website
2222

23-
- Controlled iframe for the latest Guteneberg version. ([#2857](https://github.com/WordPress/wordpress-playground/pull/2857))
24-
- [TCP Proxy] Produce the correct request path in parseHttpRequest(). ([#2852](https://github.com/WordPress/wordpress-playground/pull/2852))
23+
- Controlled iframe for the latest Guteneberg version. ([#2857](https://github.com/WordPress/wordpress-playground/pull/2857))
24+
- [TCP Proxy] Produce the correct request path in parseHttpRequest(). ([#2852](https://github.com/WordPress/wordpress-playground/pull/2852))
2525

2626
### Bug Fixes
2727

28-
- [CLI] Avoid breaks during Playground boot when `--xdebug` enabled. ([#2835](https://github.com/WordPress/wordpress-playground/pull/2835))
29-
- [CLI] Fix incorrect Xdebug mappings for absolute host paths. ([#2860](https://github.com/WordPress/wordpress-playground/pull/2860))
28+
- [CLI] Avoid breaks during Playground boot when `--xdebug` enabled. ([#2835](https://github.com/WordPress/wordpress-playground/pull/2835))
29+
- [CLI] Fix incorrect Xdebug mappings for absolute host paths. ([#2860](https://github.com/WordPress/wordpress-playground/pull/2860))
3030

3131
### Various
3232

33-
- Translate to bangla in contributing index file. ([#2851](https://github.com/WordPress/wordpress-playground/pull/2851))
34-
- [i18n] Add Japanese translations to Playground API Client. ([#2854](https://github.com/WordPress/wordpress-playground/pull/2854))
33+
- Translate to bangla in contributing index file. ([#2851](https://github.com/WordPress/wordpress-playground/pull/2851))
34+
- [i18n] Add Japanese translations to Playground API Client. ([#2854](https://github.com/WordPress/wordpress-playground/pull/2854))
3535

3636
### Contributors
3737

3838
The following contributors merged PRs in this release:
3939

4040
@adamziel @brandonpayton @fellyph @noruzzamans @shimotmk
4141

42-
43-
## [v3.0.18] (2025-10-31)
42+
## [v3.0.18] (2025-10-31)
4443

4544
### PHP WebAssembly
4645

47-
- Remove old, unused .wasm files from @php-wasm/web. ([#2847](https://github.com/WordPress/wordpress-playground/pull/2847))
46+
- Remove old, unused .wasm files from @php-wasm/web. ([#2847](https://github.com/WordPress/wordpress-playground/pull/2847))
4847

4948
### Contributors
5049

5150
The following contributors merged PRs in this release:
5251

5352
@brandonpayton
5453

55-
56-
## [v3.0.17] (2025-10-31)
54+
## [v3.0.17] (2025-10-31)
5755

5856
### PHP WebAssembly
5957

60-
- Remove old, unused php-wasm .wasm files. ([#2846](https://github.com/WordPress/wordpress-playground/pull/2846))
58+
- Remove old, unused php-wasm .wasm files. ([#2846](https://github.com/WordPress/wordpress-playground/pull/2846))
6159

6260
### Website
6361

64-
- Remove client package from the list of offline mode assets. ([#2841](https://github.com/WordPress/wordpress-playground/pull/2841))
62+
- Remove client package from the list of offline mode assets. ([#2841](https://github.com/WordPress/wordpress-playground/pull/2841))
6563

6664
### Bug Fixes
6765

68-
- [CLI] Fix temp dir cleanup when Playground CLI server is killed. ([#2836](https://github.com/WordPress/wordpress-playground/pull/2836))
66+
- [CLI] Fix temp dir cleanup when Playground CLI server is killed. ([#2836](https://github.com/WordPress/wordpress-playground/pull/2836))
6967

7068
### Various
7169

72-
- Translate contributor-badge page to bangla. ([#2843](https://github.com/WordPress/wordpress-playground/pull/2843))
70+
- Translate contributor-badge page to bangla. ([#2843](https://github.com/WordPress/wordpress-playground/pull/2843))
7371

7472
### Contributors
7573

7674
The following contributors merged PRs in this release:
7775

7876
@bgrgicak @brandonpayton @noruzzamans
7977

80-
81-
## [v3.0.16] (2025-10-31)
78+
## [v3.0.16] (2025-10-31)
8279

8380
### Enhancements
8481

85-
- [ xdebug ] Add `--experimental-unsafe-ide-integration` option in Playground CLI. ([#2777](https://github.com/WordPress/wordpress-playground/pull/2777))
82+
- [ xdebug ] Add `--experimental-unsafe-ide-integration` option in Playground CLI. ([#2777](https://github.com/WordPress/wordpress-playground/pull/2777))
8683

8784
### Tools
8885

89-
9086
#### PHP WebAssembly
9187

92-
- Add support for AVIF in GD. ([#2814](https://github.com/WordPress/wordpress-playground/pull/2814))
88+
- Add support for AVIF in GD. ([#2814](https://github.com/WordPress/wordpress-playground/pull/2814))
9389

9490
### Documentation
9591

96-
- [Docs] Adding data persistence information. ([#2798](https://github.com/WordPress/wordpress-playground/pull/2798))
97-
- [i18n] Adding cli flags to Portuguese and Spanish. ([#2829](https://github.com/WordPress/wordpress-playground/pull/2829))
92+
- [Docs] Adding data persistence information. ([#2798](https://github.com/WordPress/wordpress-playground/pull/2798))
93+
- [i18n] Adding cli flags to Portuguese and Spanish. ([#2829](https://github.com/WordPress/wordpress-playground/pull/2829))
9894

9995
### PHP WebAssembly
10096

101-
- [PHP] SOAP extension. ([#2832](https://github.com/WordPress/wordpress-playground/pull/2832))
97+
- [PHP] SOAP extension. ([#2832](https://github.com/WordPress/wordpress-playground/pull/2832))
10298

10399
### Website
104100

105-
- Make saved sites sidebar more narrow. ([#2826](https://github.com/WordPress/wordpress-playground/pull/2826))
106-
- Add refresh button to the left of address bar. ([#2828](https://github.com/WordPress/wordpress-playground/pull/2828))
107-
- Wider site info on smaller breakpoints. ([#2830](https://github.com/WordPress/wordpress-playground/pull/2830))
101+
- Make saved sites sidebar more narrow. ([#2826](https://github.com/WordPress/wordpress-playground/pull/2826))
102+
- Add refresh button to the left of address bar. ([#2828](https://github.com/WordPress/wordpress-playground/pull/2828))
103+
- Wider site info on smaller breakpoints. ([#2830](https://github.com/WordPress/wordpress-playground/pull/2830))
108104

109105
### Various
110106

111-
- Translate documentation content to Bangla language. ([#2839](https://github.com/WordPress/wordpress-playground/pull/2839))
112-
- [Docs] Updating CLI flags list. ([#2812](https://github.com/WordPress/wordpress-playground/pull/2812))
113-
- [i18n] Adding Luganda structure. ([#2774](https://github.com/WordPress/wordpress-playground/pull/2774))
114-
- [i18n] Create contributor-day.md for Gujarati. ([#2791](https://github.com/WordPress/wordpress-playground/pull/2791))
107+
- Translate documentation content to Bangla language. ([#2839](https://github.com/WordPress/wordpress-playground/pull/2839))
108+
- [Docs] Updating CLI flags list. ([#2812](https://github.com/WordPress/wordpress-playground/pull/2812))
109+
- [i18n] Adding Luganda structure. ([#2774](https://github.com/WordPress/wordpress-playground/pull/2774))
110+
- [i18n] Create contributor-day.md for Gujarati. ([#2791](https://github.com/WordPress/wordpress-playground/pull/2791))
115111

116112
### Contributors
117113

118114
The following contributors merged PRs in this release:
119115

120116
@adamziel @akirk @Dhruval-678 @fellyph @mho22 @noruzzamans
121117

122-
123-
## [v3.0.15] (2025-10-27)
118+
## [v3.0.15] (2025-10-27)
124119

125120
### Tools
126121

127-
128122
#### Import/Export
129123

130-
- [Blueprints] Use _SERVER['HTTPS'] in the import step. ([#2802](https://github.com/WordPress/wordpress-playground/pull/2802))
124+
- [Blueprints] Use \_SERVER['HTTPS'] in the import step. ([#2802](https://github.com/WordPress/wordpress-playground/pull/2802))
131125

132126
### Website
133127

134-
- Add Playground logo and 'import' menu to the sidebar. ([#2806](https://github.com/WordPress/wordpress-playground/pull/2806))
135-
- Ask for a Playground name before saving. ([#2768](https://github.com/WordPress/wordpress-playground/pull/2768))
136-
- File browser and code editor. ([#2813](https://github.com/WordPress/wordpress-playground/pull/2813))
137-
- Move the sidebar icon to the right. ([#2811](https://github.com/WordPress/wordpress-playground/pull/2811))
138-
- Refresh button icons next to the browser bar. ([#2807](https://github.com/WordPress/wordpress-playground/pull/2807))
139-
- Resizable sidebar. ([#2809](https://github.com/WordPress/wordpress-playground/pull/2809))
140-
- Restore the visible button selection in the sidebar. ([#2804](https://github.com/WordPress/wordpress-playground/pull/2804))
141-
- Retain address bar when opening the sidebar. ([#2808](https://github.com/WordPress/wordpress-playground/pull/2808))
128+
- Add Playground logo and 'import' menu to the sidebar. ([#2806](https://github.com/WordPress/wordpress-playground/pull/2806))
129+
- Ask for a Playground name before saving. ([#2768](https://github.com/WordPress/wordpress-playground/pull/2768))
130+
- File browser and code editor. ([#2813](https://github.com/WordPress/wordpress-playground/pull/2813))
131+
- Move the sidebar icon to the right. ([#2811](https://github.com/WordPress/wordpress-playground/pull/2811))
132+
- Refresh button icons next to the browser bar. ([#2807](https://github.com/WordPress/wordpress-playground/pull/2807))
133+
- Resizable sidebar. ([#2809](https://github.com/WordPress/wordpress-playground/pull/2809))
134+
- Restore the visible button selection in the sidebar. ([#2804](https://github.com/WordPress/wordpress-playground/pull/2804))
135+
- Retain address bar when opening the sidebar. ([#2808](https://github.com/WordPress/wordpress-playground/pull/2808))
142136

143137
### Various
144138

145-
- [i18n] Add Japanese translations to `remote.html` vs `index.html`. ([#2817](https://github.com/WordPress/wordpress-playground/pull/2817))
139+
- [i18n] Add Japanese translations to `remote.html` vs `index.html`. ([#2817](https://github.com/WordPress/wordpress-playground/pull/2817))
146140

147141
### Contributors
148142

149143
The following contributors merged PRs in this release:
150144

151145
@adamziel @shimotmk
152146

153-
154147
## [v3.0.14] (2025-10-21)
155148

156149
### Various

packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ The `server` command supports the following optional arguments:
182182
- `--blueprint=<path>`: The path to a JSON Blueprint file to execute.
183183
- `--blueprint-may-read-adjacent-files`: Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint file.
184184
- `--login`: Automatically log the user in as an administrator.
185-
- `--skip-wordpress-setup`: Do not download or install WordPress. Useful if you are mounting a full WordPress directory.
185+
- `--wordpress-install-mode <mode>`: Control how Playground prepares WordPress before booting. Defaults to `download-and-install`. Other options: `install-from-existing-files` (install using files you've mounted), `install-from-existing-files-if-needed` (skip setup when an existing site is detected), and `do-not-attempt-installing` (never download or install WordPress).
186186
- `--skip-sqlite-setup`: Do not set up the SQLite database integration.
187187
- `--verbosity=<level>`: Output logs and progress messages. Choices: `quiet`, `normal`, `debug`. Defaults to `normal`.
188188
- `--debug`: Print the PHP error log if an error occurs during boot.

0 commit comments

Comments
 (0)