Document local CLI setup and harden live search suggestions

This commit is contained in:
master
2026-03-07 03:12:40 +02:00
parent 5e15ab15b1
commit 28932d4a85
10 changed files with 551 additions and 24 deletions

View File

@@ -123,14 +123,61 @@ CREATE EXTENSION IF NOT EXISTS vector; -- optional; enables pgvector
Migrations run automatically when the service starts (`EnsureSchemaAsync()`). Or run them manually via the service:
```bash
# Configure connection string and rebuild the index (runs migrations + full index rebuild)
export AdvisoryAI__KnowledgeSearch__ConnectionString="Host=localhost;Port=55432;Database=advisoryai_knowledge_test;Username=stellaops_knowledge;Password=stellaops_knowledge"
# Configure connection string for the local AdvisoryAI WebService
export ADVISORYAI__AdvisoryAI__KnowledgeSearch__ConnectionString="Host=localhost;Port=55432;Database=advisoryai_knowledge_test;Username=stellaops_knowledge;Password=stellaops_knowledge"
export ADVISORYAI__AdvisoryAI__KnowledgeSearch__RepositoryRoot="$(pwd)"
```
# Using CLI
stella advisoryai index rebuild --json
#### CLI availability in a source checkout
# Or via HTTP (service must be running)
curl -X POST https://localhost:10450/v1/advisory-ai/index/rebuild \
Do not assume `stella` already exists on `PATH` in a local repo checkout.
Build or run the CLI from source first, or use the HTTP endpoints directly.
Quick links:
- Local CLI build and usage note: `docs/API_CLI_REFERENCE.md`
- CLI quickstart: `docs/modules/cli/guides/quickstart.md`
Build or publish the CLI from this repository:
```bash
# One-shot invocation without installing to PATH
dotnet run --project "src/Cli/StellaOps.Cli/StellaOps.Cli.csproj" -- advisoryai sources prepare --json
# Publish a reusable local binary
dotnet publish "src/Cli/StellaOps.Cli/StellaOps.Cli.csproj" -c Release -o ".artifacts/stella-cli"
# Windows
.artifacts/stella-cli/StellaOps.Cli.exe advisoryai index rebuild --json
# Linux/macOS
./.artifacts/stella-cli/StellaOps.Cli advisoryai index rebuild --json
```
#### Recommended live rebuild order
For live search and Playwright suggestion tests, rebuild both indexes in this order:
```bash
# 1. Knowledge corpus: docs + OpenAPI + Doctor checks
dotnet run --project "src/Cli/StellaOps.Cli/StellaOps.Cli.csproj" -- advisoryai sources prepare --json
dotnet run --project "src/Cli/StellaOps.Cli/StellaOps.Cli.csproj" -- advisoryai index rebuild --json
# 2. Unified domain overlays: platform, graph, scanner, timeline, opsmemory
curl -X POST http://127.0.0.1:10451/v1/search/index/rebuild \
-H "X-StellaOps-Scopes: advisory-ai:admin" \
-H "X-StellaOps-Tenant: test-tenant"
```
Or use HTTP only when the CLI is not built yet:
```bash
# 1. Knowledge corpus rebuild
curl -X POST http://127.0.0.1:10451/v1/advisory-ai/index/rebuild \
-H "X-StellaOps-Scopes: advisory-ai:admin" \
-H "X-StellaOps-Tenant: test-tenant"
# 2. Unified overlay rebuild
curl -X POST http://127.0.0.1:10451/v1/search/index/rebuild \
-H "X-StellaOps-Scopes: advisory-ai:admin" \
-H "X-StellaOps-Tenant: test-tenant"
```