Skip to content

Commit 0457b23

Browse files
authored
Updating runCLI demo at wp-playground/cli README file (#2553)
## Motivation for the change, related issues The `runCLI` demo is showing an outdated demo; the flow using the runCLI has changed, and the example displayed at the latest playground package doesn't run. This pull request updates the demo with a simple example to spin a playground CLI server. This pull request is part of the issue #2552
1 parent 781dbe8 commit 0457b23

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/playground/cli/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,16 @@ npx @wp-playground/cli@latest server --blueprint=./my-blueprint.json
149149
The Playground CLI can be controlled programmatically from your JavaScript code using the `runCLI` function. This allows you to integrate all CLI functionalities directly into your development workflow, for example, end-to-end testing.
150150

151151
```JavaScript
152-
import { runCLI } from "@wp-playground/cli";
152+
import { runCLI, RunCLIServer } from "@wp-playground/cli";
153153

154-
const cliServer = await runCLI({
155-
command: "server"
154+
let cliServer: RunCLIServer;
155+
156+
cliServer = await runCLI({
157+
command: 'server',
158+
php: '8.3',
159+
wp: 'latest',
160+
login: true
156161
});
157-
const handler = cliServer.requestHandler;
158-
const php = await handler.getPrimaryPhp();
159162
```
160163

161164
## Comparisons

0 commit comments

Comments
 (0)