CLI#
Use the CLI when you want a quick sanity check before writing Python code.
Use churro-ocr --help or python -m churro_ocr --help to inspect the top-level commands.
Command Summary#
Command |
Use it when |
|---|---|
|
you want OCR text for one image |
|
you want page crops from an image or PDF |
transcribe Examples#
OCR One Image#
churro-ocr transcribe \
--image scan.png \
--backend litellm \
--model vertex_ai/gemini-2.5-flash
OCR With A Local OpenAI-compatible Server#
churro-ocr transcribe \
--image scan.png \
--backend openai-compatible \
--model local-model \
--base-url http://127.0.0.1:8000/v1 \
--api-key dummy
extract-pages Examples#
Extract Pages From An Image#
churro-ocr extract-pages \
--image spread.jpg \
--output-dir pages/
This writes sequential PNG files such as page_0000.png, page_0001.png, and so on, and prints each written path to stdout.
Extract Pages With Azure Page Detection#
churro-ocr extract-pages \
--image spread.jpg \
--output-dir pages/ \
--page-detector azure \
--endpoint https://<resource>.cognitiveservices.azure.com/ \
--api-key <azure-doc-intelligence-key>
Extract Pages From A PDF#
churro-ocr extract-pages \
--pdf document.pdf \
--output-dir pages/ \
--dpi 300 \
--trim-margin 30
Command Contracts#
transcribe Backends#
|
Required flags |
Notes |
|---|---|---|
|
|
Uses LiteLLM credentials and routing. |
|
|
For local or self-hosted OpenAI-style servers. |
|
|
|
|
|
|
|
|
Local Transformers OCR. |
|
|
Local vLLM OCR. |
extract-pages Detectors#
|
Required flags |
Notes |
|---|---|---|
|
none |
Default behavior. Treats the whole image or rasterized PDF page as one crop. |
|
|
Uses |
|
|
Uses Azure Document Intelligence layout detection. |
Additional Rules#
transcriberequires exactly one--image.extract-pagesrequires exactly one of--imageor--pdf.--dpionly affects the--pdfpath because PDFs are rasterized before page detection.--trim-marginexpands each detected crop by the requested number of pixels, clipped to image bounds.