This example shows how to use ReliaPrompt as a library in your service: define prompts and tests in code, run them from unit tests, and optionally use the UI in library mode.
From the relia-prompt repo root:
cd example
bun installEdit reliaprompt.definitions.ts to define prompts and test cases with definePrompt, defineTestCase, and defineSuite. Export a suites array for the UI and tests.
# Unit test (validates suite shape; skips real LLM run if OPENAI_API_KEY is not set)
bun test
# With real LLM run (set OPENAI_API_KEY)
OPENAI_API_KEY=sk-... bun testFrom relia-prompt repo root (so the example is the "project"):
cd example
NODE_ENV=development bun run ../src/cli-ui.tsOr from this directory after linking:
bun run reliaprompt:uiThen open http://localhost:3000. You should see the "extract-entities" prompt and its test cases (read-only). Configure LLM keys in the UI and run tests with required model selection.