English | 简体中文
AUV 意为 **Application Use Via ...**。 - Apple Music Application Use Via [`auv-apple-music`](https://github.com/moeru-ai/auv/tree/main/supported/apps/auv-apple-music)…… - macOS Media Control Use Via [`auv-media-macos`](https://github.com/moeru-ai/auv/tree/main/crates/auv-media-macos)…… - [Balatro](https://www.playbalatro.com/)(没错,就是那个游戏 [Balatro](https://www.playbalatro.com/))Application Use Via [`auv-game-balatro`](https://github.com/moeru-ai/auv/tree/main/supported/games/auv-game-balatro)…… - …… 还有更多,等着你来实现。 > 把它理解成:可编程的 computer use,但不需要 agent。 ## 目录 - [快速开始](#快速开始) - [理解 AUV](#理解-auv) - [为什么要做 AUV?](#为什么要做-auv) - [能力矩阵](#能力矩阵) - [开发](#开发) - [相关项目](#相关项目) - [致谢](#致谢) - [特别感谢](#特别感谢) - [Star History](#star-history) - [许可证](#许可证) ## 快速开始 ### 安装 安装预编译发行版: #### macOS ```sh brew install moeru-ai/tap/auv auv --version ``` 不使用 [Homebrew](https://brew.sh/) 时,也可以: ```sh curl -fsSL https://auv.moeru.ai/install.sh | sh ``` #### Linux ```sh curl -fsSL https://auv.moeru.ai/install.sh | sh auv --version ``` > [!NOTE] > > 设置 `AUV_VERSION` 或 `AUV_INSTALL_DIR` 可以修改发行版本或安装目录(默认:`~/.local/bin`)。 > > glibc 版的 Linux 发行包是完整包:自带 AUV 私有的原生库、这些库需要的 PipeWire > 客户端文件和英文 Tesseract 模型,需要 glibc 2.36 或更新的系统(例如 Debian 12 > 或 Ubuntu 24.04)。其他 OCR 语言可以通过 `TESSDATA_PREFIX` 提供。目前不支持 > Linux musl。 #### Windows ##### Scoop ```powershell scoop bucket add auv https://github.com/moeru-ai/auv scoop install auv/auv auv --version ``` ##### 手动安装 下载对应架构的压缩包: - [x86-64](https://github.com/moeru-ai/auv/releases/latest/download/auv-x86_64-pc-windows-msvc.zip) - [ARM64](https://github.com/moeru-ai/auv/releases/latest/download/auv-aarch64-pc-windows-msvc.zip) 把压缩包解压到一个固定目录,然后把该目录加入用户 `PATH`。压缩包里只有一个 `auv.exe`;Windows helper 已内嵌其中。 ### 用 proto 安装 先安装并配置 [proto](https://moonrepo.dev/docs/proto)。然后添加 AUV 插件并安装最新发行版: ```sh proto plugin add auv "https://raw.githubusercontent.com/moeru-ai/auv/main/toolchain/proto/auv.toml" --to global proto install auv latest --config-mode global --pin global auv --version ``` > [!NOTE] > > macOS 的 `AUV Helper.app` 包含在 `proto` 安装中。在 Windows 上,`auv-helper.exe` 内嵌于 `auv.exe`,仅由需要提权的 helper 初始化命令释放出来。 > [!WARNING] > > 不支持 Linux musl。(但欢迎提 PR!) ### 用 Nix 安装 安装 [Nix](https://nixos.org/download/) 2.27 或更高版本,并启用 `nix-command` 与 `flakes` 实验性特性。在 macOS 上,先安装 Apple 的构建工具: ```sh xcode-select --install ``` 然后从本仓库安装默认的 AUV 包: ```sh nix profile install 'git+https://github.com/moeru-ai/auv#default' auv --version ``` 必须使用 `git+https` 传输方式,Nix 才能拉取 AUV 的 Git 子模块。该 flake 定义了面向 Apple Silicon、Intel macOS,以及 x86-64、ARM64 Linux 的源码构建包。该包不支持 Windows 和 Linux musl。 Nix 包不包含已签名的 `AUV Helper.app`。在 macOS 上,如果你需要用官方 helper 运行 `auv setup macos-helper install`,请使用 Homebrew、proto 或直接下载发行版。 ### 用 Cargo 安装 前置条件:[Rust](https://www.rust-lang.org/tools/install) 以及下面的平台构建工具。AUV 自带 Protobuf 源码,因此不需要 Buf。 > [!WARNING] > `cargo install` 不包含 AUV Helper。如果你需要它,请使用上面的某种安装方式。 #### macOS 安装 Xcode Command Line Tools: ```sh xcode-select --install cargo install --git https://github.com/moeru-ai/auv auv-cli --bin auv auv --version ``` #### Linux 在 Ubuntu 或 Debian 上,安装原生构建依赖: ```sh sudo apt-get update sudo apt-get install -y \ pkg-config libclang-dev libxcb1-dev libxrandr-dev libdbus-1-dev \ libpipewire-0.3-dev libwayland-dev libxkbcommon-dev libegl-dev \ libleptonica-dev libtesseract-dev cargo install --git https://github.com/moeru-ai/auv auv-cli --bin auv auv --version ``` > [!NOTE] > 其他 Linux 发行版的包名可能不同。 #### Windows 安装带 MSVC 工具链的 Rust、Visual Studio Build Tools 和 Windows SDK。 ```powershell cargo install --git https://github.com/moeru-ai/auv auv-cli --bin auv auv --version ``` ### 初始化 #### macOS 官方 macOS 发行版包含已签名的 `AUV Helper.app`。在 macOS 13 或更高版本上,为当前用户安装它: ```sh auv setup macos-helper install auv setup macos-helper status ``` > [!TIP] > 该安装不需要 `sudo`,也不需要管理员密码。 如果 macOS 请求授权,打开「后台项目」与「辅助功能」设置: ```sh auv setup macos-helper open-background-items-settings auv setup macos-helper open-accessibility-settings ``` > [!NOTE] > 集成 AUV 的项目可以给 `AUV Helper.app` 换品牌。它们可以修改它的名称、图标、bundle identifier 以及 Apple Developer 签名身份。打包选项见 [Shipped helper identity](crates/auv-device-helper-macos/README.md#shipped-helper-identity)。 把这些权限授予启动 AUV 的那个应用,通常是你的终端应用: | 权限 | 用途 | | --- | --- | | 辅助功能 | 读取 AX 树、控制聚焦元素、键盘/指针自动化。 | | 屏幕录制 | 截图、OCR、视觉检查与证据采集。 | | 自动化 | AppleScript/System Events 的应用激活与前台回退路径。 | 修改权限后,重启终端。然后运行: ```sh auv doctor auv invoke permission.probe ``` #### Windows > [!IMPORTANT] > Windows 的初始化命令需要提权的 PowerShell。 ```powershell auv setup windows-helper install auv setup windows-helper status ``` > [!NOTE] > 该初始化命令会把内嵌在 `auv.exe` 里的 `auv-helper.exe` 释放到 `%ProgramFiles%\AUV`,然后把它注册为 LocalSystem 服务 `AuvHelper`。Helper 不监听网络。锁定与解锁通过一个以登录用户身份运行的普通 `auv serve` 完成。若要从网络接受配对的 Device,请用 `--remote-bind 0.0.0.0:9847` 启动那个 daemon。初始化命令还会为运行它的用户注册计划任务 `AUV Daemon`:该用户登录时,它在交互会话中以受限权限启动一个只监听本地的 `auv serve`。如果当前安装的是 0.0.28 的 Helper,请先运行 `auv setup windows-helper uninstall`,再重新安装并重新配对客户端。 > > 证据等级:一个 Windows 11 主机上的一次已安装锁定与解锁门禁测试。这不是普遍支持声明。见 [Windows Helper 与 daemon 拆分](docs/ai/references/session-api/2026-10-06-windows-helper-daemon-split.md#evidence)。 ### 卸载 按你的安装方式选择对应说明。如果安装了平台 Helper,请先移除它。 #### macOS ```sh auv setup macos-helper uninstall brew uninstall auv ``` > [!NOTE] > 移除 Helper 会在登录钥匙串中保留注册数据,也会在 Application Support 目录中保留其他 AUV 数据。 #### Linux ```sh rm "$HOME/.local/bin/auv" rm -rf "$HOME/.local/bin/.auv" ``` #### Windows 在提权的 PowerShell 中运行这些命令: ```powershell auv setup windows-helper uninstall scoop uninstall auv ``` > [!NOTE] > 移除 Helper 会在 `%ProgramData%` 中保留已注册的 PIN。daemon 自身的配对与策略数据留在它自己的存储中。 如果你是手动解压 ZIP 安装的,请从文件系统中删除该目录,再把它从 `PATH` 中移除。 #### Cargo ```sh cargo uninstall auv-cli ``` ## 理解 AUV 对于 [Cua](https://github.com/trycua/cua)、[`agent-browser`](https://github.com/vercel/agent-browser) 以及类似的 computer-use 项目来说,常见做法是按顺序执行 `screenshot`、`read image`、`click`、`type`、`wait` 以及后续的校验步骤,然后让 LLM 或 agent 判断下一步。 ```mermaid flowchart LR A[Agent] --> B[screenshot] B --> C[read image] C --> D[decide next step] D --> E[click] E --> F[wait] F --> G[type] G --> H[verify] H --> D ``` 其中许多重复序列可以压成可复用的 GUI 操作。打开应用、等待就绪、填写表单、检查结果, 这些都应当能作为一条命令被调用,而不是每次都把同一套逐步循环再花一遍 token。 现代 agent 常用 [skills](https://developers.openai.com/api/docs/guides/tools-skills) 或项目说明来编排工具调用、CLI 和脚本。 但内置的 computer-use 接口,例如 [OpenAI Computer Use](https://developers.openai.com/api/docs/guides/tools-computer-use) 或 [Claude Computer Use](https://docs.anthropic.com/en/docs/agents-and-tools/computer-use), 本质上仍是交互式的「模型与工具」循环,而不是可脚本化的 GUI 自动化库。 类似 [Playwright](https://playwright.dev/),如果我们能把这些动作组织成可执行的、可复用的脚本,会怎样?| 工具调用循环 | Rust 脚本 |
|---|---|
| ```text • Ran screenshot └ saved screen.png • Ran read image screen.png └ form is visible • Ran click "Email" └ clicked • Ran type "user@example.com" └ typed • Ran screenshot └ saved after.png • Ran verify form state └ ready ``` |
```rust
pub fn open_and_fill_form(
app: &mut AppSession,
data: FormData,
) -> AuvResult |
| ```text • Ran screenshot └ saved page-1.png • Ran OCR visible rows └ 12 rows • Ran scroll └ scrolled down • Ran OCR visible rows └ 10 rows, 4 repeated • Ran guess when to stop └ uncertain ``` |
```rust
pub fn scan_visible_rows(
region: &mut WindowRegion,
) -> AuvResult |
| ```text • Ran click target └ clicked • Ran screenshot └ saved after-click.png • Ran semantic check └ mismatch • Ran retry manually └ repeated tool loop ``` |
```rust
pub fn verify_and_retry |