本文へスキップ
Skillpedia
Webスクレイピング29k · #9793

cmux-browser

できること

cmuxのコマンドラインでブラウザのペインを開き、そのページを読み取り、要素を操作し、情報を取り出す方法を説明します。cmuxを使っていて、エージェントにWebページを扱わせたい人向けです。

使う場面

  • ✓cmuxのブラウザペインでサイトを開き、データを取り出したいとき。
  • ✓cmuxの中のWebページに入力したり、クリックしたりする必要があるとき。
  • ✓次の手順に進む前に、ページの状態を確認したいとき。

スキルのリンク

https://github.com/manaflow-ai/cmux/blob/main/skills/cmux-browser/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/manaflow-ai/cmux/blob/main/skills/cmux-browser/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“このWebサイトの料金ページをcmuxで開き、プラン名と料金をコピーして教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントはブラウザのサーフェスを作成するか対象を指定し、ページの対話的なスナップショットを取ります。その後、必要な要素を読み取るかクリックします。正しいペインを対象にするため、サーフェスのハンドルを必ず明示的に渡します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Browser Automation with cmux

Read the CLI contract first

Check the binary that will actually run before giving an exact command:

cmux browser --help
cmux --version

There are two deliberately different command shapes:

  • Create a browser surface with open, open-split, or new. These commands may be workspace-scoped and do not need a surface handle.
  • Use an existing surface with every surface-bound navigation, inspection, interaction, tab, state, or diagnostic command. Pass the handle explicitly with --surface <handle> or as the first positional token.

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.

Find an existing browser surface without changing focus

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 url

For 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.

Core workflow

Open (or create) a surface without stealing focus, cap

よくある質問

私の画面を乗っ取りますか?

このスキルは、現在のウィンドウのフォーカスを奪わずに動くよう作られています。

エージェントはどの要素をクリックするかをどう判断しますか?

ページのスナップショットを取り、そのスナップショットの要素参照を使います。

コマンドの書式を知っておく必要がありますか?

いいえ。エージェントはインストールされたヘルプを読み、正しいコマンドの形を使います。

詳細

作者による元の説明

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.

repo: manaflow-ai/cmux

人気

GitHubのスター
29k
ランキング
#9793
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル