@tryformation/querylight-cli 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,7 @@ It is designed for local, inspectable workflows:
16
16
  - chunk documents for retrieval
17
17
  - build a portable local Querylight index
18
18
  - search and generate retrieval context for external agents and tools
19
+ - serve an OpenSearch-like `_search` API over one or more local knowledge bases
19
20
  - inspect workspace state, diffs, and change reports
20
21
 
21
22
  ## Install
@@ -23,7 +24,7 @@ It is designed for local, inspectable workflows:
23
24
  Run without installing globally:
24
25
 
25
26
  ```bash
26
- bunx @tryformation/querylight-cli init
27
+ bunx --bun @tryformation/querylight-cli init
27
28
  ```
28
29
 
29
30
  For agent and Python automation examples that use `bunx` and `uv`, see [`examples/skills/qli-bunx-uv/SKILL.md`](https://github.com/formation-res/querylight-cli/blob/main/examples/skills/qli-bunx-uv/SKILL.md).
@@ -43,9 +44,11 @@ npx qli --help
43
44
  If you prefer to avoid a local install, use:
44
45
 
45
46
  ```bash
46
- bunx @tryformation/querylight-cli --help
47
+ bunx --bun @tryformation/querylight-cli --help
47
48
  ```
48
49
 
50
+ Use `bunx --bun` for repeated or concurrent `bunx` calls. `bunx` respects the CLI shebang by default and otherwise starts `qli` through `node`.
51
+
49
52
  ## Release
50
53
 
51
54
  Publish releases from semantic version tags such as `0.1.1`.
@@ -105,6 +108,10 @@ Search it:
105
108
  ```bash
106
109
  qli search "API authentication"
107
110
  qli search --source-type rss --since 2026-05-01 --has-publication-date
111
+ qli search-json '{"query":{"match":{"text":"API authentication"}},"size":5}'
112
+ curl -X POST http://127.0.0.1:3000/_search \
113
+ -H 'content-type: application/json' \
114
+ -d '{"query":{"match":{"text":"API authentication"}},"size":5}'
108
115
  ```
109
116
 
110
117
  Find related documents for an existing one:
@@ -119,6 +126,16 @@ Generate retrieval context:
119
126
  qli context "How do I authenticate API requests?" --top-k 8
120
127
  ```
121
128
 
129
+ Serve the lexical index over HTTP:
130
+
131
+ ```bash
132
+ qli serve
133
+ ```
134
+
135
+ `qli serve` loads the current workspace index once at startup and reuses it for each request.
136
+ Use `POST /_search` or `POST /<configured-index-name>/_search` for a single workspace.
137
+ Use `POST /<directory-name>/_search` when `--workspace` points to a directory whose children each contain their own `.kb` workspace.
138
+
122
139
  ## Example Skill: `qli` with `bunx` and `uv`
123
140
 
124
141
  The repository includes an example skill for running `qli` without a global install and calling it from Python with `uv`:
@@ -127,7 +144,7 @@ The repository includes an example skill for running `qli` without a global inst
127
144
 
128
145
  It covers:
129
146
 
130
- - running `qli` with `bunx @tryformation/querylight-cli`
147
+ - running `qli` with `bunx --bun @tryformation/querylight-cli`
131
148
  - using `--json` for automation and agents
132
149
  - calling `qli search` and `qli context` from Python with `subprocess`
133
150
 
@@ -361,6 +378,7 @@ qli search --source-type rss,page --since 2026-05-01 --has-publication-date --to
361
378
  qli search --source-name "Release Feed,Company Blog" --uri-prefix https://example.com/news,https://example.com/blog
362
379
  qli search --source-type rss,page --top-k 25 --json
363
380
  qli search "authentication" --json
381
+ qli search-json '{"query":{"bool":{"filter":[{"term":{"sourceType":"rss"}}]}},"size":10}' --json
364
382
  ```
365
383
 
366
384
  Build retrieval context:
@@ -370,6 +388,18 @@ qli context "How do I configure the API?"
370
388
  qli context "What changed in pricing?" --top-k 12 --max-chars 12000
371
389
  ```
372
390
 
391
+ Serve the lexical index over HTTP:
392
+
393
+ ```bash
394
+ qli serve
395
+ qli serve --workspace ./docs/.kb --port 4000
396
+ qli serve --workspace ./kbs --host 0.0.0.0 --port 4000
397
+ ```
398
+
399
+ For a single workspace, use `POST /_search` or `POST /<configured-index-name>/_search`.
400
+ For a directory of knowledge bases, use `POST /<directory-name>/_search`.
401
+ The request body must be a Querylight JSON DSL object.
402
+
373
403
  ### Change Inspection
374
404
 
375
405
  ```bash
@@ -1,4 +1,4 @@
1
- import type { RelatedDocumentResult, SearchResult, Source } from "../types/models.js";
1
+ import type { RelatedDocumentResult, SearchResponseData, Source } from "../types/models.js";
2
2
  export declare function formatSourcesTable(sources: Source[]): string;
3
- export declare function formatSearchResults(results: SearchResult[]): string;
3
+ export declare function formatSearchResults(response: SearchResponseData): string;
4
4
  export declare function formatRelatedDocuments(results: RelatedDocumentResult[]): string;