Frayo

← Guide

Command line

Frayo has a command-line tool, frayo. Scripts and AI coding agents can use it to capture the screen, read text from it and search your Library.

The tool does not capture by itself. It asks the Frayo app, which holds the Screen Recording permission. If the app is not running, the command starts it.

Access is off by default

Nothing can use the tool until you allow it.

  1. Open Settings › Integrations.
  2. Turn on Allow scripts and agents to capture. This adds a link at ~/.local/bin/frayo if it is missing, and allows access.
  3. Turn it off and the tool stops working at once. The link stays until you click Uninstall under the switch.

If frayo is not found, add this to your shell profile:

export PATH="$HOME/.local/bin:$PATH"

Move Frayo to Applications before installing. Uninstall removes the link.

The frayo:// links that capture or record with no picker follow the same switch: frayo://record-screen, and any link with ?rect= (such as frayo://capture-area?rect=0,0,400,300). With Allow scripts and agents to capture off, Frayo shows a notice and does nothing. This stops a web page from starting a recording. Links that open the normal picker or a window (capture-area, library, open-settings and so on) always work.

Who can connect

The app listens on a private socket in its Application Support folder. Only your own macOS user can reach it. Every capture made this way shows a "Captured from the command line" notice, so nothing is silent.

Commands

frayo capture area|window|screen|scrolling [--rect x,y,w,h] [--out path] [--keep] [--json]
frayo ocr <file> | --rect x,y,w,h [--code] [--json]
frayo list [--limit n] [--json]
frayo search <query> [--limit n] [--json]
frayo open <path>
frayo help

Exit codes

CodeMeaning
0OK
1Wrong usage
2App not reachable (is access on?)
3Permission denied, or you cancelled the picker

Examples

frayo capture window --json
frayo ocr --rect 0,800,1200,300
frayo ocr ~/Desktop/shot.png --code
frayo search "NullPointerException" --json

For AI agents

Frayo ships an agent skill file that tells an agent when and how to use these commands. It says to prefer ocr when only the text matters, because text costs far fewer tokens than an image. Copy it to your agent's skills folder.

Captures can hold private data. Check Secret detection, and only turn access on if you trust the tools running as you.