CLI utility for extracting text from images using OCR (Optical Character Recognition). Powered by rapidocr-onnxruntime.
Repository: https://github.com/javimosch/ocr-cli
- Extract text from images in clipboard (Linux/X11)
- Extract text from image files (PNG, JPG, etc.)
- Uses rapidocr-onnxruntime for accurate OCR
- No API keys required - runs locally
- Integrated with supercli for seamless AI agent usage
# Extract text from clipboard image
sc ocr clipboard extract# Install system-wide (optional)
sudo cp ~/ai/supercli-clis/ocr-cli/bin/ocr-cli /usr/local/bin/ocr-cli
# Extract text from clipboard
ocr-cli --clipboard
# Extract text from file
ocr-cli --file /path/to/image.pngFor detailed installation instructions, see INSTALL.md.
Requirements:
- Python 3.10+
- uv (Python package manager)
- xclip (for clipboard support on Linux):
sudo apt install xclip
# Copy an image to clipboard, then extract text via supercli
sc ocr clipboard extract
# Extract text from a screenshot directly
ocr-cli --file screenshot.png
# Extract text from a photo
ocr-cli --file photo.jpg- For clipboard: Uses
xclipto extract image data from clipboard - For files: Reads image data from specified file path
- Processes image using rapidocr-onnxruntime (ONNX-based OCR engine)
- Outputs extracted text to stdout
The plugin is available in supercli as a bundled plugin. Install via:
sc plugins install ocr-cli
sc skills syncThen use:
sc ocr clipboard extract- Clipboard support requires X11 (Linux)
- Works best with clear, high-contrast images
- Supports common image formats (PNG, JPG, etc.)
- First run may take a few seconds to download OCR models (~100MB)
This tool is a plugin for supercli — an AI-friendly, config-driven dynamic CLI platform.