Skip to content

javimosch/ocr-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ocr-cli

CLI utility for extracting text from images using OCR (Optical Character Recognition). Powered by rapidocr-onnxruntime.

Repository: https://github.com/javimosch/ocr-cli

Features

  • 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

Quick Start

Via Supercli (Recommended)

# Extract text from clipboard image
sc ocr clipboard extract

Direct CLI Usage

# 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.png

Installation

For detailed installation instructions, see INSTALL.md.

Requirements:

  • Python 3.10+
  • uv (Python package manager)
  • xclip (for clipboard support on Linux): sudo apt install xclip

Usage Examples

# 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

How it works

  1. For clipboard: Uses xclip to extract image data from clipboard
  2. For files: Reads image data from specified file path
  3. Processes image using rapidocr-onnxruntime (ONNX-based OCR engine)
  4. Outputs extracted text to stdout

Supercli Integration

The plugin is available in supercli as a bundled plugin. Install via:

sc plugins install ocr-cli
sc skills sync

Then use:

sc ocr clipboard extract

Notes

  • 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.

About

CLI utility for extracting text from images using OCR (Optical Character Recognition). Powered by rapidocr-onnxruntime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors