GoodMemGoodMem
ReferenceCLI

OCR

Reference for goodmem ocr: Run layout-aware OCR against a document or image and return a structured response.

goodmem ocr

Run OCR on a document or image

Synopsis

Run layout-aware OCR against a document or image and return a structured response.

Input can be provided from a file or via stdin. By default the response is emitted as JSON.

goodmem ocr [flags]

Examples

  # OCR a PDF and emit JSON
  goodmem ocr --file document.pdf

  # OCR a TIFF and request markdown output
  goodmem ocr --file scans.tiff --format markdown

  # Pipe input via stdin
  cat document.pdf | goodmem ocr --input-format pdf --format json

Options

      --end-page int                    0-based inclusive end page
      --file string                     Path to input file (use - to read from stdin)
      --format string                   Output format: json or markdown (default "json")
  -h, --help[=true|false]               help for ocr
      --include-markdown[=true|false]   Include markdown rendering in response
      --include-raw-json[=true|false]   Include raw OCR JSON payload
      --input-format string             Input format: auto, pdf, tiff, png, jpeg, bmp (default "auto")
      --markdown-raw[=true|false]       Disable markdown formatting and emit raw OCR output
      --markdown-width int              Wrap markdown output to N columns (0 disables wrapping) (default 80)
  -o, --output string                   Write output to file (default stdout)
      --start-page int                  0-based inclusive start page
      --timeout duration                Request timeout (0 for no timeout) (default 2m0s)

Options inherited from parent commands

      --api-key string   API key for authentication (can also be set via GOODMEM_API_KEY environment variable)
      --server string    GoodMem server URL (gRPC API; default ports: https=443, http=80)

SEE ALSO

  • goodmem - GoodMem CLI provides command-line access to memory APIs

On this page