#!/usr/bin/env bash set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/_common.sh" ok() { c_green " ✓ $1"; } bad() { c_red " ✗ $1"; } warn() { c_yellow " ! $1"; } echo "Research-Link-AI dev-health" # Python if command -v python >/dev/null 2>&1; then ok "python: $(python --version 2>&1)"; else bad "python not found"; fi # Package manager if command -v pip >/dev/null 2>&1; then ok "pip available"; else warn "pip not found"; fi command -v uv >/dev/null 2>&1 && ok "uv available (optional)" || true # Backend import health if python -c "import researchlink.api.app" >/dev/null 2>&1; then ok "backend imports cleanly" else bad "backend import failed — run: pip install -e ." fi # Node (only if a frontend project exists) if [ -f "$FRONTEND_DIR/package.json" ]; then if command -v node >/dev/null 2>&1; then ok "node: $(node --version)"; else bad "node required for frontend but not found"; fi [ -d "$FRONTEND_DIR/node_modules" ] && ok "frontend deps installed" || warn "frontend deps missing — run: (cd frontend && npm install)" else c_dim " frontend: served by backend (no Node required)" fi # .env [ -f "$ROOT/.env" ] && ok ".env present" || warn ".env missing — 'make start' will create it from .env.example" # Ports port_in_use "127.0.0.1" "$BACKEND_PORT" && warn "backend port ${BACKEND_PORT} busy" || ok "backend port ${BACKEND_PORT} free" if [ -f "$FRONTEND_DIR/package.json" ]; then port_in_use "127.0.0.1" "$FRONTEND_PORT" && warn "frontend port ${FRONTEND_PORT} busy" || ok "frontend port ${FRONTEND_PORT} free" fi echo "Access URL: ${BACKEND_URL}/ (advertised host: ${ADV_HOST}, bind: ${BIND_HOST})" # LLM provider readiness echo "LLM mode: $LLM_MODE (model: $LLM_MODEL)" if is_external_mode; then [ "$(key_configured)" = "yes" ] && ok "API key configured for $LLM_MODE" || bad "API key missing for $LLM_MODE — set it in .env" else ok "offline / local mode — no API key required" fi