← Back to archive

Repo of the Day

amebalabs/TRex

Published: Oct 8, 2025

Open repository ↗

Copy any text on your screen, stop retyping.

Summary

TRex is a macOS menu bar app that runs OCR locally on a selected screen region and copies the recognized text straight to the clipboard. It is written in Swift, targets macOS 11.0 and newer, and is released under the MIT license.

What it is useful for

TRex addresses the everyday problem of text that is visible on screen but not selectable, such as scanned PDFs, image attachments, YouTube captions, or a window being shared in a Zoom call. An engineer can copy an error message out of a screenshot, pull a snippet from a recorded video, or grab a reference string from a slide deck without retyping.

The capture flow is a global shortcut followed by a rectangle drag, after which the text is on the clipboard. The same pipeline also reads QR codes and barcodes, supports a configurable recognition language, and accepts a custom words list for domain-specific vocabulary. Because all recognition runs offline, captured content does not leave the local machine.

How engineers can use it

The README documents three install paths: the App Store, the GitHub Releases page, or Homebrew with brew install --cask trex.

For programmatic use, TRex includes a CLI binary at /Applications/TRex.app/Contents/MacOS/cli/trex that can be called from shell scripts and other tools. It also registers a trex:// URL scheme with verbs like trex://capture, trex://captureclipboard, and trex://captureautomation, which lets other apps and Apple Shortcuts start a capture. Recognized text can auto-open any URLs it contains, or fire a user-defined URL scheme to hand the text to a separate tool.

Launchers are supported too: the repo ships an Alfred workflow and a Raycast script-commands directory that adds a "Capture Text" command searchable from the launcher. The main scope limit is platform — TRex is macOS-only, so Linux and Windows users will need a different option.