
Cmux Browser
- 5.9k installs
- 25.6k repo stars
- Updated August 5, 2026
- manaflow-ai/cmux
cmux-browser automates cmux webview browsers via CLI: open, snapshot refs, interact, wait, and extract data.
About
The cmux-browser skill automates browser tasks inside cmux webviews using the cmux CLI. Core workflow opens or targets a browser surface, verifies navigation with get url, snapshots with --interactive for element refs, acts via click fill type select press, waits for load or selectors, and re-snapshots after DOM changes. Surface targeting uses short refs like surface:N with optional workspace and window routing. Wait patterns cover selector, text, url-contains, load-state complete, and JavaScript function predicates similar to agent-browser. Form submit, input clear, and stable agent loop templates document navigate verify wait snapshot action cycles. References cover commands, snapshot ref lifecycle, authentication with state save load, session management, and proxy behavior in WKWebView. Limits note CDP-only features like viewport emulation, network mocking, and trace recording return not_supported; use supported high-level commands instead. Troubleshooting recovers js_error on snapshot via get text body or get html body fallbacks.
- Stable loop: open, get url, wait load complete, snapshot --interactive, act, re-snapshot.
- Surface refs surface:N with workspace and window targeting via cmux identify.
- Wait supports selector, text, url-contains, load-state, and JS function predicates.
- Authentication reference covers login OAuth 2FA and state save load patterns.
- WKWebView limits: no CDP viewport mock or trace; use click fill press scroll wait snapshot.
Cmux Browser by the numbers
- 5,883 all-time installs (skills.sh)
- +369 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #59 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
cmux-browser capabilities & compatibility
- Capabilities
- browser surface open and targeting · interactive snapshot with element refs · click fill type select press actions · multi pattern wait commands · authentication state save and load patterns
- Works with
- chrome
- Use cases
- web scraping · testing · orchestration
What cmux-browser says it does
Use this skill for browser tasks inside cmux webviews.
navigate -> verify -> wait -> snapshot -> action -> snapshot
npx skills add https://github.com/manaflow-ai/cmux --skill cmux-browserAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 5.9k |
|---|---|
| repo stars | ★ 25.6k |
| Security audit | 2 / 3 scanners passed |
| Last updated | August 5, 2026 |
| Repository | manaflow-ai/cmux ↗ |
How do I automate browser tasks in cmux with stable refs, waits, and form interaction?
Automate cmux browser surfaces: open pages, snapshot interactive refs, fill forms, wait for state, and extract data.
Who is it for?
Developers using cmux who need agent-guided browser automation inside webview surfaces.
Skip if: Skip when you need full Playwright CDP features like network mocking or trace recording in cmux.
When should I use this skill?
User needs cmux browser open, snapshot, fill, click, wait, or authenticated session automation.
What you get
Completed browser flows with verified URLs, fresh interactive snapshots, and extracted page data.
- Browser interaction traces
- Extracted page text or HTML
- Completed form or navigation flows
By the numbers
- Ref-based snapshot action loop
- 5 wait pattern types
- WKWebView CDP features not supported
Files
Browser Automation with cmux
Use this skill for browser tasks inside cmux webviews.
Core Workflow
1. Open or target a browser surface. 2. Verify navigation with get url before waiting or snapshotting. 3. Snapshot (--interactive) to get fresh element refs. 4. Act with refs (click, fill, type, select, press). 5. Wait for state changes. 6. Re-snapshot after DOM/navigation changes.
cmux --json browser open https://example.com
# use returned surface ref, for example: surface:7
cmux browser surface:7 get url
cmux browser surface:7 wait --load-state complete --timeout-ms 15000
cmux browser surface:7 snapshot --interactive
cmux browser surface:7 fill e1 "hello"
cmux --json browser surface:7 click e2 --snapshot-after
cmux browser surface:7 snapshot --interactiveSurface Targeting
# identify current context
cmux identify --json
# open routed to a specific topology target
cmux browser open https://example.com --workspace workspace:2 --window window:1 --jsonNotes:
- CLI output defaults to short refs (
surface:N,pane:N,workspace:N,window:N). - UUIDs are still accepted on input; only request UUID output when needed (
--id-format uuids|both). - Keep using one
surface:Nper task unless you intentionally switch.
Wait Support
cmux supports wait patterns similar to agent-browser:
cmux browser <surface> wait --selector "#ready" --timeout-ms 10000
cmux browser <surface> wait --text "Success" --timeout-ms 10000
cmux browser <surface> wait --url-contains "/dashboard" --timeout-ms 10000
cmux browser <surface> wait --load-state complete --timeout-ms 15000
cmux browser <surface> wait --function "document.readyState === 'complete'" --timeout-ms 10000Common Flows
Form Submit
cmux --json browser open https://example.com/signup
cmux browser surface:7 get url
cmux browser surface:7 wait --load-state complete --timeout-ms 15000
cmux browser surface:7 snapshot --interactive
cmux browser surface:7 fill e1 "Jane Doe"
cmux browser surface:7 fill e2 "jane@example.com"
cmux --json browser surface:7 click e3 --snapshot-after
cmux browser surface:7 wait --url-contains "/welcome" --timeout-ms 15000
cmux browser surface:7 snapshot --interactiveClear an Input
cmux browser surface:7 fill e11 "" --snapshot-after --json
cmux browser surface:7 get value e11 --jsonStable Agent Loop (Recommended)
# navigate -> verify -> wait -> snapshot -> action -> snapshot
cmux browser surface:7 get url
cmux browser surface:7 wait --load-state complete --timeout-ms 15000
cmux browser surface:7 snapshot --interactive
cmux --json browser surface:7 click e5 --snapshot-after
cmux browser surface:7 snapshot --interactiveIf get url is empty or about:blank, navigate first instead of waiting on load state.
Deep-Dive References
| Reference | When to Use |
|---|---|
| references/commands.md | Full browser command mapping and quick syntax |
| references/snapshot-refs.md | Ref lifecycle and stale-ref troubleshooting |
| references/authentication.md | Login/OAuth/2FA patterns and state save/load |
| references/authentication.md#saving-authentication-state | Save authenticated state right after login |
| references/session-management.md | Multi-surface isolation and state persistence patterns |
| references/video-recording.md | Current recording status and practical alternatives |
| references/proxy-support.md | Proxy behavior in WKWebView and workarounds |
Ready-to-Use Templates
| Template | Description |
|---|---|
| templates/form-automation.sh | Snapshot/ref form fill loop |
| templates/authenticated-session.sh | Login once, save/load state |
| templates/capture-workflow.sh | Navigate + capture snapshots/screenshots |
Limits (WKWebView)
These commands currently return not_supported because they rely on Chrome/CDP-only APIs not exposed by WKWebView:
- viewport emulation
- offline emulation
- trace/screencast recording
- network route interception/mocking
- low-level raw input injection
Use supported high-level commands (click, fill, press, scroll, wait, snapshot) instead.
Troubleshooting
js_error on snapshot --interactive or eval
Some complex pages can reject or break the JavaScript used for rich snapshots and ad-hoc evaluation.
Recovery steps:
cmux browser surface:7 get url
cmux browser surface:7 get text body
cmux browser surface:7 get html body- Use
get urlfirst so you know whether the page actually navigated. - Fall back to
get text bodyorget html bodywhensnapshot --interactiveorevalreturnsjs_error. - If the page is still failing, navigate to a simpler intermediate page, then retry the task from there.
interface:
display_name: "cmux Browser"
short_description: "Automate cmux webview surfaces with snapshot/ref workflows."
default_prompt: "Use this skill for browser automation via cmux CLI: identify target surface, snapshot interactive refs, perform actions, wait for state changes, and re-snapshot to avoid stale refs."
Authentication Patterns
Login flows, session persistence, OAuth, and 2FA patterns for cmux browser surfaces.
Related: session-management.md, SKILL.md
Contents
- Basic Login Flow
- Saving Authentication State
- Restoring Authentication
- OAuth / SSO Flows
- Two-Factor Authentication
- Cookie-Based Auth
- Token Refresh Handling
- Security Best Practices
Basic Login Flow
cmux browser open https://app.example.com/login --json
cmux browser surface:7 wait --load-state complete --timeout-ms 15000
cmux browser surface:7 snapshot --interactive
# [ref=e1] email, [ref=e2] password, [ref=e3] submit
cmux browser surface:7 fill e1 "user@example.com"
cmux browser surface:7 fill e2 "$APP_PASSWORD"
cmux browser surface:7 click e3 --snapshot-after --json
cmux browser surface:7 wait --url-contains "/dashboard" --timeout-ms 20000Saving Authentication State
After logging in, save state for reuse:
cmux browser surface:7 state save ./auth-state.jsonState includes cookies, localStorage, sessionStorage, and open tab metadata for that surface.
Restoring Authentication
cmux browser open https://app.example.com --json
cmux browser surface:8 state load ./auth-state.json
cmux browser surface:8 goto https://app.example.com/dashboard
cmux browser surface:8 snapshot --interactiveOAuth / SSO Flows
cmux browser open https://app.example.com/auth/google --json
cmux browser surface:7 wait --url-contains "accounts.google.com" --timeout-ms 30000
cmux browser surface:7 snapshot --interactive
cmux browser surface:7 fill e1 "user@gmail.com"
cmux browser surface:7 click e2 --snapshot-after --json
cmux browser surface:7 wait --url-contains "app.example.com" --timeout-ms 45000
cmux browser surface:7 state save ./oauth-state.jsonTwo-Factor Authentication
cmux browser open https://app.example.com/login --json
cmux browser surface:7 snapshot --interactive
cmux browser surface:7 fill e1 "user@example.com"
cmux browser surface:7 fill e2 "$APP_PASSWORD"
cmux browser surface:7 click e3
# complete 2FA manually in the webview, then:
cmux browser surface:7 wait --url-contains "/dashboard" --timeout-ms 120000
cmux browser surface:7 state save ./2fa-state.jsonCookie-Based Auth
cmux browser surface:7 cookies set session_token "abc123xyz"
cmux browser surface:7 goto https://app.example.com/dashboardToken Refresh Handling
#!/usr/bin/env bash
set -euo pipefail
STATE_FILE="./auth-state.json"
SURFACE="surface:7"
if [ -f "$STATE_FILE" ]; then
cmux browser "$SURFACE" state load "$STATE_FILE"
fi
cmux browser "$SURFACE" goto https://app.example.com/dashboard
URL=$(cmux browser "$SURFACE" get url)
if printf '%s' "$URL" | grep -q '/login'; then
cmux browser "$SURFACE" snapshot --interactive
cmux browser "$SURFACE" fill e1 "$APP_USERNAME"
cmux browser "$SURFACE" fill e2 "$APP_PASSWORD"
cmux browser "$SURFACE" click e3
cmux browser "$SURFACE" wait --url-contains "/dashboard" --timeout-ms 20000
cmux browser "$SURFACE" state save "$STATE_FILE"
fiSecurity Best Practices
1. Never commit state files (they include auth tokens). 2. Use environment variables for credentials. 3. Clear state/cookies after sensitive tasks:
cmux browser surface:7 cookies clear
rm -f ./auth-state.jsonCommand Reference (cmux Browser)
This maps common agent-browser usage to cmux browser usage.
Direct Equivalents
agent-browser open <url>->cmux browser open <url>agent-browser goto|navigate <url>->cmux browser <surface> goto|navigate <url>agent-browser snapshot -i->cmux browser <surface> snapshot --interactiveagent-browser click <ref>->cmux browser <surface> click <ref>agent-browser fill <ref> <text>->cmux browser <surface> fill <ref> <text>agent-browser type <ref> <text>->cmux browser <surface> type <ref> <text>agent-browser select <ref> <value>->cmux browser <surface> select <ref> <value>agent-browser get text <ref>->cmux browser <surface> get text <ref-or-selector>agent-browser get url->cmux browser <surface> get urlagent-browser get title->cmux browser <surface> get title
Core Command Groups
Navigation
cmux browser open <url> # opens in caller's workspace (uses CMUX_WORKSPACE_ID)
cmux browser open <url> --workspace <id|ref> # opens in a specific workspace
cmux browser <surface> goto <url>
cmux browser <surface> back|forward|reload
cmux browser <surface> get url|titleWorkspace context:browser opentargets the workspace of the terminal where the command is run (viaCMUX_WORKSPACE_ID), even if a different workspace is currently focused. Use--workspaceto override.
Snapshot and Inspection
cmux browser <surface> snapshot --interactive
cmux browser <surface> snapshot --interactive --compact --max-depth 3
cmux browser <surface> get text body
cmux browser <surface> get html body
cmux browser <surface> get value "#email"
cmux browser <surface> get attr "#email" --attr placeholder
cmux browser <surface> get count ".row"
cmux browser <surface> get box "#submit"
cmux browser <surface> get styles "#submit" --property color
cmux browser <surface> eval '<js>'Interaction
cmux browser <surface> click|dblclick|hover|focus <selector-or-ref>
cmux browser <surface> fill <selector-or-ref> [text] # empty text clears
cmux browser <surface> type <selector-or-ref> <text>
cmux browser <surface> press|keydown|keyup <key>
cmux browser <surface> select <selector-or-ref> <value>
cmux browser <surface> check|uncheck <selector-or-ref>
cmux browser <surface> scroll [--selector <css>] [--dx <n>] [--dy <n>]Wait
cmux browser <surface> wait --selector "#ready" --timeout-ms 10000
cmux browser <surface> wait --text "Done" --timeout-ms 10000
cmux browser <surface> wait --url-contains "/dashboard" --timeout-ms 10000
cmux browser <surface> wait --load-state complete --timeout-ms 15000
cmux browser <surface> wait --function "document.readyState === 'complete'" --timeout-ms 10000Session/State
cmux browser <surface> cookies get|set|clear ...
cmux browser <surface> storage local|session get|set|clear ...
cmux browser <surface> tab list|new|switch|close ...
cmux browser <surface> state save|load <path>Diagnostics
cmux browser <surface> console list|clear
cmux browser <surface> errors list|clear
cmux browser <surface> highlight <selector>
cmux browser <surface> screenshot
cmux browser <surface> download wait --timeout-ms 10000Agent Reliability Tips
- Use
--snapshot-afteron mutating actions to return a fresh post-action snapshot. - Re-snapshot after navigation, modal open/close, or major DOM changes.
- Prefer short handles in outputs by default (
surface:N,pane:N,workspace:N,window:N). - Use
--id-format bothonly when a UUID must be logged/exported.
Known WKWebView Gaps (not_supported)
browser.viewport.setbrowser.geolocation.setbrowser.offline.setbrowser.trace.start|stopbrowser.network.route|unroute|requestsbrowser.screencast.start|stopbrowser.input_mouse|input_keyboard|input_touch
See also:
- snapshot-refs.md
- authentication.md
- session-management.md
Proxy Support
How proxy behavior works for cmux browser automation.
Related: commands.md, SKILL.md
Contents
Current Behavior
cmux browser uses WKWebView networking. Proxy behavior follows macOS/system networking and app process environment.
What Is Not Exposed via CLI
There is currently no first-class cmux browser proxy ... command for per-surface proxy routing.
Why: WKWebView does not provide CDP-style per-context proxy controls equivalent to Chrome automation stacks.
Workarounds
1. Configure system/network-level proxy for the environment where cmux runs. 2. Route traffic through an upstream gateway you control. 3. Validate behavior with explicit IP checks.
Verification
cmux browser open https://httpbin.org/ip --json
cmux browser surface:7 get text bodyCompare returned IP against expected proxy egress.
Session Management
cmux uses isolated browser contexts per surface. Treat each browser surface as its own session.
Related: authentication.md, SKILL.md
Contents
Surface-Based Sessions
# session A
cmux browser open https://app.example.com/login --json
# -> surface:7
# session B
cmux browser open https://example.com --json
# -> surface:8
cmux browser surface:7 get url
cmux browser surface:8 get urlIsolation Properties
Each surface has independent:
- cookies
- localStorage/sessionStorage
- tab list and active tab
- navigation history
State Persistence
Save State
cmux browser surface:7 state save /tmp/auth-state.jsonLoad State
cmux browser surface:8 state load /tmp/auth-state.json
cmux browser surface:8 goto https://app.example.com/dashboardCommon Patterns
Reuse Auth Across New Surface
cmux browser open https://app.example.com/login --json
# login on surface:7 ...
cmux browser surface:7 state save /tmp/auth.json
cmux browser open https://app.example.com --json
# assume surface:8
cmux browser surface:8 state load /tmp/auth.json
cmux browser surface:8 goto https://app.example.com/dashboardParallel Multi-Site Tasks
cmux browser open https://site-a.example --json
cmux browser open https://site-b.example --json
cmux browser open https://site-c.example --json
cmux browser surface:11 get text body > /tmp/a.txt
cmux browser surface:12 get text body > /tmp/b.txt
cmux browser surface:13 get text body > /tmp/c.txtCleanup
cmux close-surface --surface surface:7
cmux close-surface --surface surface:8
rm -f /tmp/auth-state.jsonBest Practices
1. Name/log surfaces in your script output so actions stay attributable. 2. Keep one task per surface to avoid ref churn. 3. Save state after successful auth milestones. 4. Re-snapshot after switching tabs/pages inside a surface.
Snapshot and Refs
Element refs from snapshots make browser automation compact and reliable.
Related: commands.md, SKILL.md
Contents
How Refs Work
Classic flow:
full DOM/HTML -> selector guessing -> actioncmux flow:
snapshot -> refs (e1/e2/...) -> direct actionThe Snapshot Command
cmux browser surface:7 snapshot
cmux browser surface:7 snapshot --interactive
cmux browser surface:7 snapshot --interactive --compact --max-depth 3Using Refs
cmux browser surface:7 click e6
cmux browser surface:7 fill e10 "user@example.com"
cmux browser surface:7 fill e11 "password123"
cmux browser surface:7 click e12Ref Lifecycle
Refs are invalidated when page structure changes.
cmux browser surface:7 snapshot --interactive
# e1 is "Next"
cmux browser surface:7 click e1
# page changed, take a fresh snapshot
cmux browser surface:7 snapshot --interactiveBest Practices
1. Snapshot before interacting. 2. Re-snapshot after navigation/modal/open-close flows. 3. Use --snapshot-after on mutating actions. 4. Scope snapshots with --selector for very large pages.
Troubleshooting
not_found / stale ref
cmux browser surface:7 snapshot --interactiveElement missing due visibility/timing
cmux browser surface:7 wait --selector "#target" --timeout-ms 10000
cmux browser surface:7 scroll --dy 400
cmux browser surface:7 snapshot --interactiveToo many elements
cmux browser surface:7 snapshot --selector "form#checkout" --interactiveVideo Recording
Status and alternatives for capturing browser automation evidence in cmux.
Related: commands.md, SKILL.md
Contents
Current Status
cmux browser currently does not expose a built-in video recording command.
Why: cmux browser automation runs on WKWebView, and the agent-browser style recording pipeline is Chrome/CDP-specific.
Recommended Alternatives
1. Step Screenshots
cmux browser surface:7 screenshot > /tmp/step1.b64
cmux browser surface:7 click e3 --snapshot-after --json
cmux browser surface:7 screenshot > /tmp/step2.b642. Snapshot Timeline
cmux browser surface:7 snapshot --interactive > /tmp/snap-1.txt
cmux browser surface:7 click e3 --snapshot-after --json > /tmp/action-1.json
cmux browser surface:7 snapshot --interactive > /tmp/snap-2.txt3. macOS Window Capture (external)
Use an external screen recorder if full-motion capture is required.
Use Cases
- Debug flaky browser automation.
- Produce artifacts for CI logs.
- Document flow changes between releases.
Best Practices
1. Capture snapshot before and after each mutating action. 2. Add --snapshot-after on clicks/fills/types that change state. 3. Keep artifacts grouped by timestamp/run id.
#!/usr/bin/env bash
set -euo pipefail
SURFACE="${1:-surface:1}"
STATE_FILE="${2:-./auth-state.json}"
DASHBOARD_URL="${3:-https://app.example.com/dashboard}"
if [ -f "$STATE_FILE" ]; then
cmux browser "$SURFACE" state load "$STATE_FILE"
fi
cmux browser "$SURFACE" goto "$DASHBOARD_URL"
cmux browser "$SURFACE" get url
cmux browser "$SURFACE" wait --load-state complete --timeout-ms 15000
cmux browser "$SURFACE" snapshot --interactive
echo "If redirected to login, complete login flow then run:"
echo " cmux browser $SURFACE state save $STATE_FILE"
#!/usr/bin/env bash
set -euo pipefail
SURFACE="${1:-surface:1}"
OUT_DIR="${2:-./browser-artifacts}"
mkdir -p "$OUT_DIR"
TS="$(date +%Y%m%d-%H%M%S)"
cmux browser "$SURFACE" snapshot --interactive > "$OUT_DIR/snapshot-$TS.txt"
cmux browser "$SURFACE" screenshot > "$OUT_DIR/screenshot-$TS.b64"
echo "Wrote: $OUT_DIR/snapshot-$TS.txt"
echo "Wrote: $OUT_DIR/screenshot-$TS.b64"
#!/usr/bin/env bash
set -euo pipefail
URL="${1:-https://example.com/form}"
SURFACE="${2:-surface:1}"
cmux browser "$SURFACE" goto "$URL"
cmux browser "$SURFACE" get url
cmux browser "$SURFACE" wait --load-state complete --timeout-ms 15000
cmux browser "$SURFACE" snapshot --interactive
echo "Now run fill/click commands using refs from the snapshot above."
Related skills
How it compares
cmux-browser automates cmux WKWebView surfaces, not full Playwright CDP browser control.
FAQ
Who is cmux-browser for?
Developers automating cmux webview browsers through the cmux CLI with ref-based interaction.
When should I use cmux-browser?
When opening sites, filling forms, waiting for navigation, or extracting data from cmux browser surfaces.
Is cmux-browser safe to install?
Review the Security Audits panel; authentication flows may handle session state files.