rs_peekaboo

June 8, 2026 ยท View on GitHub

Rust-native cross-platform computer-use CLI and library for macOS, Windows, and Linux.

rs_peekaboo focuses on capture, UI inspection, input, app/window/menu control, clipboard, permissions, scripts, and structured JSON output. It intentionally does not include model providers, hosted API keys, telemetry, or an assistant UI.

Install

From crates.io after release:

cargo install rs_peekaboo

From source:

git clone https://github.com/undivisible/rs_peekaboo
cd rs_peekaboo
cargo build --release
cargo install --path .

CLI

rs-peekaboo image --mode screen --path ~/Desktop/screen.png
rs-peekaboo see --app Safari --json
rs-peekaboo click --coords 500,300
rs-peekaboo type "hello" --return
rs-peekaboo hotkey cmd,l
rs-peekaboo window list --json
rs-peekaboo app launch --app Safari
rs-peekaboo clipboard read --json
rs-peekaboo shell "fastfetch --logo none" --json

Global flags:

FlagDescription
--jsonPrint structured JSON instead of human output.
--json-outputAlias for --json.

Commands:

CommandPurpose
seeCapture an image and cache a UI snapshot.
imageCapture a screen or focused window image.
list appsList running apps/processes.
list windowsReturn app/window accessibility context.
list screensReturn display information.
list menubarInspect the system menu bar.
list permissionsProbe screen recording, accessibility, and clipboard access.
clickClick a coordinate or UI element query.
typeType text into the active UI.
pressPress a named key.
hotkeyPress a key combination such as cmd,l.
pastePaste text while restoring the previous clipboard where possible.
scrollScroll up, down, left, or right.
swipeSwipe between two coordinates.
dragDrag between two coordinates.
moveMove the pointer to a coordinate or UI element query.
set-valueSet the value of a resolved UI element.
perform-actionPerform an accessibility action on a resolved UI element.
windowList, focus, close, minimize, move, resize, or set window bounds.
appList, launch, switch, quit, hide, or unhide apps.
openOpen a path or URL, optionally with a specific app.
menuList or click menu items.
clipboardRead or write the clipboard.
permissionsProbe automation permissions.
shellRun a shell command and return stdout, stderr, and exit status.
runExecute a JSON automation script.
sleepSleep for a number of seconds.
cleanRemove cached snapshots.
toolsPrint the command catalog.
completionsGenerate shell completions.

JSON Output

rs-peekaboo image --mode screen --json
{
  "ok": true,
  "data": {
    "path": "/var/folders/.../rs_peekaboo_x.png",
    "mode": "screen",
    "bytes": 123456,
    "mime_type": "image/png"
  }
}
rs-peekaboo see --app Safari --json
{
  "ok": true,
  "data": {
    "snapshot_id": "snap-...",
    "elements": [
      {
        "id": "window:Safari:Example",
        "role": "window",
        "label": "Example",
        "app": "Safari",
        "window": "Example",
        "bounds": {
          "x": 0,
          "y": 25,
          "width": 1200,
          "height": 800
        },
        "state": {
          "minimized": false
        }
      }
    ]
  }
}

Library

use rs_peekaboo::automation::Target;
use rs_peekaboo::{Bounds, Direction, ImageMode, Peekaboo, Point};

fn main() -> rs_peekaboo::Result<()> {
    let peekaboo = Peekaboo::new();

    let image = peekaboo.image(ImageMode::Screen, None, true)?;
    let region = peekaboo.image_region(
        Bounds {
            x: 0,
            y: 0,
            width: 800,
            height: 600,
        },
        None,
        true,
    )?;
    let elements = peekaboo.ui_elements(None)?;

    peekaboo.click(Target::Point(Point { x: 500, y: 300 }), "left", 1)?;
    peekaboo.type_text("hello", false, false, None)?;
    peekaboo.hotkey(&["cmd", "l"])?;
    peekaboo.scroll(Direction::Down, 3)?;
    peekaboo.window("focus", Some("Safari"), None)?;
    peekaboo.app("launch", Some("Safari"))?;
    peekaboo.menu("list", "Safari", None, None)?;
    peekaboo.clipboard_write("copied")?;

    println!("{} {} {}", image.bytes, region.bytes, elements.len());
    Ok(())
}

Scripts

run accepts a JSON file with ordered steps:

{
  "steps": [
    {
      "command": "hotkey",
      "args": {
        "keys": "cmd,l"
      }
    },
    {
      "command": "type",
      "args": {
        "text": "https://example.com"
      }
    },
    {
      "command": "sleep",
      "args": {
        "duration_ms": 250
      }
    }
  ]
}
rs-peekaboo run ./script.json --json

Shell steps are also supported:

{
  "steps": [
    {
      "command": "shell",
      "args": {
        "command": "pwd",
        "cwd": "/tmp"
      }
    }
  ]
}

Permissions

Most actions require macOS Accessibility permission for the terminal or host app running rs-peekaboo. Screen capture requires Screen Recording permission. Clipboard commands require clipboard access in the current user session.

Probe status:

rs-peekaboo permissions status --json

Platform

PlatformCaptureInputUI snapshotNotes
macOSscreencaptureAccessibility / CoreGraphicsAppleScriptFull parity
WindowsGDI+ screenshotSendInput + SendKeysUI AutomationPowerShell backend
Linuxgrim / scrot / ImageMagickxdotoolwmctrlX11-focused; Wayland uses grim + wl-clipboard where available

Shell execution is cross-platform and uses the host shell.

Folk Around

rs_peekaboo is standalone. It is designed so MCP hosts such as folk-around can call the Rust computer-use engine directly instead of shelling out to AppleScript helpers.

License

MPL-2.0.