cmux-architecture
cmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design discipline, testability, and Swift 6…
End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus.
$ npx -y skills add manaflow-ai/cmux --skill cmux-browser --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cmux-browserContext preview
The summary Claude sees to decide when to auto-load this skill.
End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus.
name: cmux-browser description: "End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus."
Check the binary that will actually run before giving an exact command:
cmux browser --help cmux --version
There are two deliberately different command shapes:
Prefer the flag form in scripts because it makes the target unmissable:
SURFACE="surface:7" # use a ref returned by discovery; do not guess an index cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" get-url # accepted alias cmux browser --surface "$SURFACE" snapshot --interactive cmux browser --surface "$SURFACE" snapshot -i # accepted alias cmux browser --surface "$SURFACE" url # accepted alias cmux browser --surface "$SURFACE" tab list cmux browser --surface "$SURFACE" click e1 --snapshot-after
The positional form is equivalent (`cmux browser "$SURFACE" get url`). `url` and `get-url` are accepted URL aliases, and the short interactive snapshot flag is accepted when a surface is already present; use `get url` and `snapshot --interactive` in new documentation so the target and operation are clear. Surface-bound operations have no unscoped form. The current CLI's explicitly global browser verbs (`open`, `open-split`, `new`, `identify`, `import`, `profile`, `profiles`, `react-grab`, `reactgrab`, `devtools`, `dev-tools`, `focus-mode`, `design-mode`, `zoom`, and `history`) may omit the handle and use caller/workspace routing; do not infer a target from visible focus for any other verb.
`identify`, `tree`, and list commands are read-only and do not select a workspace, pane, or browser. Do not infer that the visually focused surface is the one the user wants.
First inspect the caller context (useful for the default workspace):
cmux identify --json
To discover browser surfaces in the caller or another workspace/window, use the all-window tree. It includes parent refs, so a browser in a different workspace can be targeted directly without selecting that workspace:
cmux tree --all --json \
| jq -r '
.windows[]? as $window
| $window.workspaces[]? as $workspace
| $workspace.panes[]? as $pane
| $pane.surfaces[]?
| select(.type == "browser")
| [$window.ref, $workspace.ref, $pane.ref, .ref]
| @tsv'The filtered output is `window`, `workspace`, `pane`, and `surface` refs. Keep the `surface` ref, then target it explicitly:
SURFACE="surface:N" # copied from the filtered tree output cmux browser --surface "$SURFACE" get url cmux browser --surface "$SURFACE" snapshot --interactive
If the user gives a URL or title instead of a workspace/pane, match that metadata locally and emit only the unique surface ref. This never prints the matched URL or title:
MATCH_FIELD="url" # use "title" when matching a page title
MATCH_VALUE="${BROWSER_URL_OR_TITLE:?set BROWSER_URL_OR_TITLE without logging it}"
SURFACE="$(
cmux tree --all --json |
jq -r --arg field "$MATCH_FIELD" --arg value "$MATCH_VALUE" '
[
.windows[]? as $window
| $window.workspaces[]? as $workspace
| $workspace.panes[]? as $pane
| $pane.surfaces[]?
| select(.type == "browser")
| select((if $field == "url" then (.url // "") else (.title // "") end) == $value)
| .ref
] as $matches
| if ($matches | length) == 1 then $matches[0]
elif ($matches | length) == 0 then error("no matching browser surface")
else error("multiple matches; use workspace/pane context")
end'
)"
if [[ -z "$SURFACE" ]]; then
printf '%s\n' 'no uniquely matching browser surface; provide workspace/pane context' >&2
exit 1
fi
cmux browser --surface "$SURFACE" get urlFor one known workspace, `cmux --json list-pane-surfaces --workspace <workspace>` is a smaller read-only query. Raw tree/list payloads can contain page URLs and titles; filter or redact them before logging or pasting them. Never use a focus/select command merely to discover a surface.
Open (or create) a surface without stealing focus, capture the returned ref, then use that ref for every existing-surface operation:
OPEN_JSON="$(cmux --json browser open https://example.com --focus false)"
SURFACE="$(printf '%s' "$OPEN_JSON" | jq -r '.surface_ref // .surface_id // empty')"
[ -n "$SURFACE" ] || { printf '%s\n' 'browser open did not return a surface ref' >&2; exit 1; }
cmux browser --surface "$SURFACE" get url
cmux browser --surface "$SURFACE" wait --load-state complete --timeout-ms 15000
cmux browser --surface "$SURFACE" snapshot --interactive
cmux browser --surface "$SURFACE" fill e1 "hello"
cmux browser --surface "$SURFACE" click e2 --snapshot-after
cmux browser --surface "$SURFACE" snapshot --interactiveAfter a browser download finishes, inspect the same surface's bounded history without opening the file or consuming a waiter:
cmux browser --surface "$SURFACE" download list cmux browser --surface "$SURFACE" download list --limit 5 --json
The JSON records expose the stable `download_id`, filename, actual saved path when known, status (`downloading`, `saved`, or `failed`), byte count when known, and whether a known path still exists. Listing is newest first and repeatable; it remains scoped to the requested surface. Use `download wait` to keep the existing event-wait
Open source Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents. Built for multitasking, organization, and programmability.
Repo: manaflow-ai/cmux
cmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design discipline, testability, and Swift 6…
Backend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM lifecycle, provider…
Stripe checkout, pricing, subscription, Pro plan, webhook, and entitlement runbook for cmux billing work. Use when editing or debugging billing, pricing,…
Route work to cmux Cloud machines from the plain `cmux vm` CLI (alias `cmux cloud`): route/run/agent pick a machine, `vm tree` and `surface ls` catalog This…
Use only after the user explicitly asks for Computer Use: drive real macOS apps from a cmux agent session via the bundled engine (accessibility tree +…
Build a custom cmux sidebar from a plain-language request. Use when the user asks for a custom sidebar, a sidebar that shows their workspaces/tabs/PRs/clock, a…