cua
为 Computer-Use Agent 提供完整基础设施的开源项目,包含沙箱、SDK、基准测试和 macOS 虚拟机管理工具,支持在后台驱动原生应用而无需抢占光标。亮点在于统一的 API 屏蔽不同操作系统差异,并提供云端和本地运行选项,配合 CuaBench 可标准化评估 agent 桌面操控能力。
README
构建、测试和部署使用计算机的 agent
选择你的路径
|
||
|
|
|
Cua Driver - 在 macOS 上后台使用计算机
在后台驱动任何原生 macOS 应用——agent 可以点击、输入和验证,无需抢占光标、焦点或 Space,甚至在 Chromium 网页内容、基于 canvas 的工具(如 Blender、Figma、DAW、游戏引擎)等非 AX 界面也能正常工作。与 CLI 或 MCP server 配合使用,集成 Claude Code、Cursor 和自定义客户端。每次会话都会记录为可回放的轨迹(replayable trajectory)。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"
完整的工具参考、架构说明以及 Claude Code 技能包随包一同提供:libs/cua-driver/README.md
Cua - 面向任意 OS 的 Agent 就绪沙箱
构建能看屏幕、点击按钮并自主完成任务 agent。同一个 API 支持任意 VM 或容器镜像——云端或本地。
pip install cua
# Requires Python 3.11 or later
from cua import Sandbox, Image
# Same API regardless of OS or runtime
async with Sandbox.ephemeral(Image.linux()) as sb: # or .macos() .windows() .android()
result = await sb.shell.run("echo hello")
screenshot = await sb.screenshot()
await sb.mouse.click(100, 200)
await sb.keyboard.type("Hello from Cua!")
await sb.mobile.gesture((100, 500), (100, 200)) # multi-touch gestures
| Linux 容器 | Linux VM | macOS | Windows | Android | BYOI (.qcow2, .iso) | |
|---|---|---|---|---|---|---|
| 云端 (cua.ai) | ✅ | ✅ | ✅ | ✅ | ✅ | 🔜 即将支持 |
| 本地 (QEMU) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
CuaBot - 任意 agent 的协作计算机使用
cuabot 为任意编码 agent 提供无缝的计算机使用沙箱。独立的窗口以 H.265 原生显示在你的桌面上,支持共享剪贴板和音频。
npx cuabot # 设置引导
# 在沙箱中运行任意 agent
cuabot claude # Claude Code
cuabot openclaw # 沙箱中的 OpenClaw
# 在沙箱中运行任意 GUI 工作流
cuabot chromium
cuabot --screenshot
cuabot --type "hello"
cuabot --click <x> <y> [button]
内置对 agent-browser 和 agent-device(iOS、Android)的开箱即用支持。

Cua-Bench - 基准测试与强化学习环境
在 OSWorld、ScreenSpot、Windows Arena 和自定义任务上评估计算机使用 agent。导出轨迹用于训练。
# 安装并创建基础镜像
cd cua-bench
uv tool install -e . && cb image create linux-docker
# 使用 agent 运行基准测试
cb run dataset datasets/cua-bench-basic --agent cua-agent --max-parallel 4
Lume - macOS 虚拟化
在 Apple Silicon 上使用 Apple Virtualization.Framework 创建和管理接近原生性能的 macOS/Linux VM。
# 安装 Lume
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
# 拉取并启动 macOS VM
lume run macos-sequoia-vanilla:latest
包列表
| 包 | 描述 |
|---|---|
| cuabot | 多 agent 计算机使用沙箱 CLI |
| cua-agent | 用于计算机使用任务的 AI agent 框架 |
| cua-sandbox | 创建和控制沙箱的 SDK |
| cua-computer-server | 沙箱中 UI 交互和代码执行的驱动程序 |
| cua-bench | 计算机使用的基准测试和强化学习环境 |
| lume | Apple Silicon 上的 macOS/Linux VM 管理 |
| lumier | 与 Docker 兼容的 Lume VM 接口 |
资源
- 文档 — 指南、示例和 API 参考
- 博客 — 教程、更新和研究
- Discord — 社区支持与讨论
- GitHub Issues — 报告 bug 和功能请求
贡献
我们欢迎贡献!详细信息请参阅我们的贡献指南。
许可证
MIT 许可证 — 详见 LICENSE。
第三方组件有其自己的许可证:
- Kasm (MIT)
- OmniParser (CC-BY-4.0)
- 可选的
cua-agent[omni]包含 ultralytics (AGPL-3.0)
商标
Apple、macOS、Ubuntu、Canonical 和 Microsoft 是其各自所有者的商标。本项目与这些公司不存在隶属关系或认可关系。
感谢所有 GitHub 赞助者!
