@tryformation/querylight-cli 0.2.5 → 0.2.6

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/Dockerfile CHANGED
@@ -1,5 +1,10 @@
1
1
  FROM node:22-slim
2
2
  WORKDIR /app
3
+ RUN apt-get update \
4
+ && apt-get install -y --no-install-recommends curl ca-certificates \
5
+ && rm -rf /var/lib/apt/lists/* \
6
+ && curl -LsSf https://astral.sh/uv/install.sh | sh
7
+ ENV PATH="/root/.local/bin:${PATH}"
3
8
  COPY package.json package-lock.json ./
4
9
  RUN npm ci
5
10
  COPY . .
package/README.md CHANGED
@@ -15,6 +15,7 @@ It is designed for local, inspectable workflows:
15
15
  - normalize content into Markdown-like text
16
16
  - chunk documents for retrieval
17
17
  - build a portable local Querylight index
18
+ - package a workspace as a zip for deployment
18
19
  - search and generate retrieval context for external agents and tools
19
20
  - serve an OpenSearch-like `_search` API over one or more local knowledge bases
20
21
  - inspect workspace state, diffs, and change reports
@@ -105,10 +106,17 @@ Build the knowledge base:
105
106
  qli ingest
106
107
  ```
107
108
 
109
+ Package it for deployment:
110
+
111
+ ```bash
112
+ qli package ./docs-kb.zip
113
+ ```
114
+
108
115
  Search it:
109
116
 
110
117
  ```bash
111
118
  qli search "API authentication"
119
+ qli search --workspace ./docs-kb.zip "API authentication"
112
120
  qli search --source-type rss --since 2026-05-01 --has-publication-date
113
121
  qli search-json '{"query":{"match":{"text":"API authentication"}},"size":5}'
114
122
  curl -X POST http://127.0.0.1:3000/_search \
@@ -136,7 +144,7 @@ qli serve
136
144
 
137
145
  `qli serve` loads the current workspace index once at startup and reuses it for each request.
138
146
  Use `POST /_search` or `POST /<configured-index-name>/_search` for a single workspace.
139
- Use `POST /<directory-name>/_search` when `--workspace` points to a directory whose children each contain their own `.kb` workspace.
147
+ Use `POST /<directory-name>/_search` when `--workspace` points to a directory whose children are packaged `.zip` workspaces or directories that contain `.kb`.
140
148
 
141
149
  ## Example Skill: `qli` with `bunx` and `uv`
142
150
 
@@ -241,6 +249,22 @@ Use a custom workspace with:
241
249
  qli --workspace ./my-kb <command>
242
250
  ```
243
251
 
252
+ Package a built workspace with:
253
+
254
+ ```bash
255
+ qli package ./docs-kb.zip --workspace ./my-kb
256
+ ```
257
+
258
+ Read-only commands can use the zip directly:
259
+
260
+ ```bash
261
+ qli search --workspace ./docs-kb.zip "authentication"
262
+ qli context --workspace ./docs-kb.zip "How does auth work?"
263
+ qli serve --workspace ./docs-kb.zip
264
+ ```
265
+
266
+ Zip workspaces are read-only. Rebuild the directory workspace and package it again when source content changes.
267
+
244
268
  Control the default remote concurrency in `config.yaml`:
245
269
 
246
270
  ```yaml
@@ -292,6 +316,8 @@ All commands support:
292
316
  --verbose
293
317
  ```
294
318
 
319
+ `--workspace` accepts a directory workspace. Read-only commands also accept a packaged `.zip` workspace.
320
+
295
321
  Long-running commands print progress to stderr by default. Use `--silent` to suppress progress output. Use `--json` when another tool needs stable structured output.
296
322
 
297
323
  ### Initialize
@@ -302,6 +328,16 @@ qli init --workspace ./kb
302
328
  qli init --force
303
329
  ```
304
330
 
331
+ ### Package
332
+
333
+ ```bash
334
+ qli package ./docs-kb.zip
335
+ qli package ./deploy/docs-kb.zip --workspace ./docs/.kb
336
+ qli package ./docs-kb.zip --force --json
337
+ ```
338
+
339
+ The archive stores workspace contents at the zip root. Use the zip with `search`, `search-json`, `related`, `context`, `status`, `doctor`, and `serve`.
340
+
305
341
  ### Manage Sources
306
342
 
307
343
  Add sources:
@@ -404,11 +440,12 @@ Serve the lexical index over HTTP:
404
440
  ```bash
405
441
  qli serve
406
442
  qli serve --workspace ./docs/.kb --port 4000
443
+ qli serve --workspace ./docs-kb.zip --port 4000
407
444
  qli serve --workspace ./kbs --host 0.0.0.0 --port 4000
408
445
  ```
409
446
 
410
447
  For a single workspace, use `POST /_search` or `POST /<configured-index-name>/_search`.
411
- For a directory of knowledge bases, use `POST /<directory-name>/_search`.
448
+ For a directory of knowledge bases, use `POST /<directory-name>/_search`. Child `.zip` files use the file stem as the route name.
412
449
  The request body must be a Querylight JSON DSL object.
413
450
 
414
451
  ### Change Inspection