Skip to content

CLI ​

waygraph <command> [project]: the project defaults to the current folder. waygraph <command> --help prints that command's flags, from the same table the CLI parses, so an unknown flag stops with the reason.

Play flows ​

WantCommand
list flows (file → export)waygraph list
run a flowwaygraph run checkoutFlow · waygraph run src/flows/checkout.flow.ts
run two in a rowwaygraph run "loginFlow then shopFlow"
run Blocks by namewaygraph run "loginFlow then nav-cart"
watch it step by stepwaygraph demo checkoutFlow (flags)
show the browser, record itwaygraph run checkoutFlow --non-headless --video
every .branch() pathwaygraph run checkoutFlow --all-branches
the same flow two ways, side by sidewaygraph run checkoutFlow --compare device=desktop,mobile (as=a,b, config=a,b; Split view)
a flow with panes in windows, a video per panewaygraph demo approvalFlow --split windows · --video --video-panes
a JSON reportWAYGRAPH_JSON=1 waygraph run checkoutFlow
Data flagDoes
--data '{"saucedemo.credentials":{…}}'seeds mem by key name
--input '{…}' · --input @cases.jsonthe flow's input; an array plays it once per item
--replay <runId>the mem a past run was seeded with (a per-run value, from unique, made new)
--fresh-sessionsevery account signs in again: a saved session (an account with a ttl) isn't used, and the new one is saved (also on waygraph test)
--mem-stubfill missing keys from mem stubs, opted in or not
--no-expectrun each step's verify only, none of the expectations (expect: [...])
--env <mode> · --config <name>which .env / config file (Config)

Test ​

WantCommand
every flow as a testwaygraph test --flows [-g text] [--workers N] [--retries N]
the project's specswaygraph test [...playwright args]
Playwright's UI modewaygraph test ui
the HTML report · a tracewaygraph test report · waygraph test show-trace <trace.zip>
crawl every edgewaygraph traverse --parallel N --min-edge-coverage 80%

More: Testing.

Explore and drive ​

WantCommand
pick Blocks by handwaygraph auto (browser panel) · waygraph auto --cli (terminal)
find a route and play itwaygraph auto --blocks LoginPage OrderComplete
start a session for an agentwaygraph pilot start · waygraph browser start [--headless] [--goto <url>]
list · stop sessionswaygraph browser sessions [--json] · waygraph browser stop <id> / --all
the menu · run one pickwaygraph pilot status <id> · waygraph pilot send <id> "<index or Block name>"
go to a Checkpointwaygraph pilot reach <id> <Checkpoint>
what the page showswaygraph pilot read <id> [path] [--where field=value] [--rows 20:40]
the DOMwaygraph pilot dom <id> [--mode full] [--selector s] [--depth n]
history · errors · storagewaygraph pilot trace <id> · console <id> · storage <id>
stream it livewaygraph pilot watch <id>
re-detect where it iswaygraph pilot resync <id>
paint ringswaygraph pilot highlight <id> "#x|Label|tone; .y|Label2" (or JSON)
act with no Blockwaygraph auto click <id> <sel> · type <id> <sel> <text> · goto <id> <url>
load new Block fileswaygraph auto reload <id>
reattach a terminalwaygraph browser attach <id>

auto, browser and pilot reach the same session by the same id. More: Agents, Pilot.

Inspect the project ​

WantCommand
lint Blockswaygraph check (warnings only)
what a run's HTTP calls say about its pageswaygraph check --network <runId|latest>: the same GET twice, one route with many ids (N+1), slow (> 1 s), large (> 100 KB), uncached, failed calls, too many at once
tsc --noEmit, then the lintwaygraph typecheck [--no-practices]
folders match URLswaygraph map (exits 1 on a mismatch)
pack a map groupwaygraph map pack <group> [--out dir] [--name pkg] [--version x.y.z]
the graphwaygraph graph [--mermaid]
generate a page, Method, flow, keys, account`waygraph gen <page
a typo in a page name (to, covers, from)waygraph check / waygraph typecheck name the page that doesn't exist and the one you probably meant
everything as JSONwaygraph manifest [--out file] (Run log and manifest)
the project in the browser: map, flows, runs, play a flowwaygraph studio [project] [--port N] (Waygraph Studio)

Set up and update ​

WantCommand
a new projectwaygraph init my-app
try Sauce Demo in a temp folderwaygraph try demo · try auto · try auto:cli
update scaffold fileswaygraph upgrade [paths] [--apply] [--overwrite] [--diff]
refresh agent skillswaygraph upgrade --skills
rewrite removed codewaygraph upgrade --codemod keys (also flows, checkpoints, lands, ff, chain, pages, expect)
see what waygraph detects: config, base URL, counts, labels, regression setswaygraph info (--verbose lists the flows, Blocks and variables; --json)
run every flow as a test (the regression set)waygraph test (--specs for Playwright spec files)
run a group of flowswaygraph test --label auth
another regression set, or one run's include / excludewaygraph test --regression nightly, --include smoke, --exclude flaky
run everything, what the regression set leaves out toowaygraph test --all
set up what the config requires on this machine (browsers, extensions, the demo's voice, .env entries)waygraph install [--update] [--with-deps]
coding-agent fileswaygraph agent-dive --loop claude (also opencode, cursor, vscode)
print a skillwaygraph --skill · --skill-pilot · --skill-pilot-blind · --skill-convention

waygraph --help prints every flag.

Recipes ​

Detect / drive the surviving tab after a run ​

The default run closes the page it opened, and a page you hand in via options.page survives. For a flow that must BE the surviving tab after it returns (an interactive demo, a hand-back to a caller), ask for the page back explicitly:

typescript
const { result, page } = await registerFlow.run(context, mem, { closeOnFinish: false });
// `result.__state` reached the terminal Checkpoint; `page` is still open where the
// flow left it - the caller keeps driving it, and closes it whenever IT is done.

Capture a popup (target=_blank click) ​

Frameworks and email UIs routinely rewrite links to target="_blank", so a click that "should navigate" actually opens a second, engine-invisible tab. Until a second real use case promotes this to an engine API, capture it in userland with a context-level page event armed before the click that is expected to open exactly one popup:

typescript
let popup: Page | undefined;
context.once("page", (p) => { popup = p; });
await linkHandle.click();          // the block that causes the popup (e.g. the
                                    // MailHog email's real verify link)
if (popup) {
  await popup.waitForLoadState();  // fully loaded before calling into the engine
  await verifyLinkFlow.run(context, mem, { page: popup, closeOnFinish: false });
  // popup is now the caller's page - close it when done, or leave it as the
  // surviving tab of a demo.
}

context.once (not .on) guarantees a second stray popup won't re-fire the handler and clobber your handle; if a page truly can open more than one popup, this recipe needs to collect them instead. The popup is a normal Playwright Page from the same context, so anything Flow.run(context, mem, { page }) can drive is available to keep driving here, and closeOnFinish: false hands it back into your ownership instead of the run closing it out from under you.

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed