Quickstart
Run the complete compile and render loop locally in one minute.
Run the offline demo
The repository includes a mock provider, sample text, and glossary. No API key is required.
git clone https://github.com/lexweave-hq/lexweave
cd lexweave
npm install
npm run build
npm run demoThe command succeeds when it exits with code 0 and creates both of these files:
examples/demo/sample-book.lexweave.json— the portable reading program.examples/demo/sample-book.html— the rendered adaptive reading view.
Open the HTML output and tap a highlighted target-language word. The word should reveal its source-language support without making a network request.
open examples/demo/sample-book.htmlVerify that reader state changes the output
Render the same source at two mastery levels. The first command should include more source-language support; the second should render familiar targets with less support.
node packages/cli/dist/lexweave.cjs render examples/demo/sample-book.txt \
--bundle examples/demo/sample-book.lexweave.json --format text --mastery 0
node packages/cli/dist/lexweave.cjs render examples/demo/sample-book.txt \
--bundle examples/demo/sample-book.lexweave.json --format text --mastery 3If the two outputs are identical, the mastery input did not affect the selected render path; inspect the bundle before integrating the renderer.
Compile your own text
node packages/cli/dist/lexweave.cjs compile book.txt \
--source zh \
--target en \
-o book.lexweave.jsonConfigure an Anthropic or OpenAI provider for a real compile. The provider is used only to produce the bundle.
Render and inspect
node packages/cli/dist/lexweave.cjs render book.txt \
--bundle book.lexweave.json \
-o book.html
node packages/cli/dist/lexweave.cjs inspect book.lexweave.jsonRendering does not require the original model provider or a network connection.
Common failure boundaries
| Failure object | Observable condition | Check |
|---|---|---|
| Build output | packages/cli/dist/lexweave.cjs is missing | Run npm run build from the repository root. |
| Provider configuration | A real compile reports a missing provider credential | Use --provider mock for the offline demo or configure the selected provider. |
| Source and bundle | Render reports spans that do not match the source | Render the exact source used to create the bundle. |
| Render result | The HTML exists but has no replacements | Run inspect and verify that the bundle contains candidate assets and annotations. |