amebalabs/TRex
54.7
Adequate · 1 October 2026
8.8k
lines of production code
Swift
primary language
2
measurements over time
What this system is
TRex is a macOS application that performs text recognition (OCR) on screen captures, clipboard content, and images, offering both local processing via Tesseract and cloud-based refinement using external LLM providers. It provides a comprehensive user interface for managing capture history, configuring automation shortcuts, and adjusting language or AI settings, alongside a command-line interface and Raycast integration for programmatic access. The system supports background watch modes, multi-region selection, and seamless updates via Sparkle, ensuring reliable text extraction and post-processing across various input methods.
How it got here
2021 — Onboarding and settings overhaul
9 changes.
This period focused on restructuring the application's architecture and user interface, introducing a comprehensive onboarding flow and a tabbed Settings window with dedicated sections for automation, OCR, and AI/LLM integration. Significant work included adding URL scheme support for remote control, implementing visual status indicators in the menu bar, and preparing the project for Mac App Store distribution with proper entitlements and localization structures.
2022–2026 — TRex v2.0 release and LLM integration
8 changes.
This period focused on the development and release of TRex v2.0, introducing a modular architecture with TRexCore and TRexLLM packages to support LLM-powered OCR and post-processing. The work included building a comprehensive capture history system, a new command-line interface, and Raycast integration, while establishing automated build, signing, and Homebrew distribution pipelines.
Features
Add Homebrew Cask for TRex v2.0.0
A new Homebrew formula (cask) has been added for the TRex application, enabling users to install and manage the software via Homebrew. The cask is configured for version 2.0.0, includes automatic update support, installs the main application bundle, and provides a command-line binary named 'trex'. It also defines cleanup instructions for associated application support, cache, and preference files.
Formula · high confidence
Add Raycast commands for TRex capture actions
Added four new shell scripts in the Resources/Raycast/TRex Commands directory that expose TRex's capture functionality to Raycast. These commands allow users to trigger text recognition (OCR) via the 'trex://capture' URL scheme, including specific variants for capturing from the clipboard ('trex://captureclipboard', 'trex://captureclipboardautomation') and running automations ('trex://captureautomation', 'trex://captureautomation').
Resources/Raycast · high confidence
Added Localizable enum structure for app and preferences strings
A new Localizable.swift file has been introduced to organize localization resources. It defines a Localizable enum containing nested App and Preferences enums, providing a structured namespace for accessing localized strings within the application and preferences modules.
TRex/Resources/Localization · high confidence
Added build and signing automation scripts
Two new shell scripts have been added to the Scripts directory to support the build and update processes. The flatten-frameworks.sh script resolves App Store validation errors by removing improper Info.plist symlinks from TesseractCore and Leptonica frameworks. The generate-sparkle-keys.sh script automates the generation of EdDSA key pairs required for Sparkle code-signing updates, including instructions for configuring public and private keys.
Scripts · high confidence
Capture history view with search, filtering, and clipboard copy
Users can now view a history of text captures in a split-pane interface. The left panel lists entries with thumbnails, timestamps, and engine names, and includes a search bar to filter by text content. The right panel displays full details for a selected capture, including metadata like confidence and recognized languages, and provides a 'Copy to Clipboard' button to reuse the text. Users can also adjust the maximum number of stored history entries via a stepper and clear all history with a confirmation dialog.
TRex/App/UI/History · high confidence
Introduce LLM-powered OCR and post-processing with multi-provider support
The TRexLLM package now provides LLM-based text recognition and result refinement, allowing users to offload OCR and post-processing to external AI models. The system supports OpenAI, Anthropic, and custom OpenAI-compatible endpoints (such as local Ollama instances), with configuration for API keys, custom endpoints, and specific model selection. It includes an image preprocessor to optimize images for API transfer and a network checker to handle connectivity states. Users can enable LLM OCR and post-processing independently, with fallback to built-in OCR and configurable prompts for error correction and formatting.
Packages/TRexLLM · high confidence
Introduce TRex Command Line Interface (CLI)
A new command-line tool is added to TRex, allowing users to perform OCR captures and trigger automations directly from the terminal. The CLI supports three input modes: capturing the current screen, reading an image from the clipboard, or piping image data via standard input. When the automation flag is enabled, the extracted text is passed to configured Shortcuts. The tool requires macOS 10.15 or later and includes necessary entitlements for Apple Events automation and file access.
TRex CMD · high confidence
Introduces capture history, frozen screen selection, and LLM-powered OCR
TRex Core now persists a local history of captures (including text, confidence, and thumbnails) via CaptureHistoryStore, and provides a FrozenScreenSelectionOverlay that freezes the display during region selection to prevent content from shifting. The package also adds LLM-based OCR and text post-processing engines (LLMOCREngine, LLMPostProcessor) with automatic fallback to built-in Vision or Tesseract engines, alongside a new InvocationMode enum to support multi-region capture and automation triggers.
Packages/TRexCore · high confidence
New Settings UI with Automation, Custom Words, and AI/LLM tabs
The Settings window has been restructured into a tabbed interface, introducing dedicated tabs for Automation, Custom Words, Tesseract, and (on non-MAS builds) AI/LLM. The Automation tab allows users to configure automatic URL opening and trigger macOS Shortcuts on captured text. The Custom Words tab provides a text editor to define specific vocabulary for improved recognition. The Tesseract tab enables users to toggle the Tesseract OCR engine and manage language downloads. The AI/LLM tab exposes settings for using external language models for both OCR and post-processing, including provider configuration and prompt editing. Existing General and Shortcuts tabs have been updated to support these new features, such as language selection logic that adapts based on the active OCR engine.
TRex/App/UI/Settings · high confidence
Behavioural changes
9 commits (0 fixes) modifying Resources
A change to existing behaviour in Resources — 9 commits, 6 files.
Resources · medium confidence · unverified
App Store distribution configuration and entitlements
The application now includes a dedicated entitlements file for the Mac App Store build, enabling the required app sandbox, application groups, and Apple Events automation permissions. A new Info.plist defines the app's URL scheme, automatic update settings, and a Finder Service for text extraction, while a Credits.rtf file acknowledges third-party dependencies.
TRex/Resources · high confidence
Improved settings access and keyboard shortcut management
The application now includes a dedicated utility to reliably open the Settings window across macOS versions 12 through 14, resolving previous issues where the settings option was missing or inaccessible. Additionally, a new file defines specific keyboard shortcut names for various capture actions (screen, clipboard, multi-region) and their automation triggers, establishing the configuration for these user-facing controls.
TRex/App · high confidence
Menu bar icon now pulses to indicate LLM processing and watch mode status
The menu bar item now provides visual feedback during background operations: the icon pulses when the LLM is processing text and pulses at a different rate when watch mode is active, helping users distinguish between these two concurrent states.
TRex/App/UI · high confidence
New branded onboarding experience with guided setup
The onboarding flow has been redesigned with a polished, branded UI featuring a three-step journey: a welcome screen highlighting key features, a quick setup page for configuring permissions (screen recording), language preferences, and app settings (shortcuts, launch at login, notifications), and a tutorial view demonstrating the capture process. The interface uses custom animations, brand colors, and modern component styles to guide users through initial configuration.
TRex/App/UI/Onboarding · high confidence
TRex project structure reorganized with new build targets and onboarding UI
The Xcode project has been restructured to support a new modular architecture and updated user interface. A new 'TRex CLI' target has been added, enabling command-line usage of the tool. The main application now includes a comprehensive onboarding experience, featuring new views for setup, language selection, permissions, and tutorials, along with custom styling for text fields and toggles. Additionally, the project integrates the Tesseract OCR engine and the TRexCore package, while updating the KeyboardShortcuts framework to version 3.1 for compatibility with macOS 27.
TRex.xcodeproj · high confidence
URL scheme endpoints and launch behavior updates
TRex now supports a comprehensive set of URL scheme endpoints for remote control, including \capture\, \captureclipboard\, \captureautomation\, \capturemultiregion\, \showpreferences\, \showhistory\, \shortcut\, \startwatchmode\, and \stopwatchmode\. Additionally, the application has been updated to prevent the Settings window from opening automatically on launch, and it now correctly handles re-opening by showing and activating the settings if no visible windows are present.
TRex · high confidence
Dependencies
TRexCore and TRexLLM packages introduced with updated dependencies
The TRexCore and TRexLLM Swift packages have been added, establishing the core library and LLM integration components. TRexCore now depends on TesseractSwift 1.2.1 and the local TRexLLM package, while TRexLLM depends on AnyLanguageModel 0.9.0. Both packages require macOS 14 and Swift 6.1, and include pinned versions for shared dependencies such as EventSource 1.3.0, JSONSchema 1.3.1, PartialJSONDecoder 1.0.0, swift-collections 1.3.0, and swift-syntax 602.0.0.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 56 → 55 (-1.1)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 94 → 94 (-0.9)
- Architecture 96 → 97 (+0.9)
- Maturity 49 → 49 (-0.0)
- Readiness 58 → 58 (+0.0)
- Security 46 → 46 (+0.0)
New (16)
- Coverage not measured — Swift suite
- Documentation: contradicts the code (docs/release-notes/v2.0.1-beta.3.md)
- Duplicated block (10 lines × 2) (TRex/App/UI/Settings/LLMSettingsView.swift)
- Duplicated block (22 lines × 2) (TRex/App/UI/Onboarding/Views/TutorialView.swift)
- Duplicated block (25 lines × 2) (Packages/TRexCore/Sources/TRexCore/OCREngine.swift)
- Duplicated block (6 lines × 2) (Packages/TRexCore/Sources/TRexCore/TRexCore.swift)
- Duplicated block (8–9 lines × 2) (Packages/TRexCore/Sources/TRexCore/WatchModeOverlay.swift)
- Inconsistent naming for deletion operations. CaptureHistoryStore uses removeEntry, while LanguageManager and TesseractOCREngine use deleteLanguage. In Swift/iOS conventions, remove is often used for collection items (like array elements) and delete for persistent resources, but the inconsistency between removeEntry (generic) and deleteLanguage (specific) creates cognitive load.
- Inconsistent return types for equivalent data. MenuBarIcon exposes two methods to get the icon image, returning different types (Image vs NSImage). While Image might be a SwiftUI type and NSImage AppKit, exposing both as primary accessors is confusing. Usually, one should be the canonical source, and the other a conversion helper.
- MethodTooLong: GeneralSettingsView.body (TRex/App/UI/Settings/GeneralSettingsView.swift)
- Off the main sequence: TRexLLM
- Outdated: anylanguagemodel
- Redundant accessors. The type exposes a public property shortcuts which is an array, but also provides a method getShortcuts(). In Swift, accessing a property is the standard idiom; a get method is redundant and unidiomatic unless it performs significant computation or side effects, which is not indicated here.
- Repeated repair: Packages/TRexCore/Sources/TRexCore/ShortcutsManager.swift (Packages/TRexCore/Sources/TRexCore/ShortcutsManager.swift)
- Repeated repair: Packages/TRexCore/Sources/TRexCore/TesseractOCREngine.swift (Packages/TRexCore/Sources/TRexCore/TesseractOCREngine.swift)
- TooManyMethods: TRex (Packages/TRexCore/Sources/TRexCore/TRexCore.swift)
Changes since last survey
- 12 commits — 6 feature/other, 6 fixes
By area
- Packages/TRexCore — 6 commits
- (root) — 3 commits
- docs/release-notes — 2 commits
- TRex.xcodeproj/project.pbxproj — 1 commit
Notable commits
- fix: fix(cli): exit after capture completes (#94)
- fix: fix(ocr): recover from Vision failures on macOS 27 (#95)
- fix: fix(shortcuts): update KeyboardShortcuts to 3.1 for macOS 27 (#102)
- fix: fix(tesseract): surface OCR failures instead of empty success (#98)
- fix: fix: recover empty OCR results with Tesseract (#96)
- fix: fix: restore clipboard after failed text writes (#97)
- change: chore(deps): bump TesseractSwift to 1.2.1 and drop stride workaround (#100)
- change: docs: add release notes for v2.0.1-beta.2
- change: docs: add release notes for v2.0.1-beta.3
- change: docs: refresh CLAUDE.md Tesseract and testing sections (#99)
- change: docs: update CHANGELOG.md, appcast and Homebrew formula for v2.0.1-beta.2
- change: docs: update CHANGELOG.md, appcast and Homebrew formula for v2.0.1-beta.3
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
amebalabs/TRex was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c4408b4012b80af00c2db234d88695b6138b4fc0 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.