← 开源
injaneity

pi-computer-use

Let Pi control your apps on MacOS & Windows

AI EngineeringGive agent toolsTypeScript
在 GitHub 打开
增长势头
+624 小时新增 Star+0.3%
2.06k
Star
144
Fork
+26
本周
10
贡献者
创建于 2026-04-20 · 更新于 2026-10-17 · 今日第 1684 名
主要开发者
injaneitygongahkiamasonc15
README

pi-computer-use

pi-computer-use lets AI agents use desktop apps on macOS, Windows, and Linux.

The macOS helper requires macOS 14 or newer; the macOS reference maps each platform claim to Apple documentation and the implementation.

An agent can look at an app window, understand the buttons and text inside it, and perform actions like clicking, typing, scrolling, and waiting for something to change. This is useful when the agent needs to work with a normal desktop app instead of an API, a terminal command, or a file.

New to computer use? Start with: Wait, what exactly is Computer Use?

What this package does

This is a Pi extension. After installation, Pi agents get tools for:

  • finding open apps and windows
  • observing what is visible in a window
  • searching the visible interface for text, buttons, and controls
  • inspecting parts of the interface in more detail
  • clicking, typing, scrolling, and pressing UI controls
  • waiting for UI changes

In short: it gives an agent a controlled way to operate desktop software.

What this package is not

pi-computer-use is not a replacement for app APIs or MCP servers. If an app has a reliable direct integration, use that first.

Computer use is most helpful when the only available interface is the app on screen.

Install

pi install npm:@injaneity/pi-computer-use

Start Pi and complete the platform setup flow.

On macOS, the runtime installs the helper per user at ~/Applications/pi-computer-use.app and requests Accessibility and Screen Recording. Existing writable system-wide installs remain at /Applications/pi-computer-use.app. Enable both grants for that app in System Settings, then choose Recheck. The macOS reference documents the exact APIs and avoids relying on version-specific pane labels.

On Windows, use an interactive desktop session. Windows support uses the platform accessibility APIs and does not use the macOS helper app.

On Linux, run Pi inside the target user's graphical session with a working AT-SPI2 accessibility bus. AT-SPI semantic operations remain background-first. X11 additionally supports EWMH window metadata/focus, window capture, and policy-gated XTEST physical input; strict headless/background policies never use focus or XTEST. Native Wayland remains semantic-only; diagnostics reads portal capability properties without creating a session, and interactive portal use is disabled. See Linux support for the exact capability matrix and portal status.

Use /computer-use inside Pi to show the active configuration and where it came from.

Main tools

  • find_roots
  • observe_ui
  • search_ui
  • expand_ui
  • inspect_ui
  • act_ui
  • read_text
  • wait_for

Follow the getting-started tutorial, then use the generated agent state and action contract for operating behavior or the generated tool schema reference for exact parameters.

Documentation

The docs follow Diátaxis and render through the Next.js/Fumadocs app in docs/. Run npm install --prefix docs once, then npm run docs:dev and open http://localhost:8080/docs.

Development status

The architecture is centered on immutable, state-scoped observations. Desktop surfaces and CDP pages form one multi-root forest; progressive outline queries remain cached, while live work is ordered per physical resource so independent roots can run in parallel. act_ui accepts one or more intent steps, preserves focus across dependent input, verifies delivery, recovers safely, stores one complete successor state, and returns a compact diff when identity confidence allows. Older direct tools such as screenshot, click, set_text, and computer_actions are no longer part of the public extension surface.

License

MIT

排名相邻
同类项目