Skip to content

Component: Smrt.Tools.ExtractLab

Canonical source: SmrtApps/src/Smrt.Tools.ExtractLab/README.md (mirrored below)


Smrt.Tools.ExtractLab

Dev harness for OCR routing + execution.

Overview and responsibilities

  • Validates OCR planning + execution end-to-end without clipboard APIs.
  • Supports plan-only validation to confirm required settings/secrets are present.

Public surface / entry points

  • CLI entry point: dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj

Dependencies and integrations

  • Planning/orchestration: Smrt.ExtractText.
  • Host executors: Smrt.ExtractText.Host.
  • Optional cloud OCR via Smrt.CloudProviders.

Configuration and operational data

  • Requires OCR.Space secret api-key stored via Smrt.CloudProviders when using the OCR.Space provider.

Observability and diagnostics

  • Logs metadata only; does not log/persist image bytes or OCR output.

Testing and validation

  • Not documented yet.

Support Bundle

  • Prefer Support Bundle when diagnosing provider configuration or execution issues.

Goals

  • Validate local-first OCR routing + fallback (Windows AI OCR -> legacy Windows OCR -> cloud fallback).
  • Provide plan-only validation (--plan/--dry-run) that checks required settings + secrets without making provider calls.
  • When executing, log metadata only and do not log/persist image bytes or OCR output.

Clipboard vs file workflows

  • ExtractLab is intentionally file-oriented (you pass --image <path>). It is not the user-facing clipboard workflow.
  • In SmrtHub UX, ExtractText is a clipboard-in / clipboard-out action (results are written back to the clipboard). ExtractLab exists to validate the provider planning + execution stack without involving clipboard APIs.

Usage

  • Plan only:
  • dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj -- --plan --image <path>
  • dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj -- --cloud-only --prefer OcrSpace --plan --image <path>
  • dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj -- --cloud-first --prefer OcrSpace --plan --image <path>

  • Execute:

  • dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj -- --image <path>
  • dotnet run --project SmrtApps/src/Smrt.Tools.ExtractLab/Smrt.Tools.ExtractLab.csproj -- --cloud-first --prefer OcrSpace --image <path>

Notes: - Requires OCR.Space secret api-key stored via Smrt.CloudProviders in Windows Credential Manager. - --prefer influences cloud selection. - Default behavior is local-first with cloud fallback. - --cloud-first runs cloud first, then falls back to local OCR on failure. - --cloud-only disables local OCR entirely.