fix: stay in project root after nix develop .#lightrag

Use subshells for cd to lightrag/ so user remains at repo root.
Add CLAUDE.md with purpose, architecture, and known issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 14:17:05 +08:00
parent 11168df880
commit 22e1e754b6
2 changed files with 84 additions and 8 deletions
+4 -8
View File
@@ -53,18 +53,14 @@
export UV_PROJECT_ENVIRONMENT="$VIRTUAL_ENV"
export UV_PYTHON="${pkgs.python312}/bin/python3.12"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.zlib ]}:$LD_LIBRARY_PATH"
cd "$RAGS_ROOT/lightrag"
echo "Syncing lightrag venv..."
uv sync --extra api --extra offline-llm --quiet
source .venv/bin/activate
(cd "$RAGS_ROOT/lightrag" && uv sync --extra api --extra offline-llm --quiet)
source "$RAGS_ROOT/lightrag/.venv/bin/activate"
if [ ! -d lightrag/api/webui ]; then
if [ ! -d "$RAGS_ROOT/lightrag/lightrag/api/webui" ]; then
echo "Building frontend (first time, ~1min)..."
cd lightrag_webui
bun install --frozen-lockfile --silent
bun run build:bun
cd ..
(cd "$RAGS_ROOT/lightrag/lightrag_webui" && bun install --frozen-lockfile --silent && bun run build:bun)
fi
if [ -f "$RAGS_ROOT/.env.lightrag" ]; then