Skip to content

2.6.0

Choose a tag to compare

@bogorad bogorad released this 14 Feb 15:50
· 21 commits to master since this release

Release 2.6.0

Date: 2026-02-14

This release adds free-form lasso selection, polygon-masked OCR capture, and configurable default selection mode for both resident and run-once flows.

Highlights

  • Added lasso selection mode in the Windows overlay (Space toggles between rectangle and lasso).
  • Added close-loop completion rule for lasso (release mouse near start point).
  • Added polygon masking before OCR: outside-lasso pixels are filled white.
  • Added DEFAULT_MODE config and --default-mode argument.
  • Added embedded custom lasso cursor for lasso mode.
  • Improved resident key handling reliability for Space and Escape.

.env and Environment Variables

The app loads configuration from:

  1. .env in the executable directory.
  2. If that file does not exist, path from SCREEN_OCR_LLM (must point to a .env-style file).

Example .env:

OPENROUTER_API_KEY=<your_api_key>
MODEL=qwen/qwen3-vl-235b-a22b-instruct

# Optional
OPENROUTER_API_KEY_FILE=/run/secrets/api_keys/openrouter
HOTKEY=Ctrl+Alt+Q
ENABLE_FILE_LOGGING=true
PROVIDERS=chutes/bf16,phala,fireworks,parasail/fp8
OCR_DEADLINE_SEC=20
DEFAULT_MODE=rectangle
SINGLEINSTANCE_PORT_START=49500
SINGLEINSTANCE_PORT_END=49550

DEFAULT_MODE accepted values:

  • rectangle
  • rect
  • lasso

Any invalid value falls back to rectangle.

CLI Arguments

Supported arguments in 2.6.0:

  • --run-once
  • --api-key-path <path>
  • --default-mode <rect|rectangle|lasso>

Legacy single-dash long forms are still normalized:

  • -run-once
  • -api-key-path
  • -default-mode

Examples:

# Resident mode
./screen-ocr-llm.exe

# One-shot mode
./screen-ocr-llm.exe --run-once

# One-shot with API key file override
./screen-ocr-llm.exe --run-once --api-key-path /run/secrets/api_keys/openrouter_key

# One-shot with lasso default mode
./screen-ocr-llm.exe --run-once --default-mode lasso

Precedence Rules

Config File Source Precedence

  1. Executable-local .env
  2. SCREEN_OCR_LLM path (only when executable-local .env is missing)

API Key File Path Precedence

  1. Built-in default: /run/secrets/api_keys/openrouter
  2. Process env: OPENROUTER_API_KEY_FILE
  3. Loaded .env: OPENROUTER_API_KEY_FILE
  4. CLI arg: --api-key-path (highest)

API Key Value Precedence

  1. Content read from resolved API key file path (if file exists and is non-empty)
  2. OPENROUTER_API_KEY

Default Selection Mode Precedence

  1. CLI arg: --default-mode
  2. DEFAULT_MODE from environment/config
  3. Fallback: rectangle

Delegation Behavior (Run-Once vs Resident)

If --run-once finds an active resident instance, it delegates the request and exits.

In delegated mode, resident configuration remains authoritative. Client-side --api-key-path and --default-mode do not override the resident process config.

Upgrade Notes

  • No breaking API changes for OCR/LLM payloads: images sent to model APIs remain rectangular.
  • Lasso improves OCR quality by masking outside pixels while preserving existing pipeline contracts.
  • Existing rectangle behavior remains default unless overridden.