Browser automation CLI using Chrome DevTools Protocol

Synopsis

playwright-cli <command> [args...]

Description

A Playwright-compatible command-line interface for browser automation within SLICC. Uses BrowserAPI and Chrome DevTools Protocol (CDP) to control browser tabs — navigate, click, type, take screenshots, evaluate JavaScript, manage cookies and storage, and more. Operates on the browser tabs visible in the SLICC environment, automatically filtering out internal Chrome and SLICC app tabs.

Element references (e.g. e5) are obtained from the accessibility tree via the snapshot command and used with interaction commands like click, fill, and hover. Snapshots are automatically refreshed after state-changing commands. Session logs and snapshots are saved to /.playwright/ on the VFS.

Also available as playwright and puppeteer (aliases).

Commands

Navigation

open [url] [--foreground] [--runtime=<id>] Open a new tab (default: background)

goto|navigate <url> Navigate current tab to URL

go-back Navigate back

go-forward Navigate forward

reload Reload current tab

Interaction

click <ref> Click element by ref (e.g. e5)

dblclick <ref> Double-click element by ref

fill <ref> <text> Fill an input by ref with text

type <text> Type text into focused element

press <key> Press a keyboard key (e.g. Enter, Tab)

hover <ref> Hover over element by ref

select <ref> <value> Select value in a dropdown

check <ref> Check a checkbox or radio button

uncheck <ref> Uncheck a checkbox or radio button

drag <start> <end> Drag from one element to another

Inspection

snapshot Print accessibility tree with element refs

screenshot [--filename=path] [--max-width=N] [--fullPage=true] Take a screenshot

eval <expression> Evaluate JavaScript in the page

eval-file <path> [--output=<path>] Evaluate a JS file in the page

Tab Management

tab-list List open tabs

tab-new [url] [--foreground] Open a new tab

tab-close --tab=<id> Close a tab by target ID

resize <width> <height> Resize the viewport

Dialogs

dialog-accept [text] Accept a JavaScript dialog

dialog-dismiss Dismiss a JavaScript dialog

Cookies

cookie-list List all cookies

cookie-get <name> Get a cookie by name

cookie-set <name> <value> [--domain] [--path] [--secure] [--httpOnly] [--expires] Set a cookie

cookie-delete <name> [--domain] [--path] Delete a cookie

cookie-clear Clear all cookies

Storage

localstorage-list, localstorage-get, localstorage-set, localstorage-delete, localstorage-clear Manage localStorage

sessionstorage-list, sessionstorage-get, sessionstorage-set, sessionstorage-delete, sessionstorage-clear Manage sessionStorage

Recording

record [url] [--filter=<js-expr>] Open a tab with HAR recording

stop-recording <id> Stop recording and save HAR file

Teleport

teleport --start=<regex> --return=<regex> [--timeout=<s>] [--runtime=<id>] Arm auth-state teleport between leader and follower

teleport --off Disarm the active teleport watcher

teleport --list List available follower runtimes

Options

--help, -h Show help message

--tab=<id> Target a specific tab by ID (for commands that require it)

--foreground, --fg Open tabs in foreground instead of background

--runtime=<id> Open tabs on a remote tray runtime

--max-width=N Downscale screenshots wider than N pixels

--fullPage=true Capture full-page screenshots

--filename=<path> Save screenshot to a specific file path

Examples

$ playwright-cli open https://example.com

Open a URL in a new background tab.

$ playwright-cli snapshot

Print the accessibility tree with element references.

$ playwright-cli click e5

Click the element referenced as e5 in the snapshot.

$ playwright-cli fill e3 "hello world"

Fill an input field with text.

$ playwright-cli screenshot --max-width=1024

Take a screenshot downscaled to 1024px width.

$ playwright-cli eval "document.title"

Evaluate JavaScript and return the page title.

Notes

This is a browser-native automation tool using CDP, not a standalone Playwright installation. It operates on the same browser instance that SLICC runs in. The accessibility tree snapshot assigns refs (e.g. e1, e2) to interactive elements; these refs are used by click, fill, hover, and other interaction commands. Refs are invalidated after state-changing commands and a fresh snapshot is taken automatically.

The fill command includes a React-compatible fallback that uses the native value setter and dispatches synthetic input/change events. The teleport feature enables SSO authentication flows by routing auth pages through a follower runtime, capturing cookies and storage, and injecting them back into the leader tab.

See Also

node, commands