smart_ide/services/chandra/run-chandra.sh
4NK a1ac5ae66b Add Chandra OCR service (datalab-to upstream submodule, CLI wrapper)
- Submodule services/chandra/upstream (shallow), run-chandra.sh, .env.example
- Docs: service-chandra, chandra-ocr-documents; link from PageIndex feature
- Index updates in docs/README, repo/README, services, system-architecture
2026-04-03 22:27:18 +02:00

19 lines
599 B
Bash
Executable File

#!/usr/bin/env bash
# Run Chandra OCR CLI from vendored upstream (PDF / images → md/html/json).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
UP="${ROOT}/upstream"
if [[ ! -d "${UP}/chandra" ]]; then
echo "Missing ${UP}/chandra — run: git submodule update --init services/chandra/upstream" >&2
exit 1
fi
cd "${UP}"
if [[ -x "${UP}/.venv/bin/chandra" ]]; then
exec "${UP}/.venv/bin/chandra" "$@"
fi
if command -v uv >/dev/null 2>&1; then
exec uv run chandra "$@"
fi
echo "Install first: cd ${UP} && uv sync (or python -m venv .venv && pip install -e .)" >&2
exit 1