Skip to main content

Command Reference

se-cli ships with commands grouped into nine categories. Session-level commands run in the CLI process; the rest are forwarded to the daemon. Pick a tab to browse each group.

Session

CommandDescription
open [url]Start daemon + browser, optionally navigate to URL
closeClose browser and daemon
close --allClose every session across all projects
sessionsList all sessions across all projects (live/dead)
listList all sessions
close-allClose all sessions gracefully
kill-allForce-kill all sessions
logs [--tail=N]Tail this session's daemon + CLI log files (default 50 lines)
mcp-server [--http] [--port=N]Start the MCP server (stdio default; Streamable HTTP with --http) (v0.9)
CommandDescription
goto <url>Navigate to URL
go-backBrowser back
go-forwardBrowser forward
reloadReload page

Interaction

CommandDescription
click <ref&vert;selector>Click element
fill <ref&vert;selector> <text>Clear and fill input
type <text>Type into focused element
press <key>Press keyboard key (Enter, Tab, Escape, …)
select <ref> <value>Select dropdown option
check <ref>Check checkbox
uncheck <ref>Uncheck checkbox
hover <ref>Mouse hover over element (v0.5)
dblclick <ref>Double-click element (v0.5)
drag <start> <end>Drag and drop element (v0.5)
dialog-accept [text]Accept alert/confirm/prompt dialog (v0.5)
dialog-dismissDismiss dialog (v0.5)
upload <ref> <file>Upload file to input element (v0.5)
resize <w> <h>Set viewport size (v0.5)
keydown <key>Press and hold key (v0.5)
keyup <key>Release held key (v0.5)
mousemove <x> <y>Move mouse to coordinates (v0.5)
mousedown [button]Press mouse button (left/right/middle) (v0.5)
mouseup [button]Release mouse button (v0.5)
mousewheel <dx> <dy>Scroll wheel by offsets (v0.5)
actions-chain <json>Chain multiple actions in one perform() (v0.5)

v0.5 shipped. All interaction commands consume the v0.4 wait/retry configuration. Use actions-chain to batch multiple steps into a single round-trip.

Snapshot

CommandDescription
snapshot [ref]Aria snapshot of page or element subtree
snapshot --depth=NLimit snapshot depth
snapshot --filename=f.ymlSave snapshot to file
find <text>Search snapshot for text
find --regex <pattern>Search snapshot with regex

Save & Execute

CommandDescription
screenshot [ref]Take screenshot (full page or element)
screenshot --filename=f.pngSave screenshot to file
eval "<js>"Execute JavaScript, return result
eval "<js>" <ref>Execute JavaScript on element
run-code "<snippet>"Execute arbitrary Selenium snippet (receives driver; v0.9)
generate-locator <ref>Recommended locator with match counts (v0.9)
titleGet page title
urlGet current URL

Storage

CommandDescription
cookie-listList all cookies for the current page
cookie-get <name>Get a single cookie by name
cookie-set <name> <value>Add or overwrite a cookie
cookie-delete [name]Delete a cookie by name (omit to delete all)
localstorage-get <key>Read a localStorage value
localstorage-set <key> <val>Write a localStorage value
localstorage-delete <key>Delete a localStorage value
localstorage-deleteClear all localStorage (omit key)
sessionstorage-get/set/delete/listSame family for sessionStorage
sessionstorage-deleteClear all sessionStorage (omit key)
state-save [--filename=f]Export cookies + storage to JSON
state-load [--filename=f]Restore cookies + storage from JSON

Tabs

CommandDescription
tab-listList all open tabs/windows in the session
tab-new [url]Open a new tab, optionally navigate to URL
tab-closeClose the current tab
tab-select <index>Switch to a tab by 0-based index

Config

CommandDescription
config get <key>Show a config value and its source
config set <key> <value>Write a value to the config file
config listList all settings with source (flag/env/file/default)
config initGenerate a template config file

v0.4. See the Configuration page for the 4-tier priority system and wait/retry flags.

Assertions (v0.6)

CommandDescription
expect <ref> visibleAssert element is visible (exit 0/1)
expect <ref> hiddenAssert element is hidden
expect <ref> enabledAssert element is enabled
expect <ref> disabledAssert element is disabled
expect <ref> checkedAssert checkbox is checked
expect <ref> uncheckedAssert checkbox is unchecked
expect <ref> text "..."Assert element text (substring match)
expect <ref> value "..."Assert input value
expect <ref> count NAssert matching element count
expect <ref> attribute <name> <value>Assert attribute value
expect title "..."Assert page title
expect url "..."Assert page URL
--notInvert assertion (e.g. expect NOT visible)
--exactStrict match instead of substring
--timeout=<ms>Polling timeout (default 5000ms)

Network & Debug (v0.7)

CommandDescription
highlight <ref>Outline element with persistent CSS overlay (default: 3px solid red) (v0.7)
highlight <ref> --style="2px solid blue"Custom CSS outline style (v0.7)
highlight <ref> --hideRemove highlight from a specific element (v0.7)
highlight --hide --allRemove all highlights (v0.7)
highlightList all active highlights (no args) (v0.7)
consoleAll buffered console messages since session start (v0.7)
console errorFilter by level: error, warning, info, verbose (v0.7)
console js-errorShow only JavaScript exceptions (v0.7)
console --since=5mMessages from the last 5 minutes (30s, 1h, ...) (v0.7)
console --clearClear the console buffer after output (v0.7)
requestsList all buffered network requests (v0.7)
requests --filter="api"Filter requests by URL substring (v0.7)
requests --status=500Filter by HTTP status code (v0.7)
requests --method=POSTFilter by HTTP method (v0.7)
requests --clearClear the network request buffer (v0.7)
request <index>Show full request details (headers, body, response) (v0.7)
route <pattern> --status=401Register a mock response for matching URLs via BiDi (v0.7)
route <pattern> --body='{"error":"..."}'Mock with custom response body (v0.7)
route <pattern> --headers='{"X-Custom":"val"}'Mock with custom response headers (v0.7)
route-listList all active route intercepts (v0.7)
unroute <index>Remove a specific route intercept (v0.7)
unroute --allRemove all route intercepts (v0.7)

v0.7 shipped. Network interception and console capture use the Selenium BiDi protocol (log.entryAdded, Network.addIntercept). The highlight command is pure JS injection and works on all browsers — no BiDi required. BiDi listeners initialize lazily on first use of any network/debug command.

Emulation (v0.8)

CommandDescription
device <name>Apply a device preset (viewport + UA + deviceScaleFactor + touch) (v0.8)
device-listList all built-in device presets (v0.8)
emulateShow current emulation state (v0.8)
emulate --offlineGo offline (v0.8)
emulate --throttle-network=<profile>Throttle network: slow3g|fast3g|gprs|custom:download=,upload=,latency= (v0.8)
emulate --throttle-cpu=<rate>CPU slowdown rate, e.g. 4 (v0.8)
emulate --resetRestore runtime emulation (keeps open-time flags) (v0.8)
open --viewport=<WxH>Page viewport size, e.g. 1280x720 (v0.8)
open --user-agent=<ua>Override the browser user agent (v0.8)
open --locale=<tag>Override page locale, e.g. zh-CN (v0.8)
open --color-scheme=<light|dark>Emulate prefers-color-scheme (v0.8)
open --timezone=<id>Override timezone, e.g. America/New_York (v0.8)
open --geolocation=<lat,lon[,accuracy]>Override geolocation (v0.8)
open --permissions=<list>Grant permissions, e.g. geolocation,camera (v0.8)

v0.8 shipped. Emulation uses CDP (Emulation.*, Network.*, Browser.*) on Chrome/Edge; Firefox supports viewport via WebDriver BiDi. Open-time flags are replayed automatically if the driver rebuilds.

Flags

FlagDescription
--rawOutput only the result value (for scripting)
--jsonStructured JSON output
-s=<name>Use named session
--browser=chrome|edge|firefoxBrowser selection (default: auto-detect Edge → Chrome → Firefox)
--headedShow browser window (default: headless)
--cdp=<url>Attach to running Chrome via CDP
--profile=<path>Persistent user data directory (v0.2)
--persistentAuto-assign a persistent userDataDir (v0.2)
--depth=<N>Limit aria snapshot recursion (default: 50)
--filename=<f>Save snapshot/screenshot to file
--regex=<pattern>Search snapshot with regex (find)
--submitSubmit form after fill (Enter key)
--timeout=<ms>Per-command explicit-wait timeout (v0.4, default 5000)
--wait=<state>Wait condition: visible|hidden|enabled|disabled|stable|attached|none|auto (v0.4)
--retry=<n>Failure retry count, -1 = until timeout (v0.4)
--retry-interval=<ms>Polling interval for retries (v0.4, default 100)
--implicit-wait=<ms>Driver implicit wait (v0.4)
--page-load-timeout=<ms>driver.manage().timeouts().pageLoadTimeout() (v0.4)
--script-timeout=<ms>setScriptTimeout for async eval (v0.4)
--no-waitShorthand for --wait=none --timeout=0 (v0.4)
--notInvert assertion (v0.6)
--exactStrict match for assertions (v0.6)
--style="..."Custom CSS outline for highlight (v0.7)
--hideRemove highlight from element(s) (v0.7)
--allApply to all highlights or routes (v0.7)
--since=<duration>Time filter for console (e.g. 5m, 30s, 1h) (v0.7)
--clearClear buffer after output (console/requests) (v0.7)
--filter="..."Filter requests by URL substring (v0.7)
--status=<code>Filter/mock HTTP status code (v0.7)
--method=<VERB>Filter requests by HTTP method (v0.7)
--body='...'Mock response body for route (v0.7)
--headers='{"k":"v"}'Mock response headers for route (v0.7)
--viewport=<WxH>Page viewport size, e.g. 1280x720 (v0.8)
--user-agent=<ua>Override the browser user agent (v0.8, Chrome/Edge)
--locale=<tag>Override page locale, e.g. zh-CN (v0.8, Chrome/Edge)
--color-scheme=<light|dark>Emulate prefers-color-scheme (v0.8, Chrome/Edge)
--timezone=<id>Override timezone, e.g. America/New_York (v0.8, Chrome/Edge)
--geolocation=<lat,lon[,accuracy]>Override geolocation (v0.8, Chrome/Edge)
--permissions=<list>Grant permissions, e.g. geolocation,camera (v0.8, Chrome/Edge)

Output formats

Every command returns a response with up to four sections: Page, Snapshot, Ran Selenium code, and Result. --raw returns only the result value; --json returns a structured {page, snapshot, code, result} object for pipelines.

### Page
- Page URL: https://example.com/
- Page Title: Example Domain

### Snapshot
- e1 [heading "Welcome"]
- e2 [link "Learn more"]

### Ran Selenium code
await driver.findElement(By.css('[data-se-ref="e2"]')).click();

### Result
clicked

See the Snapshots & Refs guide for the algorithm behind snapshot, or the Configuration page for the v0.4 wait/retry flags.