ocr

A command that uses OCR, or optical character recognition, to turn images and PDFs into text or searchable PDFs. It supports JPG and PNG images as well as PDFs.

In plain words
What is it for?
Extracting text as TXT or Markdown, creating searchable PDFs, choosing recognition languages, and reprocessing existing PDF pages when needed.
Why use it?
It removes the need to retype text from scanned documents and can add a searchable text layer to PDFs.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/coltonbearden/carrel/ocr
Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 473 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00473
Opus 5 $0.00010 $0.00236
Sonnet 5 $0.00004 $0.00095
Haiku 4.5 $0.00002 $0.00047

Measured yesterday against content hash ba6a3b5b914c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

ocr scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Afterwards, tell the user where the output landed. For `--to txt/md`, offer to show or summarize the extracted text. Exit code 3 means tesseract/ocrmypdf is missing — relay the install hint from stderr (`sudo apt install
plugins/carrel-convert/commands/ocr.md · 25 lines

What it actually says

OCR the file the user asked about: $ARGUMENTS

Run the carrel CLI via Bash. Map the user's request onto these real flags of carrel ocr (verify with carrel ocr --help if unsure — never invent flags):

carrel ocr SRC [-o OUT] [--lang LANG] [--to txt|pdf|md] [--redo] [--force]
  • SRC: a jpg/png image (runs through tesseract) or a PDF (runs through ocrmypdf; born-digital pages pass through untouched).
  • --to txt|pdf|md (default txt): extracted text, or a searchable PDF layer.
  • -o/--out PATH: output file; default is SRC with the target extension (SRC.ocr.pdf for pdf → pdf).
  • --lang LANG (default eng): tesseract language codes, e.g. eng or eng+deu — set this when the user mentions a non-English document.
  • --redo: re-OCR PDF pages even if they already have text (only when the user says the existing text layer is bad).
  • --force: only when the user explicitly wants an existing output overwritten.

Afterwards, tell the user where the output landed. For --to txt/md, offer to show or summarize the extracted text. Exit code 3 means tesseract/ocrmypdf is missing — relay the install hint from stderr (sudo apt install tesseract-ocr / ocrmypdf). Exit code 4 means the input type isn't OCR-able.

Requires the carrel CLI on PATH. If carrel is not found, tell the user to install it with uv tool install <path-to-carrel-repo> (see the repo's INSTALL notes), or run it as uv run carrel ... from the carrel repo root.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 25 lines · 20 tokens per session scan B ba6a3b5b914c

Subscribe to this mod's changes

ocr is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed 21d ago), licensed MIT. It adds 20 tokens to every session and 473 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.