Introduction¶
In DeepSeek Harness (DSH) agent development, it is often necessary to read text from screenshots, clipboard images, or local files: error screenshots, table images, terminal screenshots, and document bitmaps. If using visual model plugins, images typically need to be submitted to a model service, which may involve API keys, quotas, and upload paths. LocalLens offers an alternative approach: it invokes the macOS Vision framework to perform OCR locally and returns only the recognized text to DSH.
What is it¶
LocalLens is a DSH plugin located under uknowmyface/locallens, maintained by uknowmyface, and licensed under MIT. It is a non-official community project and makes no claims of affiliation with DeepSeek or Apple. The plugin is used to extract text from screenshots, clipboard images, or image files by invoking the macOS Vision framework for local OCR, without requiring a visual model, API key, or network requests.
Core Features¶
- Supports three input sources:
source=screen,source=clipboard, andsource=file. - Extracts text from screenshots, clipboard images, and image files.
- Supports the
languagesparameter with a default value ofzh-Hans,en-US. - Returns
{ text, source, lineCount, warning? }. - Current documentation indicates it only accepts bitmaps; PDFs must be rasterized first.
Installation and Usage¶
Environment requirements:
- macOS 13 or later
- Xcode Command Line Tools
- Node.js 22+
Installation command:
dsh plugin --profile web add github:uknowmyface/locallens
This command adds the plugin to the web profile. Once installed, it can be invoked via natural language within a DSH session.
Typical Usage¶
The following examples are based on usage from verified sources.
- Clipboard OCR
First use Cmd+Ctrl+Shift+4 to select a region and copy the screenshot to the clipboard, then enter in the chat box:
OCR the clipboard
- Reading text from a local image
read the text in ~/Desktop/bug.png
- Reading screen text
read what's on my screen
This captures the entire primary display and requires Screen Recording permission.
- Continuing processing after OCR
OCR the clipboard and turn the table into markdown
read this error screenshot, then grep the project for where it's thrown
The recognized text enters the model context, allowing for further transformation, search, or analysis in subsequent instructions.
Use Cases and Notes¶
LocalLens is suitable for scenarios on macOS 13+ environments where reading text from bitmaps is required, especially screenshots, clipboard images, and local image files. It is not used to understand image content, but only to read text.
Usage notes:
- The plugin runs with the user privileges available to the current DSH process.
source=fileis not sandboxed and can read image files readable by the current user; check the source code and MIT license before installing. - Images are read locally and not uploaded, but the recognized text enters the model context and is sent to the configured model service. If the screenshot contains sensitive information that should not be pasted into the chat box, do not perform OCR.
- OCR output is marked as untrusted input and should be treated as data rather than a command.
source=screencaptures the entire primary display, requires Screen Recording permission, and has no region or window scope.- Currently, only bitmaps are accepted; PDFs must be rasterized first.
Conclusion¶
LocalLens provides a lightweight path: converting text from the screen, clipboard, or local bitmaps into text via macOS Vision OCR and handing it over to DSH for further processing. It does not require a visual model, API key, or network requests, but the recognition results still enter the model context, making it suitable for local scenarios with a specific need for “reading text.”
GitHub:
- https://github.com/uknowmyface/locallens