openclaw/Peekaboo

Peekaboo is a macOS CLI & optional MCP server that enables AI agents to capture screenshots of applications, or the entire system, with optional visual question answering through local or remote AI models.

What is Peekaboo?

Peekaboo is a macOS tool that lets you automate your computer by seeing the screen and performing actions like clicking, typing, and pressing keys. It comes in two forms: a command-line tool (CLI) and a menu-bar app that sits in your Mac's top menu bar.

It's built for three ways of working:

  • Directly – you type commands to take screenshots, inspect app interfaces, and control them.
  • Through an agent – you give it a natural-language instruction (e.g., "Open Safari, go to github.com, and search for Peekaboo") and it plans and executes the steps.
  • Via MCP clients – it can expose its tools to AI assistants like Codex, Claude Code, or Cursor, so those assistants can use Peekaboo's abilities.

What does it do?

Peekaboo's core loop is: observe the current screen, choose an element (like a button or text field), and act on it. It can:

  • Take screenshots of the whole screen or specific windows.
  • Inspect a running app to get a structured map of its UI elements (with opaque IDs you can reference).
  • Perform actions like clicking, typing, pressing keys, scrolling, dragging, and setting values.
  • Control macOS features like windows, menus, the Dock, dialogs, and Spaces.
  • Run multi-step workflows via its agent command.

How do you install it?

Peekaboo requires macOS 15 or later. There are three installation methods:

  1. CLI via Homebrew – brew install openclaw/tap/peekaboo
  2. MCP package via npm – requires Node.js 22+, includes the CLI and its MCP launcher: npx -y @steipete/peekaboo --version
  3. Mac app – download the signed DMG from the latest GitHub release. The menu-bar app provides permission onboarding, visual feedback, and agent sessions. (The CLI is installed separately if you also want it on your PATH.)

How do you use it?

First, check permissions: peekaboo permissions status. Screen capture needs Screen Recording permission; UI inspection and control need Accessibility permission.

Then you can take a screenshot:

peekaboo see --no-elements --mode screen --path /tmp/peekaboo-screen.png

Or inspect an app's UI:

peekaboo see --app Finder --json

To automate an app, you can list its windows, pick a window ID, and then target actions to that exact window:

peekaboo window list --app Safari --json
peekaboo click "Address and search bar" --app Safari --window-id 12345
peekaboo type "github.com/openclaw/Peekaboo" --app Safari --window-id 12345
peekaboo press Return --app Safari --window-id 12345

For natural-language automation, use the agent (requires a configured model provider):

peekaboo agent "Open Safari, go to github.com, and search for Peekaboo" --allow-foreground

Key features and notes

  • Background delivery: When Peekaboo can resolve the target process, it can send clicks and typed input without bringing the app to the foreground. Some actions (like raw key chords without a window selector) require explicit foreground consent.
  • Version 4.9.8 (a fix release) improved file selection in Open dialogs, fixed window targeting when apps share names, and made MCP start more robust.
  • Configuration is stored under ~/.peekaboo; use peekaboo config to view or change settings.
  • Shell completions for zsh, bash, and fish are available via peekaboo completions.
  • Community rewrites: PeekabooWin (Windows, JavaScript + PowerShell) and PeekabooX (Linux, Rust + Python) are separate projects that reimplement the same automation loop.

Development

To build from source, you need macOS 15+, Swift 6.2+, Node.js 22+, and the repository's submodules. Build commands are:

pnpm install --frozen-lockfile
pnpm run build:cli
pnpm run lint:docs
pnpm run test:safe

License

MIT (see LICENSE file).

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project