Files
wehub-resource-sync 26382a7ac6
CI / Clippy (push) Failing after 15m13s
CI / Test (ubuntu-latest) (push) Failing after 16m1s
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Build (no embeddings / no ORT) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Cookbook (Node) (push) Has been cancelled
CI / Pi Extension (Node) (push) Has been cancelled
CI / Rust SDK (lean-ctx-client) (push) Has been cancelled
CI / Embed SDK (lean-ctx-sdk) (push) Has been cancelled
CI / Python SDK (leanctx) (push) Has been cancelled
CI / Hermes Plugin (Python) (push) Has been cancelled
CI / SDK Conformance Matrix (push) Has been cancelled
CI / Coverage (push) Has been cancelled
CI / cargo-deny (push) Has been cancelled
CI / Adversarial Safety (push) Has been cancelled
CI / Benchmarks (push) Has been cancelled
CI / Output-Quality Gate (eval A/B) (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / CI Green (push) Has been cancelled
JetBrains Plugin / Actionlint (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (rust) (push) Has been cancelled
JetBrains Plugin / Validation (push) Has been cancelled
JetBrains Plugin / Build (push) Has been cancelled
JetBrains Plugin / Test (push) Has been cancelled
Security Check / Security Scan (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:30 +08:00
..

LeanCTX Cookbook

Praktische, echte Beispiele (ohne Mock-Daten), die gegen einen laufenden lean-ctx serve arbeiten.

Voraussetzungen

  • Node.js 22+
  • Ein laufender LeanCTX HTTP Server:
lean-ctx serve --host 127.0.0.1 --port 8080 --project-root /path/to/project

Wenn du lean-ctx noch nicht installiert hast:

cd ../rust
cargo run --release --bin lean-ctx -- serve --host 127.0.0.1 --port 8080 --project-root ..

Setup

cd cookbook
npm ci

Konfiguration (ENV)

  • LEANCTX_BASE_URL (default: http://127.0.0.1:8080)
  • LEANCTX_BEARER_TOKEN (optional)
    • Nur nötig, wenn du den Server mit --auth-token <token> startest oder non-loopback bindest.

Beispiele

Quickstart CLI

cd cookbook
npm run quickstart

Memory Policy Playground (T1/T3/T4)

Erzeugt echte Facts, gibt Feedback, verknüpft Facts und zeigt das Mermaid-Diagramm.

cd cookbook
npm run memory-playground

Knowledge Graph Explorer (Web)

Lokale Web-UI, die Facts und Relations (Mermaid) über Tool-Calls anzeigt.

cd cookbook
npm run graph-explorer

Die App nutzt einen Dev-Proxy (/leanctx), damit im Browser kein CORS-Setup nötig ist. Falls dein lean-ctx serve nicht auf http://127.0.0.1:8080 läuft:

cd cookbook
VITE_LEANCTX_BASE_URL="http://127.0.0.1:8080" npm run graph-explorer

Troubleshooting

  • ECONNREFUSED: Server läuft nicht oder falsches LEANCTX_BASE_URL.
  • 401 Unauthorized: LEANCTX_BEARER_TOKEN setzen (und Server mit --auth-token starten).