Files
PlantAI-rag-new/sdk/run.sh
T
jerryandClaude Fable 5 0875bb036c P0/M1: 四部分重构——frontend→ui、backend→sdk 改名 + 引用修复 + 骨架
- git mv 保留历史:ui/(Vue3+Vite)、sdk/(BFF 中间层)
- 路径语义修正:db_path/figures_cache 改相对 sdk/(BFF cwd),
  历史库 sdk/backend/data 迁移至 sdk/data/(会话/图片缓存无损)
- 引用修复 ~15 处:config.py、deploy/*.sh、vitest/playwright 配置、
  单测导入路径、docs、README、gitignore、.env.example
- 骨架:agent/{qa,methodology,legacy-rag,vendor}、knowledge/manifest.yaml、
  tooling/{compile,kb,crypto,assemble,audit,tools,scripts} + README
- 门禁验证:sdk pytest 125 通过、ui vitest 158 通过、
  生产 BFF 脚本重启四上游全绿 + 静态托管 + 会话库无损

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 12:56:47 +08:00

22 lines
780 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# run.sh —— 本地起 BFF(ARCHITECTURE.md §3:127.0.0.1:8090,占用则退 8091)。
# 用法:bash sdk/run.sh
set -euo pipefail
cd "$(dirname "$0")"
PORT="${PORT:-8090}"
if ! command -v conda >/dev/null 2>&1; then
echo "run.sh: 未找到 conda,尝试直接使用当前 python 运行" >&2
exec python -m uvicorn app.main:app --host 127.0.0.1 --port "$PORT"
fi
if ! conda env list | awk '{print $1}' | grep -qx "plantai-bff"; then
echo "run.sh: conda 环境 plantai-bff 不存在" >&2
echo " 创建:conda create -n plantai-bff python=3.11 -y && conda activate plantai-bff && pip install -e '.[dev]'" >&2
exit 1
fi
exec conda run --no-capture-output -n plantai-bff \
python -m uvicorn app.main:app --host 127.0.0.1 --port "$PORT"