You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/env/CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,13 @@
19
19
### New Features
20
20
21
21
- Add experimental WordPress Playground runtime support. Use `--runtime=playground` flag to start wp-env with Playground instead of Docker.
22
+
- Add `cleanup` command to remove environment-specific resources (containers, volumes, networks, and local files) while preserving Docker images for faster re-starts.
23
+
- Add `--force` flag to both `destroy` and `cleanup` commands to skip the confirmation prompt.
24
+
- Rename `clean` command to `reset` for clarity. The `clean` command is now deprecated but still works as an alias.
25
+
26
+
### Deprecation
27
+
28
+
- The `clean` command is deprecated. Use `reset` instead. The `afterClean` lifecycle script is also deprecated in favor of `afterReset`.
Copy file name to clipboardExpand all lines: packages/env/lib/cli.js
+45-3Lines changed: 45 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -162,13 +162,31 @@ module.exports = function cli() {
162
162
()=>{},
163
163
withSpinner(env.stop)
164
164
);
165
+
yargs.command(
166
+
'reset [environment]',
167
+
wpYellow('Resets the WordPress databases.'),
168
+
(args)=>{
169
+
args.positional('environment',{
170
+
type: 'string',
171
+
describe: "Which environments' databases to reset.",
172
+
choices: ['all','development','tests'],
173
+
default: 'tests',
174
+
});
175
+
args.option('scripts',{
176
+
type: 'boolean',
177
+
describe: 'Execute any configured lifecycle scripts.',
178
+
default: true,
179
+
});
180
+
},
181
+
withSpinner(env.reset)
182
+
);
165
183
yargs.command(
166
184
'clean [environment]',
167
-
wpYellow('Cleans the WordPress databases.'),
185
+
chalk.gray('[Deprecated: use reset] Resets the WordPress databases.'),
168
186
(args)=>{
169
187
args.positional('environment',{
170
188
type: 'string',
171
-
describe: "Which environments' databases to clean.",
189
+
describe: "Which environments' databases to reset.",
172
190
choices: ['all','development','tests'],
173
191
default: 'tests',
174
192
});
@@ -246,17 +264,41 @@ module.exports = function cli() {
246
264
yargs.command(
247
265
'destroy',
248
266
wpRed(
249
-
'Destroy the WordPress environment. Deletes docker containers, volumes, and networks associated with the WordPress environment and removes local files.'
267
+
'Destroy the WordPress environment. Deletes docker containers, volumes, networks, and images associated with the WordPress environment and removes local files.'
250
268
),
251
269
(args)=>{
252
270
args.option('scripts',{
253
271
type: 'boolean',
254
272
describe: 'Execute any configured lifecycle scripts.',
255
273
default: true,
256
274
});
275
+
args.option('force',{
276
+
type: 'boolean',
277
+
describe: 'Skip the confirmation prompt.',
278
+
default: false,
279
+
});
257
280
},
258
281
withSpinner(env.destroy)
259
282
);
283
+
yargs.command(
284
+
'cleanup',
285
+
wpYellow(
286
+
'Cleanup the WordPress environment. Removes docker containers, volumes, networks, and local files, but preserves docker images for faster re-starts.'
287
+
),
288
+
(args)=>{
289
+
args.option('scripts',{
290
+
type: 'boolean',
291
+
describe: 'Execute any configured lifecycle scripts.',
292
+
default: true,
293
+
});
294
+
args.option('force',{
295
+
type: 'boolean',
296
+
describe: 'Skip the confirmation prompt.',
297
+
default: false,
298
+
});
299
+
},
300
+
withSpinner(env.cleanup)
301
+
);
260
302
yargs.command(
261
303
'status',
262
304
'Get the status of the wp-env environment including URLs, ports, and configuration.',
0 commit comments