#!/usr/bin/env bash # bin/docker-entrypoint - run 2dph tools inside the container. # # brain shell (default) # brain search bin/kb/search # brain index bin/kb/index # brain watch watchdog re-indexer # brain serve async Go HTTP server (serve/) # # Usage comment starts at line 2 (self-describing convention). set -euo pipefail CMD="${1:-shell}" shift || true case "$CMD" in shell) exec bash ;; search) exec "$KB_PY" /app/bin/kb/search "$@" ;; index) exec "$KB_PY" /app/bin/kb/index "$@" ;; watch) exec bash /app/bin/kb-watch "$@" ;; serve) exec /app/serve/serve "$@" ;; *) echo "unknown command: $CMD" >&2; exit 2 ;; esac