Install
openclaw skills install claw-text-and-picsExtract text and embedded images from scanned documents, PDFs, and photos via Mistral OCR API. Use when reading receipts, invoices, contracts, handwritten notes, or any image or PDF containing text.
openclaw skills install claw-text-and-picsExtract text and images from documents via Mistral OCR
Give your OpenClaw agent the ability to read scanned documents, PDFs, and images — extracting clean Markdown text and cropping out embedded images. Powered by Mistral's OCR API.
# Extract text only
python3 ocr.py --input scan.jpg
# Extract text from PDF (3 pages)
python3 ocr.py --input document.pdf --pages 3
# Extract embedded images
python3 ocr.py --input scan.jpg --extract-images --output-dir ./images/
# Extract images and send to Telegram
python3 ocr.py --input scan.jpg --extract-images --send --target 123456789
# Works with URLs too
python3 ocr.py --input https://example.com/document.pdf
--output-dir (only with --extract-images)Set in ~/.openclaw/.env or as environment variables:
| Variable | Required | Description |
|---|---|---|
MISTRAL_API_KEY | Yes | Your Mistral API key |
TELEGRAM_BOT_TOKEN | Only for --send | Your Telegram bot token |
TELEGRAM_CHAT_ID | Optional | Default chat ID (overridable with --target) |
MISTRAL_API_KEY=required # Mistral API key — get one at console.mistral.ai
TELEGRAM_BOT_TOKEN=optional # Required only when using --send
TELEGRAM_CHAT_ID=optional # Default target chat ID (overridable with --target)
This skill reads ~/.openclaw/.env as a fallback for credentials.
Ensure the file has restricted permissions: chmod 600 ~/.openclaw/.env
--extract-images): pip install pillow| Parameter | Required | Description |
|---|---|---|
--input | Yes | Local path or URL to image/PDF |
--extract-images | No | Crop and save embedded images |
--output-dir | No | Output directory (default: ./extracted-images) |
--send | No | Send extracted images via Telegram |
--target | No | Telegram chat ID (or TELEGRAM_CHAT_ID env var) |
--pages | No | Number of PDF pages to process |
--debug | No | Print raw API response |