@loopress/cli 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +128 -62
  2. package/dist/commands/acf/list.js +2 -1
  3. package/dist/commands/acf/push.js +1 -1
  4. package/dist/commands/api/list.d.ts +7 -4
  5. package/dist/commands/api/list.js +3 -10
  6. package/dist/commands/api/publish.js +1 -1
  7. package/dist/commands/api/pull.d.ts +8 -1
  8. package/dist/commands/api/pull.js +13 -4
  9. package/dist/commands/api/push.d.ts +7 -1
  10. package/dist/commands/api/push.js +48 -18
  11. package/dist/commands/composer/init.js +6 -6
  12. package/dist/commands/composer/pull.d.ts +7 -1
  13. package/dist/commands/composer/pull.js +4 -2
  14. package/dist/commands/composer/push.d.ts +8 -1
  15. package/dist/commands/composer/push.js +3 -1
  16. package/dist/commands/dev.d.ts +13 -0
  17. package/dist/commands/dev.js +97 -0
  18. package/dist/commands/doctor.js +4 -4
  19. package/dist/commands/init.js +7 -7
  20. package/dist/commands/login.js +3 -3
  21. package/dist/commands/page/list.d.ts +2 -4
  22. package/dist/commands/page/list.js +3 -10
  23. package/dist/commands/page/pull.d.ts +13 -1
  24. package/dist/commands/page/pull.js +5 -2
  25. package/dist/commands/page/push.d.ts +11 -1
  26. package/dist/commands/page/push.js +21 -14
  27. package/dist/commands/plugin/add.js +3 -3
  28. package/dist/commands/plugin/pull.d.ts +7 -1
  29. package/dist/commands/plugin/pull.js +3 -1
  30. package/dist/commands/plugin/push.d.ts +9 -1
  31. package/dist/commands/plugin/push.js +13 -9
  32. package/dist/commands/project/config.js +8 -8
  33. package/dist/commands/project/list.js +2 -2
  34. package/dist/commands/project/push.js +5 -5
  35. package/dist/commands/project/switch.js +2 -2
  36. package/dist/commands/snippet/list.d.ts +3 -4
  37. package/dist/commands/snippet/list.js +3 -10
  38. package/dist/commands/snippet/pull.d.ts +13 -1
  39. package/dist/commands/snippet/pull.js +5 -2
  40. package/dist/commands/snippet/push.d.ts +11 -1
  41. package/dist/commands/snippet/push.js +15 -5
  42. package/dist/commands/status.d.ts +13 -1
  43. package/dist/commands/status.js +25 -18
  44. package/dist/config/auth.manager.d.ts +2 -2
  45. package/dist/config/project-config.manager.d.ts +1 -1
  46. package/dist/config/project-config.manager.js +5 -6
  47. package/dist/lib/base.d.ts +2 -2
  48. package/dist/lib/base.js +3 -2
  49. package/dist/lib/bootstrap-full-install.d.ts +1 -1
  50. package/dist/lib/dev-watch.d.ts +16 -0
  51. package/dist/lib/dev-watch.js +71 -0
  52. package/dist/lib/find-orphaned-files.d.ts +3 -2
  53. package/dist/lib/find-orphaned-files.js +40 -4
  54. package/dist/lib/github-release.js +1 -1
  55. package/dist/lib/interactive.js +1 -1
  56. package/dist/lib/load-files.d.ts +1 -0
  57. package/dist/lib/load-files.js +40 -11
  58. package/dist/lib/load-snippets.d.ts +1 -1
  59. package/dist/lib/load-snippets.js +11 -9
  60. package/dist/lib/local-callback-server.js +8 -6
  61. package/dist/lib/plugin-detection.d.ts +1 -1
  62. package/dist/lib/push-command.js +2 -2
  63. package/dist/lib/rotate-app-password.d.ts +1 -1
  64. package/dist/lib/rotate-app-password.js +1 -1
  65. package/dist/lib/temp-admin.d.ts +3 -3
  66. package/dist/lib/temp-admin.js +2 -2
  67. package/dist/lib/wp-authorize-flow.js +5 -1
  68. package/dist/lib/wp-client.d.ts +2 -2
  69. package/dist/lib/wp-client.js +7 -0
  70. package/dist/types/plugin.d.ts +4 -4
  71. package/dist/types/snippet.d.ts +3 -3
  72. package/dist/utils/composer.d.ts +2 -2
  73. package/dist/utils/form-format.js +1 -1
  74. package/dist/utils/loopress-config.d.ts +1 -1
  75. package/dist/utils/page-format.js +2 -2
  76. package/dist/utils/plugins.d.ts +5 -5
  77. package/dist/utils/plugins.js +3 -3
  78. package/dist/utils/seo-format.d.ts +6 -6
  79. package/dist/utils/snippet-format.d.ts +2 -2
  80. package/dist/utils/snippet-format.js +10 -5
  81. package/oclif.manifest.json +153 -31
  82. package/package.json +9 -8
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @loopress/cli
21
21
  $ lps COMMAND
22
22
  running command...
23
23
  $ lps (--version)
24
- @loopress/cli/0.20.1 linux-x64 node-v24.18.0
24
+ @loopress/cli/0.21.0 linux-x64 node-v24.18.0
25
25
  $ lps --help [COMMAND]
26
26
  USAGE
27
27
  $ lps COMMAND
@@ -57,6 +57,7 @@ report.
57
57
  * [`lps composer init`](#lps-composer-init)
58
58
  * [`lps composer pull`](#lps-composer-pull)
59
59
  * [`lps composer push`](#lps-composer-push)
60
+ * [`lps dev`](#lps-dev)
60
61
  * [`lps doctor`](#lps-doctor)
61
62
  * [`lps form list`](#lps-form-list)
62
63
  * [`lps form pull [PATH]`](#lps-form-pull-path)
@@ -112,7 +113,7 @@ EXAMPLES
112
113
  $ lps acf list --type field-groups
113
114
  ```
114
115
 
115
- _See code: [src/commands/acf/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/acf/list.ts)_
116
+ _See code: [src/commands/acf/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/acf/list.ts)_
116
117
 
117
118
  ## `lps acf pull [PATH]`
118
119
 
@@ -141,7 +142,7 @@ EXAMPLES
141
142
  $ lps acf pull --type field-groups
142
143
  ```
143
144
 
144
- _See code: [src/commands/acf/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/acf/pull.ts)_
145
+ _See code: [src/commands/acf/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/acf/pull.ts)_
145
146
 
146
147
  ## `lps acf push [PATH]`
147
148
 
@@ -170,7 +171,7 @@ EXAMPLES
170
171
  $ lps acf push --type field-groups
171
172
  ```
172
173
 
173
- _See code: [src/commands/acf/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/acf/push.ts)_
174
+ _See code: [src/commands/acf/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/acf/push.ts)_
174
175
 
175
176
  ## `lps api list`
176
177
 
@@ -178,11 +179,13 @@ List custom API route files from WordPress
178
179
 
179
180
  ```
180
181
  USAGE
181
- $ lps api list [--env <value>] [-j]
182
+ $ lps api list [--json] [--env <value>]
182
183
 
183
184
  FLAGS
184
- -j, --json Output in JSON format
185
- --env=<value> Target environment by name, overriding the globally active one (lps project switch)
185
+ --env=<value> Target environment by name, overriding the globally active one (lps project switch)
186
+
187
+ GLOBAL FLAGS
188
+ --json Format output as json.
186
189
 
187
190
  DESCRIPTION
188
191
  List custom API route files from WordPress
@@ -191,7 +194,7 @@ EXAMPLES
191
194
  $ lps api list
192
195
  ```
193
196
 
194
- _See code: [src/commands/api/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/api/list.ts)_
197
+ _See code: [src/commands/api/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/api/list.ts)_
195
198
 
196
199
  ## `lps api publish [PATH]`
197
200
 
@@ -214,7 +217,7 @@ EXAMPLES
214
217
  $ lps api publish --path ./api
215
218
  ```
216
219
 
217
- _See code: [src/commands/api/publish.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/api/publish.ts)_
220
+ _See code: [src/commands/api/publish.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/api/publish.ts)_
218
221
 
219
222
  ## `lps api pull [PATH]`
220
223
 
@@ -222,7 +225,7 @@ Pull custom API route files from WordPress
222
225
 
223
226
  ```
224
227
  USAGE
225
- $ lps api pull [PATH] [--env <value>] [-d] [-y]
228
+ $ lps api pull [PATH] [--json] [--env <value>] [-d] [-y]
226
229
 
227
230
  ARGUMENTS
228
231
  [PATH] Path to api directory (overrides project config)
@@ -232,6 +235,9 @@ FLAGS
232
235
  -y, --yes Answer yes to confirmation prompts
233
236
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
234
237
 
238
+ GLOBAL FLAGS
239
+ --json Format output as json.
240
+
235
241
  DESCRIPTION
236
242
  Pull custom API route files from WordPress
237
243
 
@@ -241,7 +247,7 @@ EXAMPLES
241
247
  $ lps api pull --path ./api
242
248
  ```
243
249
 
244
- _See code: [src/commands/api/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/api/pull.ts)_
250
+ _See code: [src/commands/api/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/api/pull.ts)_
245
251
 
246
252
  ## `lps api push [PATH]`
247
253
 
@@ -249,7 +255,7 @@ Push custom API route files to WordPress
249
255
 
250
256
  ```
251
257
  USAGE
252
- $ lps api push [PATH] [--env <value>] [-d] [-y]
258
+ $ lps api push [PATH] [--json] [--env <value>] [-d] [-y]
253
259
 
254
260
  ARGUMENTS
255
261
  [PATH] Path to api directory (overrides project config)
@@ -259,6 +265,9 @@ FLAGS
259
265
  -y, --yes Answer yes to confirmation prompts
260
266
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
261
267
 
268
+ GLOBAL FLAGS
269
+ --json Format output as json.
270
+
262
271
  DESCRIPTION
263
272
  Push custom API route files to WordPress
264
273
 
@@ -268,7 +277,7 @@ EXAMPLES
268
277
  $ lps api push --path ./api
269
278
  ```
270
279
 
271
- _See code: [src/commands/api/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/api/push.ts)_
280
+ _See code: [src/commands/api/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/api/push.ts)_
272
281
 
273
282
  ## `lps composer init`
274
283
 
@@ -291,7 +300,7 @@ EXAMPLES
291
300
  $ lps composer init --dry-run
292
301
  ```
293
302
 
294
- _See code: [src/commands/composer/init.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/composer/init.ts)_
303
+ _See code: [src/commands/composer/init.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/composer/init.ts)_
295
304
 
296
305
  ## `lps composer pull`
297
306
 
@@ -299,12 +308,15 @@ Pull composer.json and composer.lock from WordPress
299
308
 
300
309
  ```
301
310
  USAGE
302
- $ lps composer pull [--env <value>] [-d]
311
+ $ lps composer pull [--json] [--env <value>] [-d]
303
312
 
304
313
  FLAGS
305
314
  -d, --dry-run Show what would change without making changes
306
315
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
307
316
 
317
+ GLOBAL FLAGS
318
+ --json Format output as json.
319
+
308
320
  DESCRIPTION
309
321
  Pull composer.json and composer.lock from WordPress
310
322
 
@@ -314,7 +326,7 @@ EXAMPLES
314
326
  $ lps composer pull --dry-run
315
327
  ```
316
328
 
317
- _See code: [src/commands/composer/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/composer/pull.ts)_
329
+ _See code: [src/commands/composer/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/composer/pull.ts)_
318
330
 
319
331
  ## `lps composer push`
320
332
 
@@ -322,13 +334,16 @@ Push composer.json and composer.lock to WordPress and run composer install
322
334
 
323
335
  ```
324
336
  USAGE
325
- $ lps composer push [--env <value>] [-d] [-y]
337
+ $ lps composer push [--json] [--env <value>] [-d] [-y]
326
338
 
327
339
  FLAGS
328
340
  -d, --dry-run Show what would change without making changes
329
341
  -y, --yes Answer yes to confirmation prompts
330
342
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
331
343
 
344
+ GLOBAL FLAGS
345
+ --json Format output as json.
346
+
332
347
  DESCRIPTION
333
348
  Push composer.json and composer.lock to WordPress and run composer install
334
349
 
@@ -338,7 +353,33 @@ EXAMPLES
338
353
  $ lps composer push --dry-run
339
354
  ```
340
355
 
341
- _See code: [src/commands/composer/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/composer/push.ts)_
356
+ _See code: [src/commands/composer/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/composer/push.ts)_
357
+
358
+ ## `lps dev`
359
+
360
+ Watch project files and push changes to the local WordPress instance as they happen. Always targets the "local" environment, run `lps snippet push` etc. directly for any other environment.
361
+
362
+ ```
363
+ USAGE
364
+ $ lps dev [--only <value>] [--skip <value>]
365
+
366
+ FLAGS
367
+ --only=<value> Only watch these resource types (comma-separated): snippets, pages, api, plugins
368
+ --skip=<value> Skip these resource types (comma-separated): snippets, pages, api, plugins
369
+
370
+ DESCRIPTION
371
+ Watch project files and push changes to the local WordPress instance as they happen. Always targets the "local"
372
+ environment, run `lps snippet push` etc. directly for any other environment.
373
+
374
+ EXAMPLES
375
+ $ lps dev
376
+
377
+ $ lps dev --only=snippets,pages
378
+
379
+ $ lps dev --skip=plugins
380
+ ```
381
+
382
+ _See code: [src/commands/dev.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/dev.ts)_
342
383
 
343
384
  ## `lps doctor`
344
385
 
@@ -360,7 +401,7 @@ EXAMPLES
360
401
  $ lps doctor --env production
361
402
  ```
362
403
 
363
- _See code: [src/commands/doctor.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/doctor.ts)_
404
+ _See code: [src/commands/doctor.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/doctor.ts)_
364
405
 
365
406
  ## `lps form list`
366
407
 
@@ -381,7 +422,7 @@ EXAMPLES
381
422
  $ lps form list
382
423
  ```
383
424
 
384
- _See code: [src/commands/form/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/form/list.ts)_
425
+ _See code: [src/commands/form/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/form/list.ts)_
385
426
 
386
427
  ## `lps form pull [PATH]`
387
428
 
@@ -406,7 +447,7 @@ EXAMPLES
406
447
  $ lps form pull
407
448
  ```
408
449
 
409
- _See code: [src/commands/form/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/form/pull.ts)_
450
+ _See code: [src/commands/form/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/form/pull.ts)_
410
451
 
411
452
  ## `lps form push [PATH]`
412
453
 
@@ -432,7 +473,7 @@ EXAMPLES
432
473
  $ lps form push
433
474
  ```
434
475
 
435
- _See code: [src/commands/form/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/form/push.ts)_
476
+ _See code: [src/commands/form/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/form/push.ts)_
436
477
 
437
478
  ## `lps help [COMMAND]`
438
479
 
@@ -452,7 +493,7 @@ DESCRIPTION
452
493
  Display help for lps.
453
494
  ```
454
495
 
455
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.55/src/commands/help.ts)_
496
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.56/src/commands/help.ts)_
456
497
 
457
498
  ## `lps init`
458
499
 
@@ -469,7 +510,7 @@ EXAMPLES
469
510
  $ lps init
470
511
  ```
471
512
 
472
- _See code: [src/commands/init.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/init.ts)_
513
+ _See code: [src/commands/init.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/init.ts)_
473
514
 
474
515
  ## `lps login`
475
516
 
@@ -486,7 +527,7 @@ EXAMPLES
486
527
  $ lps login
487
528
  ```
488
529
 
489
- _See code: [src/commands/login.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/login.ts)_
530
+ _See code: [src/commands/login.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/login.ts)_
490
531
 
491
532
  ## `lps logout`
492
533
 
@@ -503,7 +544,7 @@ EXAMPLES
503
544
  $ lps logout
504
545
  ```
505
546
 
506
- _See code: [src/commands/logout.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/logout.ts)_
547
+ _See code: [src/commands/logout.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/logout.ts)_
507
548
 
508
549
  ## `lps page list`
509
550
 
@@ -511,11 +552,13 @@ List pages from WordPress
511
552
 
512
553
  ```
513
554
  USAGE
514
- $ lps page list [--env <value>] [-j]
555
+ $ lps page list [--json] [--env <value>]
515
556
 
516
557
  FLAGS
517
- -j, --json Output in JSON format
518
- --env=<value> Target environment by name, overriding the globally active one (lps project switch)
558
+ --env=<value> Target environment by name, overriding the globally active one (lps project switch)
559
+
560
+ GLOBAL FLAGS
561
+ --json Format output as json.
519
562
 
520
563
  DESCRIPTION
521
564
  List pages from WordPress
@@ -524,7 +567,7 @@ EXAMPLES
524
567
  $ lps page list
525
568
  ```
526
569
 
527
- _See code: [src/commands/page/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/page/list.ts)_
570
+ _See code: [src/commands/page/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/page/list.ts)_
528
571
 
529
572
  ## `lps page pull [PATH]`
530
573
 
@@ -532,7 +575,7 @@ Pull pages from WordPress
532
575
 
533
576
  ```
534
577
  USAGE
535
- $ lps page pull [PATH] [--env <value>] [-d] [-y]
578
+ $ lps page pull [PATH] [--json] [--env <value>] [-d] [-y]
536
579
 
537
580
  ARGUMENTS
538
581
  [PATH] Path to pages directory (overrides project config)
@@ -542,6 +585,9 @@ FLAGS
542
585
  -y, --yes Answer yes to confirmation prompts
543
586
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
544
587
 
588
+ GLOBAL FLAGS
589
+ --json Format output as json.
590
+
545
591
  DESCRIPTION
546
592
  Pull pages from WordPress
547
593
 
@@ -549,7 +595,7 @@ EXAMPLES
549
595
  $ lps page pull
550
596
  ```
551
597
 
552
- _See code: [src/commands/page/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/page/pull.ts)_
598
+ _See code: [src/commands/page/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/page/pull.ts)_
553
599
 
554
600
  ## `lps page push [PATH]`
555
601
 
@@ -557,7 +603,7 @@ Push pages to WordPress. Local files created or updated remotely are renamed on
557
603
 
558
604
  ```
559
605
  USAGE
560
- $ lps page push [PATH] [--env <value>] [-d] [-y]
606
+ $ lps page push [PATH] [--json] [--env <value>] [-d] [-y]
561
607
 
562
608
  ARGUMENTS
563
609
  [PATH] Path to pages directory (overrides project config)
@@ -567,6 +613,9 @@ FLAGS
567
613
  -y, --yes Answer yes to confirmation prompts
568
614
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
569
615
 
616
+ GLOBAL FLAGS
617
+ --json Format output as json.
618
+
570
619
  DESCRIPTION
571
620
  Push pages to WordPress. Local files created or updated remotely are renamed on disk to the `<id>-<slug>` convention.
572
621
 
@@ -574,7 +623,7 @@ EXAMPLES
574
623
  $ lps page push
575
624
  ```
576
625
 
577
- _See code: [src/commands/page/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/page/push.ts)_
626
+ _See code: [src/commands/page/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/page/push.ts)_
578
627
 
579
628
  ## `lps plugin add SLUG`
580
629
 
@@ -600,7 +649,7 @@ EXAMPLES
600
649
  $ lps plugin add contact-form-7 --dry-run
601
650
  ```
602
651
 
603
- _See code: [src/commands/plugin/add.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/plugin/add.ts)_
652
+ _See code: [src/commands/plugin/add.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/plugin/add.ts)_
604
653
 
605
654
  ## `lps plugin pull`
606
655
 
@@ -608,12 +657,15 @@ Pull installed plugins from WordPress into loopress.json
608
657
 
609
658
  ```
610
659
  USAGE
611
- $ lps plugin pull [--env <value>] [-d]
660
+ $ lps plugin pull [--json] [--env <value>] [-d]
612
661
 
613
662
  FLAGS
614
663
  -d, --dry-run Show what would change without making changes
615
664
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
616
665
 
666
+ GLOBAL FLAGS
667
+ --json Format output as json.
668
+
617
669
  DESCRIPTION
618
670
  Pull installed plugins from WordPress into loopress.json
619
671
 
@@ -623,7 +675,7 @@ EXAMPLES
623
675
  $ lps plugin pull --dry-run
624
676
  ```
625
677
 
626
- _See code: [src/commands/plugin/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/plugin/pull.ts)_
678
+ _See code: [src/commands/plugin/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/plugin/pull.ts)_
627
679
 
628
680
  ## `lps plugin push`
629
681
 
@@ -631,13 +683,16 @@ Push plugins to WordPress to match loopress.json
631
683
 
632
684
  ```
633
685
  USAGE
634
- $ lps plugin push [--env <value>] [-d] [-y]
686
+ $ lps plugin push [--json] [--env <value>] [-d] [-y]
635
687
 
636
688
  FLAGS
637
689
  -d, --dry-run Show what would change without making changes
638
690
  -y, --yes Answer yes to confirmation prompts
639
691
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
640
692
 
693
+ GLOBAL FLAGS
694
+ --json Format output as json.
695
+
641
696
  DESCRIPTION
642
697
  Push plugins to WordPress to match loopress.json
643
698
 
@@ -647,7 +702,7 @@ EXAMPLES
647
702
  $ lps plugin push --dry-run
648
703
  ```
649
704
 
650
- _See code: [src/commands/plugin/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/plugin/push.ts)_
705
+ _See code: [src/commands/plugin/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/plugin/push.ts)_
651
706
 
652
707
  ## `lps project config`
653
708
 
@@ -665,7 +720,7 @@ EXAMPLES
665
720
  $ lps project config
666
721
  ```
667
722
 
668
- _See code: [src/commands/project/config.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/config.ts)_
723
+ _See code: [src/commands/project/config.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/config.ts)_
669
724
 
670
725
  ## `lps project list`
671
726
 
@@ -682,7 +737,7 @@ EXAMPLES
682
737
  $ lps project list
683
738
  ```
684
739
 
685
- _See code: [src/commands/project/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/list.ts)_
740
+ _See code: [src/commands/project/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/list.ts)_
686
741
 
687
742
  ## `lps project pull`
688
743
 
@@ -699,7 +754,7 @@ EXAMPLES
699
754
  $ lps project pull
700
755
  ```
701
756
 
702
- _See code: [src/commands/project/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/pull.ts)_
757
+ _See code: [src/commands/project/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/pull.ts)_
703
758
 
704
759
  ## `lps project push`
705
760
 
@@ -719,7 +774,7 @@ EXAMPLES
719
774
  $ lps project push
720
775
  ```
721
776
 
722
- _See code: [src/commands/project/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/push.ts)_
777
+ _See code: [src/commands/project/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/push.ts)_
723
778
 
724
779
  ## `lps project remove`
725
780
 
@@ -736,7 +791,7 @@ EXAMPLES
736
791
  $ lps project remove
737
792
  ```
738
793
 
739
- _See code: [src/commands/project/remove.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/remove.ts)_
794
+ _See code: [src/commands/project/remove.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/remove.ts)_
740
795
 
741
796
  ## `lps project rotate`
742
797
 
@@ -758,7 +813,7 @@ EXAMPLES
758
813
  $ lps project rotate --env staging
759
814
  ```
760
815
 
761
- _See code: [src/commands/project/rotate.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/rotate.ts)_
816
+ _See code: [src/commands/project/rotate.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/rotate.ts)_
762
817
 
763
818
  ## `lps project switch`
764
819
 
@@ -775,7 +830,7 @@ EXAMPLES
775
830
  $ lps project switch
776
831
  ```
777
832
 
778
- _See code: [src/commands/project/switch.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/project/switch.ts)_
833
+ _See code: [src/commands/project/switch.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/project/switch.ts)_
779
834
 
780
835
  ## `lps seo list`
781
836
 
@@ -799,7 +854,7 @@ EXAMPLES
799
854
  $ lps seo list --post-type post
800
855
  ```
801
856
 
802
- _See code: [src/commands/seo/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/seo/list.ts)_
857
+ _See code: [src/commands/seo/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/seo/list.ts)_
803
858
 
804
859
  ## `lps seo pull [PATH]`
805
860
 
@@ -827,7 +882,7 @@ EXAMPLES
827
882
  $ lps seo pull --post-type post --post-type page
828
883
  ```
829
884
 
830
- _See code: [src/commands/seo/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/seo/pull.ts)_
885
+ _See code: [src/commands/seo/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/seo/pull.ts)_
831
886
 
832
887
  ## `lps seo push [PATH]`
833
888
 
@@ -853,7 +908,7 @@ EXAMPLES
853
908
  $ lps seo push
854
909
  ```
855
910
 
856
- _See code: [src/commands/seo/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/seo/push.ts)_
911
+ _See code: [src/commands/seo/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/seo/push.ts)_
857
912
 
858
913
  ## `lps snippet list`
859
914
 
@@ -861,11 +916,13 @@ List snippets from WordPress
861
916
 
862
917
  ```
863
918
  USAGE
864
- $ lps snippet list [--env <value>] [-j]
919
+ $ lps snippet list [--json] [--env <value>]
865
920
 
866
921
  FLAGS
867
- -j, --json Output in JSON format
868
- --env=<value> Target environment by name, overriding the globally active one (lps project switch)
922
+ --env=<value> Target environment by name, overriding the globally active one (lps project switch)
923
+
924
+ GLOBAL FLAGS
925
+ --json Format output as json.
869
926
 
870
927
  DESCRIPTION
871
928
  List snippets from WordPress
@@ -874,7 +931,7 @@ EXAMPLES
874
931
  $ lps snippet list
875
932
  ```
876
933
 
877
- _See code: [src/commands/snippet/list.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/snippet/list.ts)_
934
+ _See code: [src/commands/snippet/list.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/snippet/list.ts)_
878
935
 
879
936
  ## `lps snippet publish [PATH]`
880
937
 
@@ -897,7 +954,7 @@ EXAMPLES
897
954
  $ lps snippet publish --path ./snippets
898
955
  ```
899
956
 
900
- _See code: [src/commands/snippet/publish.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/snippet/publish.ts)_
957
+ _See code: [src/commands/snippet/publish.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/snippet/publish.ts)_
901
958
 
902
959
  ## `lps snippet pull [PATH]`
903
960
 
@@ -905,7 +962,7 @@ Pull snippets from WordPress
905
962
 
906
963
  ```
907
964
  USAGE
908
- $ lps snippet pull [PATH] [--env <value>] [-d] [-y]
965
+ $ lps snippet pull [PATH] [--json] [--env <value>] [-d] [-y]
909
966
 
910
967
  ARGUMENTS
911
968
  [PATH] Path to snippets directory (overrides project config)
@@ -915,6 +972,9 @@ FLAGS
915
972
  -y, --yes Answer yes to confirmation prompts
916
973
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
917
974
 
975
+ GLOBAL FLAGS
976
+ --json Format output as json.
977
+
918
978
  DESCRIPTION
919
979
  Pull snippets from WordPress
920
980
 
@@ -924,7 +984,7 @@ EXAMPLES
924
984
  $ lps snippet pull --path ./snippets
925
985
  ```
926
986
 
927
- _See code: [src/commands/snippet/pull.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/snippet/pull.ts)_
987
+ _See code: [src/commands/snippet/pull.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/snippet/pull.ts)_
928
988
 
929
989
  ## `lps snippet push [PATH]`
930
990
 
@@ -932,7 +992,7 @@ Push snippets to WordPress. Local snippet files created or updated remotely are
932
992
 
933
993
  ```
934
994
  USAGE
935
- $ lps snippet push [PATH] [--env <value>] [-d] [-y]
995
+ $ lps snippet push [PATH] [--json] [--env <value>] [-d] [-y]
936
996
 
937
997
  ARGUMENTS
938
998
  [PATH] Path to snippets directory (overrides project config)
@@ -942,6 +1002,9 @@ FLAGS
942
1002
  -y, --yes Answer yes to confirmation prompts
943
1003
  --env=<value> Target environment by name, overriding the globally active one (lps project switch)
944
1004
 
1005
+ GLOBAL FLAGS
1006
+ --json Format output as json.
1007
+
945
1008
  DESCRIPTION
946
1009
  Push snippets to WordPress. Local snippet files created or updated remotely are renamed on disk to the `<id>-<slug>`
947
1010
  convention.
@@ -952,7 +1015,7 @@ EXAMPLES
952
1015
  $ lps snippet push --path ./snippets
953
1016
  ```
954
1017
 
955
- _See code: [src/commands/snippet/push.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/snippet/push.ts)_
1018
+ _See code: [src/commands/snippet/push.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/snippet/push.ts)_
956
1019
 
957
1020
  ## `lps status`
958
1021
 
@@ -960,11 +1023,14 @@ Show which WordPress project and environment commands will target
960
1023
 
961
1024
  ```
962
1025
  USAGE
963
- $ lps status [--env <value>]
1026
+ $ lps status [--json] [--env <value>]
964
1027
 
965
1028
  FLAGS
966
1029
  --env=<value> Show what would be targeted with this environment, as other commands do with --env
967
1030
 
1031
+ GLOBAL FLAGS
1032
+ --json Format output as json.
1033
+
968
1034
  DESCRIPTION
969
1035
  Show which WordPress project and environment commands will target
970
1036
 
@@ -974,7 +1040,7 @@ EXAMPLES
974
1040
  $ lps status --env staging
975
1041
  ```
976
1042
 
977
- _See code: [src/commands/status.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/status.ts)_
1043
+ _See code: [src/commands/status.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/status.ts)_
978
1044
 
979
1045
  ## `lps telemetry disable`
980
1046
 
@@ -991,7 +1057,7 @@ EXAMPLES
991
1057
  $ lps telemetry disable
992
1058
  ```
993
1059
 
994
- _See code: [src/commands/telemetry/disable.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/telemetry/disable.ts)_
1060
+ _See code: [src/commands/telemetry/disable.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/telemetry/disable.ts)_
995
1061
 
996
1062
  ## `lps telemetry enable`
997
1063
 
@@ -1008,5 +1074,5 @@ EXAMPLES
1008
1074
  $ lps telemetry enable
1009
1075
  ```
1010
1076
 
1011
- _See code: [src/commands/telemetry/enable.ts](https://github.com/loopress/loopress/blob/v0.20.1/src/commands/telemetry/enable.ts)_
1077
+ _See code: [src/commands/telemetry/enable.ts](https://github.com/loopress/loopress/blob/v0.21.0/src/commands/telemetry/enable.ts)_
1012
1078
  <!-- commandsstop -->
@@ -28,7 +28,8 @@ export default class List extends LoopressCommand {
28
28
  continue;
29
29
  }
30
30
  for (const object of objects) {
31
- this.log(` ${getAcfKey(object) ?? '(no key)'}. ${String(object.title ?? '(untitled)')}`);
31
+ const title = typeof object.title === 'string' ? object.title : '(untitled)';
32
+ this.log(` ${getAcfKey(object) ?? '(no key)'}. ${title}`);
32
33
  }
33
34
  this.log('');
34
35
  }
@@ -36,7 +36,7 @@ export default class Push extends PushCommand {
36
36
  async loadObjects(dir) {
37
37
  return loadFiles(dir, {
38
38
  extension: '.json',
39
- onSkip: (message) => this.warn(message),
39
+ onSkip: (message) => { this.warn(message); },
40
40
  parse(raw) {
41
41
  const parsed = JSON.parse(raw);
42
42
  if (typeof parsed !== 'object' || parsed === null || getAcfKey(parsed) === null) {
@@ -1,9 +1,12 @@
1
1
  import { LoopressCommand } from '../../lib/base.js';
2
+ type ApiFile = {
3
+ content: string;
4
+ filename: string;
5
+ };
2
6
  export default class List extends LoopressCommand {
3
7
  static description: string;
8
+ static enableJsonFlag: boolean;
4
9
  static examples: string[];
5
- static flags: {
6
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
- };
8
- run(): Promise<void>;
10
+ run(): Promise<ApiFile[]>;
9
11
  }
12
+ export {};