Local development
One-time setup
See Getting started for prerequisites (KiCad 10,
Python 3.10+, Node.js, Rust, uv). Then:
Backend
cd services/api
uv venv && uv pip install -e .Frontend
cd apps/desktop
npm installAPI key
Put ANTHROPIC_API_KEY=… into services/api/.env.
The dev loop
Boot the FastAPI service and the Tauri shell (which boots Vite) together:
./scripts/dev.shBackend only
Useful when iterating on the Python service:
cd services/api
.venv/bin/uvicorn pinflow_api.main:app --host 127.0.0.1 --port 8787 --reloadFrontend build / typecheck
cd apps/desktop
npm run build # tsc + vite build
npm run tauri dev # what scripts/dev.sh runsDebugging the agent loop
When the agent misbehaves on a prompt and you need to see why,
services/api/scripts/trace_chat.py runs the chat loop in-process with a
full-fidelity trace tap — every prompt, every model response, and every tool
call’s complete input and output (the things the normal streaming path
truncates or omits):
cd services/api
.venv/bin/python scripts/trace_chat.py --helpThe agent can stage and commit edits to a real .kicad_sch. When tracing
a prompt that might commit, point it at a throwaway copy (see the script’s
--sch option) or close KiCad first, so you don’t mutate a real project.
Tests
The end-to-end smoke scripts under services/api/scripts/ exercise the
datasheet → KiCad pipeline and need an API key plus a datasheet fixture. Vendor
datasheet fixtures are not checked in (IP); regenerate them as described in the
fixtures README before running those scripts.