MCPInstall

computer-use

通过截图、鼠标和键盘操作 macOS 原生应用。仅在任务无法通过 API、专用 Skill 或文件工具完成,需要真实桌面交互时使用。网页任务优先使用浏览器工具,文件读写和代码执行使用对应工具;不擅自扩大屏幕访问范围。

Installs
71
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/oil-oil/computer-use-skill --skill computer-use
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads computer-use automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Computer Use(macOS)

工具组合:screencapture + cliclick + osascript + Swift CGEvent(滚动)

先确认是否真的需要本 skill:

  • 操作网页/浏览器 → 用 agent-browser skill,更稳定、更省 token
  • 读写文件、调用 API、执行脚本 → 直接用内置工具
  • 只有目标是无 API 可用的本地 GUI App(微信、飞书、Figma 等原生应用)时,才继续往下走

第一步:运行初始化脚本(每次任务开始执行一次)

bash <skill_dir>/scripts/init.sh

初始化输出独立工具目录。将输出中的路径记录为 CU_DIR;每个任务使用自己的目录,结束后只清理该任务目录。依赖或屏幕几何读取失败时停止,绝不猜缩放系数。

初始化做了三件事:

  1. 检测 Retina 缩放因子,写入 "$CU_DIR"/_cu_scale
  2. 编译 Swift CGEvent 滚动工具到 "$CU_DIR"/_cu_scroll
  3. 安装截图辅助脚本 "$CU_DIR"/_cu_snap.sh,并打印当前可见进程名

初始化后可用的命令:

命令作用
"$CU_DIR"/_cu_snap.sh out.png截全屏(自动缩到逻辑分辨率)
"$CU_DIR"/_cu_snap.sh out.png W H x y截图后裁剪到 W×H 区域(节省 token)
"$CU_DIR"/_cu_scroll x y amount滚动(amount < 0 向下,> 0 向上)
cat "$CU_DIR"/_cu_scale读取缩放因子

临时目录可能被系统清理,工具失效时重新初始化。多显示器跨屏操作前需分别核对坐标映射;当前辅助脚本不证明任意跨屏坐标正确。


感知-行动循环

1. _cu_snap 截图 → Read 读取
   └─ 优先裁剪到目标区域:只截需要看的部分,大幅减少 token 消耗
2. 定位目标
   └─ 优先:AX 元素名(osascript)
   └─ 其次:截图坐标(cu_snap 输出已是逻辑坐标,直接用于 cliclick)
3. 执行操作
4. sleep 0.3~1.5s 等渲染 → 再截图确认
5. 重复直到完成

截图

"$CU_DIR"/_cu_snap.sh /tmp/s.png              # 全屏
"$CU_DIR"/_cu_snap.sh /tmp/s.png 900 600 0 300  # 裁剪:宽900 高600 从(x=0,y=300)开始

未裁剪、未额外缩放的主屏截图坐标可直接作为逻辑坐标。裁剪后必须把裁剪起点加回:屏幕坐标 = 图内坐标 + (x_offset, y_offset)。例如裁剪起点 (0, 300)、图内目标 (40, 50),点击应为 (40, 350)。多屏或宿主再次缩放图片时,先核对显示器原点与缩放比例,不能套用主屏坐标。


鼠标操作

cliclick c:960,490     # 单击
cliclick dc:960,490    # 双击
cliclick rc:960,490    # 右键
cliclick p             # 打印当前坐标(调试)

⚠️ cliclick dd:x,y 是开始拖拽,不是滚动。


滚动

# 向下滚到底部
for i in $(seq 1 8); do "$CU_DIR"/_cu_scroll 750 400 -20; sleep 0.05; done

# 向上滚
"$CU_DIR"/_cu_scroll 750 400 5

⚠️ 聊天类 App(飞书、微信、Slack)的输入框会抢占键盘焦点, End / PageDown 键会打字到输入框里。必须用 _cu_scroll,不能用键盘。


输入文字

# 英文
osascript -e 'tell application "System Events" to tell process "AppName" to keystroke "hello"'

# 中文(直接 keystroke 会乱码,必须走剪贴板)
echo -n "你好世界" | pbcopy
osascript -e 'tell application "System Events" to tell process "AppName" to keystroke "v" using command down'

按键

cliclick kp:return   kp:esc   kp:tab   kp:delete   kp:arrow-down   kp:page-down

激活应用

osascript -e 'tell application "Feishu" to activate'
sleep 0.8

进程名必须用系统名,初始化时已打印进程列表。常见易错对:

  • 飞书 → Feishu(不是 Lark)
  • 微信 → WeChat

⚠️ 不要用 set frontmost to true——会报错 -10006。 activate 已足够,如需置前可加 set bounds of front window to {…}。


点击 UI 元素(比坐标更准)

比截图估坐标更可靠的方式:通过 Accessibility 元素名直接点击。

# 按名称点击按钮
osascript -e 'tell application "System Events" to tell process "App" to click button "OK" of window 1'

# 先查有哪些可点元素
osascript -e 'tell application "System Events" to tell process "App" to get every UI element of window 1'

等待窗口就绪

osascript << 'EOF'
tell application "App" to activate
tell application "System Events"
    tell process "App"
        set w to 0
        repeat until (count of windows) > 0 or w > 10
            delay 0.3
            set w to w + 0.3
        end repeat
    end tell
end tell
EOF

FAQ

What does the computer-use skill do?

通过截图、鼠标和键盘操作 macOS 原生应用。仅在任务无法通过 API、专用 Skill 或文件工具完成,需要真实桌面交互时使用。网页任务优先使用浏览器工具,文件读写和代码执行使用对应工具;不擅自扩大屏幕访问范围。

How do I install computer-use?

Run npx skills add https://github.com/oil-oil/computer-use-skill --skill computer-use in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/computer-use/ (personal) or .claude/skills/computer-use/ (project).

Which AI agents can use computer-use?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is computer-use safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains computer-use?

It is published by oil-oil in oil-oil/computer-use-skill. It has 71 recorded installs.

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs