@zvec/zvec-grep 0.1.5 → 0.1.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/README.md +88 -249
- package/README_CN.md +82 -246
- package/dist/authorization/index.d.ts +7 -0
- package/dist/authorization/index.js +7 -0
- package/dist/authorization/index.js.map +1 -0
- package/dist/authorization/manager.d.ts +8 -0
- package/dist/authorization/manager.js +19 -0
- package/dist/authorization/manager.js.map +1 -0
- package/dist/authorization/operation.d.ts +7 -0
- package/dist/authorization/operation.js +50 -0
- package/dist/authorization/operation.js.map +1 -0
- package/dist/authorization/planner.d.ts +21 -0
- package/dist/authorization/planner.js +97 -0
- package/dist/authorization/planner.js.map +1 -0
- package/dist/authorization/prompt.d.ts +11 -0
- package/dist/authorization/prompt.js +62 -0
- package/dist/authorization/prompt.js.map +1 -0
- package/dist/authorization/store.d.ts +20 -0
- package/dist/authorization/store.js +251 -0
- package/dist/authorization/store.js.map +1 -0
- package/dist/authorization/target.d.ts +15 -0
- package/dist/authorization/target.js +49 -0
- package/dist/authorization/target.js.map +1 -0
- package/dist/authorization/types.d.ts +61 -0
- package/dist/authorization/types.js +2 -0
- package/dist/authorization/types.js.map +1 -0
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.js +304 -54
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth.d.ts +21 -0
- package/dist/cli/auth.js +212 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/commands.js +433 -618
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/errors.js +2 -2
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/format/context.d.ts +1 -0
- package/dist/cli/format/context.js +241 -45
- package/dist/cli/format/context.js.map +1 -1
- package/dist/cli/format/debug.js +2 -2
- package/dist/cli/format/debug.js.map +1 -1
- package/dist/cli/format/progress.d.ts +4 -0
- package/dist/cli/format/progress.js +219 -46
- package/dist/cli/format/progress.js.map +1 -1
- package/dist/cli/format/status.d.ts +77 -6
- package/dist/cli/format/status.js +302 -106
- package/dist/cli/format/status.js.map +1 -1
- package/dist/cli/help.js +258 -59
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/cli/install.d.ts +4 -0
- package/dist/cli/install.js +845 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/managed-rg.d.ts +10 -0
- package/dist/cli/managed-rg.js +329 -0
- package/dist/cli/managed-rg.js.map +1 -0
- package/dist/cli/types.d.ts +20 -6
- package/dist/cli/types.js.map +1 -1
- package/dist/client/daemon-client.d.ts +19 -0
- package/dist/client/daemon-client.js +180 -0
- package/dist/client/daemon-client.js.map +1 -0
- package/dist/client/mode-router.d.ts +9 -0
- package/dist/client/mode-router.js +28 -0
- package/dist/client/mode-router.js.map +1 -0
- package/dist/client/search-policy.d.ts +11 -0
- package/dist/client/search-policy.js +15 -0
- package/dist/client/search-policy.js.map +1 -0
- package/dist/daemon/backend.d.ts +76 -0
- package/dist/daemon/backend.js +1049 -0
- package/dist/daemon/backend.js.map +1 -0
- package/dist/daemon/change-set.d.ts +25 -0
- package/dist/daemon/change-set.js +101 -0
- package/dist/daemon/change-set.js.map +1 -0
- package/dist/daemon/config.d.ts +24 -0
- package/dist/daemon/config.js +88 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/errors.d.ts +5 -0
- package/dist/daemon/errors.js +11 -0
- package/dist/daemon/errors.js.map +1 -0
- package/dist/daemon/http-server.d.ts +30 -0
- package/dist/daemon/http-server.js +287 -0
- package/dist/daemon/http-server.js.map +1 -0
- package/dist/daemon/index-coordinator.d.ts +23 -0
- package/dist/daemon/index-coordinator.js +68 -0
- package/dist/daemon/index-coordinator.js.map +1 -0
- package/dist/daemon/job-scheduler.d.ts +70 -0
- package/dist/daemon/job-scheduler.js +366 -0
- package/dist/daemon/job-scheduler.js.map +1 -0
- package/dist/daemon/logger.d.ts +9 -0
- package/dist/daemon/logger.js +53 -0
- package/dist/daemon/logger.js.map +1 -0
- package/dist/daemon/model-pool.d.ts +45 -0
- package/dist/daemon/model-pool.js +187 -0
- package/dist/daemon/model-pool.js.map +1 -0
- package/dist/daemon/root-lease.d.ts +14 -0
- package/dist/daemon/root-lease.js +188 -0
- package/dist/daemon/root-lease.js.map +1 -0
- package/dist/daemon/root-runtime.d.ts +78 -0
- package/dist/daemon/root-runtime.js +333 -0
- package/dist/daemon/root-runtime.js.map +1 -0
- package/dist/daemon/runtime-manager.d.ts +45 -0
- package/dist/daemon/runtime-manager.js +243 -0
- package/dist/daemon/runtime-manager.js.map +1 -0
- package/dist/daemon/runtime.d.ts +12 -0
- package/dist/daemon/runtime.js +102 -0
- package/dist/daemon/runtime.js.map +1 -0
- package/dist/daemon/server-controller.d.ts +39 -0
- package/dist/daemon/server-controller.js +203 -0
- package/dist/daemon/server-controller.js.map +1 -0
- package/dist/daemon/watch-manager.d.ts +50 -0
- package/dist/daemon/watch-manager.js +293 -0
- package/dist/daemon/watch-manager.js.map +1 -0
- package/dist/daemon/workspace-read-session-cache.d.ts +31 -0
- package/dist/daemon/workspace-read-session-cache.js +115 -0
- package/dist/daemon/workspace-read-session-cache.js.map +1 -0
- package/dist/engine/config.d.ts +30 -8
- package/dist/engine/config.js +171 -45
- package/dist/engine/config.js.map +1 -1
- package/dist/engine/{errors/index.d.ts → errors.d.ts} +6 -1
- package/dist/engine/{errors/details.js → errors.js} +17 -4
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/extraction/code/adapter.d.ts +1 -1
- package/dist/engine/extraction/code/extractor.d.ts +5 -11
- package/dist/engine/extraction/code/extractor.js +105 -44
- package/dist/engine/extraction/code/extractor.js.map +1 -1
- package/dist/engine/extraction/code/families/c-family.js +1 -1
- package/dist/engine/extraction/code/families/c-family.js.map +1 -1
- package/dist/engine/extraction/code/families/js-ts.d.ts +1 -1
- package/dist/engine/extraction/code/families/metadata.d.ts +1 -1
- package/dist/engine/extraction/code/tree-sitter/grammar.js.map +1 -0
- package/dist/engine/extraction/code/tree-sitter/nodes.js.map +1 -0
- package/dist/engine/extraction/code/tree-sitter/parser.js.map +1 -0
- package/dist/engine/extraction/image/extractor.d.ts +5 -0
- package/dist/engine/extraction/image/extractor.js +35 -0
- package/dist/engine/extraction/image/extractor.js.map +1 -0
- package/dist/engine/extraction/index.d.ts +3 -44
- package/dist/engine/extraction/index.js +1 -280
- package/dist/engine/extraction/index.js.map +1 -1
- package/dist/engine/extraction/markdown/extractor.d.ts +5 -11
- package/dist/engine/extraction/markdown/extractor.js +35 -16
- package/dist/engine/extraction/markdown/extractor.js.map +1 -1
- package/dist/engine/extraction/runtime.d.ts +4 -0
- package/dist/engine/extraction/runtime.js +26 -0
- package/dist/engine/extraction/runtime.js.map +1 -0
- package/dist/engine/extraction/source.d.ts +18 -0
- package/dist/engine/extraction/source.js +22 -0
- package/dist/engine/extraction/source.js.map +1 -0
- package/dist/engine/extraction/text/extractor.d.ts +7 -0
- package/dist/engine/extraction/text/extractor.js +168 -0
- package/dist/engine/extraction/text/extractor.js.map +1 -0
- package/dist/engine/extraction/types.d.ts +4 -0
- package/dist/engine/{models → extraction}/types.js.map +1 -1
- package/dist/engine/{files/file-type.d.ts → file-type.d.ts} +1 -1
- package/dist/engine/file-type.js.map +1 -0
- package/dist/engine/index-status.d.ts +9 -0
- package/dist/engine/index-status.js +38 -0
- package/dist/engine/index-status.js.map +1 -0
- package/dist/engine/manifest.d.ts +12 -0
- package/dist/engine/manifest.js +120 -0
- package/dist/engine/manifest.js.map +1 -0
- package/dist/engine/models/{providers/llama-cpp/embedding.d.ts → backends/llama-cpp.d.ts} +25 -20
- package/dist/engine/models/{providers/llama-cpp/embedding.js → backends/llama-cpp.js} +127 -106
- package/dist/engine/models/backends/llama-cpp.js.map +1 -0
- package/dist/engine/models/backends/model2vec.d.ts +57 -0
- package/dist/engine/models/backends/model2vec.js +332 -0
- package/dist/engine/models/backends/model2vec.js.map +1 -0
- package/dist/engine/models/backends/qwen.d.ts +44 -0
- package/dist/engine/models/{providers/qwen/embedding.js → backends/qwen.js} +155 -94
- package/dist/engine/models/backends/qwen.js.map +1 -0
- package/dist/engine/models/backends/transformers-js.d.ts +87 -0
- package/dist/engine/models/backends/transformers-js.js +316 -0
- package/dist/engine/models/backends/transformers-js.js.map +1 -0
- package/dist/engine/models/catalog.d.ts +188 -23
- package/dist/engine/models/catalog.js +172 -25
- package/dist/engine/models/catalog.js.map +1 -1
- package/dist/engine/models/download-progress.d.ts +15 -0
- package/dist/engine/models/download-progress.js +48 -0
- package/dist/engine/models/download-progress.js.map +1 -0
- package/dist/engine/models/embeddings.d.ts +58 -18
- package/dist/engine/models/embeddings.js +52 -28
- package/dist/engine/models/embeddings.js.map +1 -1
- package/dist/engine/models/factory.d.ts +2 -5
- package/dist/engine/models/factory.js +41 -56
- package/dist/engine/models/factory.js.map +1 -1
- package/dist/engine/models/index.d.ts +4 -6
- package/dist/engine/models/index.js +4 -4
- package/dist/engine/models/index.js.map +1 -1
- package/dist/engine/models/ranking.d.ts +7 -3
- package/dist/engine/models/resolution.d.ts +8 -0
- package/dist/engine/models/resolution.js +22 -0
- package/dist/engine/models/resolution.js.map +1 -0
- package/dist/engine/pipeline/indexing/index.d.ts +9 -7
- package/dist/engine/pipeline/indexing/index.js +360 -121
- package/dist/engine/pipeline/indexing/index.js.map +1 -1
- package/dist/engine/pipeline/indexing/root-paths.js +6 -6
- package/dist/engine/pipeline/indexing/root-paths.js.map +1 -1
- package/dist/engine/pipeline/indexing/scanner/index.d.ts +6 -1
- package/dist/engine/pipeline/indexing/scanner/index.js +233 -29
- package/dist/engine/pipeline/indexing/scanner/index.js.map +1 -1
- package/dist/engine/pipeline/search/index.d.ts +6 -6
- package/dist/engine/pipeline/search/index.js +8 -10
- package/dist/engine/pipeline/search/index.js.map +1 -1
- package/dist/engine/service/index.d.ts +3 -2
- package/dist/engine/service/index.js +1 -1
- package/dist/engine/service/index.js.map +1 -1
- package/dist/engine/service/root.d.ts +13 -12
- package/dist/engine/service/root.js +35 -24
- package/dist/engine/service/root.js.map +1 -1
- package/dist/engine/service/structure-enrichment.js +12 -14
- package/dist/engine/service/structure-enrichment.js.map +1 -1
- package/dist/engine/service/types.d.ts +32 -37
- package/dist/engine/service/workspace-index.d.ts +24 -0
- package/dist/engine/service/workspace-index.js +151 -0
- package/dist/engine/service/workspace-index.js.map +1 -0
- package/dist/engine/service/zvec-grep.d.ts +12 -1
- package/dist/engine/service/zvec-grep.js +677 -486
- package/dist/engine/service/zvec-grep.js.map +1 -1
- package/dist/engine/storage/index.d.ts +8 -4
- package/dist/engine/storage/index.js +1 -1
- package/dist/engine/storage/index.js.map +1 -1
- package/dist/engine/storage/zvec.d.ts +10 -33
- package/dist/engine/storage/zvec.js +95 -38
- package/dist/engine/storage/zvec.js.map +1 -1
- package/dist/engine/types.d.ts +15 -23
- package/dist/engine/types.js +1 -1
- package/dist/engine/types.js.map +1 -1
- package/dist/engine/utils/daemon-lease.d.ts +17 -0
- package/dist/engine/utils/daemon-lease.js +175 -0
- package/dist/engine/utils/daemon-lease.js.map +1 -0
- package/dist/engine/utils/file-selection.js +38 -1
- package/dist/engine/utils/file-selection.js.map +1 -1
- package/dist/engine/utils/lock.js +1 -1
- package/dist/engine/utils/lock.js.map +1 -1
- package/dist/index-progress.d.ts +10 -0
- package/dist/index-progress.js +159 -0
- package/dist/index-progress.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/http-transport.d.ts +27 -0
- package/dist/mcp/http-transport.js +182 -0
- package/dist/mcp/http-transport.js.map +1 -0
- package/dist/mcp/input-normalization.d.ts +38 -0
- package/dist/mcp/input-normalization.js +95 -0
- package/dist/mcp/input-normalization.js.map +1 -0
- package/dist/mcp/progress-heartbeat.d.ts +17 -0
- package/dist/mcp/progress-heartbeat.js +46 -0
- package/dist/mcp/progress-heartbeat.js.map +1 -0
- package/dist/mcp/request-metadata.d.ts +2 -0
- package/dist/mcp/request-metadata.js +11 -0
- package/dist/mcp/request-metadata.js.map +1 -0
- package/dist/mcp/request-state.d.ts +40 -0
- package/dist/mcp/request-state.js +210 -0
- package/dist/mcp/request-state.js.map +1 -0
- package/dist/mcp/result-format.d.ts +13 -0
- package/dist/mcp/result-format.js +75 -0
- package/dist/mcp/result-format.js.map +1 -0
- package/dist/mcp/schemas.d.ts +430 -0
- package/dist/mcp/schemas.js +447 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/tools.d.ts +150 -0
- package/dist/mcp/tools.js +448 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/toolset.d.ts +5 -0
- package/dist/mcp/toolset.js +12 -0
- package/dist/mcp/toolset.js.map +1 -0
- package/dist/observability/trace-context.d.ts +11 -0
- package/dist/observability/trace-context.js +138 -0
- package/dist/observability/trace-context.js.map +1 -0
- package/docs/01-agents.md +111 -0
- package/docs/02-cli.md +229 -0
- package/docs/03-mcp.md +167 -0
- package/docs/04-pipeline.md +218 -0
- package/docs/05-architecture.md +86 -0
- package/docs/06-server.md +210 -0
- package/docs/07-embedding.md +179 -0
- package/docs/08-roadmap.md +85 -0
- package/docs/README.md +53 -0
- package/package.json +17 -8
- package/skills/zvec-grep/SKILL.md +43 -133
- package/skills/zvec-grep/agents/openai.yaml +2 -2
- package/skills/zvec-grep/references/cli-fallback.md +85 -0
- package/dist/cli/mcp.d.ts +0 -2
- package/dist/cli/mcp.js +0 -354
- package/dist/cli/mcp.js.map +0 -1
- package/dist/engine/collection/index.d.ts +0 -55
- package/dist/engine/collection/index.js +0 -710
- package/dist/engine/collection/index.js.map +0 -1
- package/dist/engine/errors/details.d.ts +0 -6
- package/dist/engine/errors/details.js.map +0 -1
- package/dist/engine/errors/index.js +0 -16
- package/dist/engine/errors/index.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/grammar.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/nodes.js.map +0 -1
- package/dist/engine/extraction/tree-sitter/parser.js.map +0 -1
- package/dist/engine/files/file-type.js.map +0 -1
- package/dist/engine/models/providers/index.d.ts +0 -2
- package/dist/engine/models/providers/index.js +0 -3
- package/dist/engine/models/providers/index.js.map +0 -1
- package/dist/engine/models/providers/llama-cpp/embedding.js.map +0 -1
- package/dist/engine/models/providers/llama-cpp/index.d.ts +0 -1
- package/dist/engine/models/providers/llama-cpp/index.js +0 -2
- package/dist/engine/models/providers/llama-cpp/index.js.map +0 -1
- package/dist/engine/models/providers/qwen/embedding.d.ts +0 -42
- package/dist/engine/models/providers/qwen/embedding.js.map +0 -1
- package/dist/engine/models/providers/qwen/index.d.ts +0 -1
- package/dist/engine/models/providers/qwen/index.js +0 -2
- package/dist/engine/models/providers/qwen/index.js.map +0 -1
- package/dist/engine/models/types.d.ts +0 -30
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.js +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.js +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.d.ts +0 -0
- /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.js +0 -0
- /package/dist/engine/{models → extraction}/types.js +0 -0
- /package/dist/engine/{files/file-type.js → file-type.js} +0 -0
package/README.md
CHANGED
|
@@ -3,305 +3,144 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
|
+
<p>
|
|
7
|
+
<a href="./docs/08-roadmap.md"><img src="https://img.shields.io/badge/status-work%20in%20progress-F59E0B?style=for-the-badge" alt="Work in progress" /></a>
|
|
8
|
+
</p>
|
|
6
9
|
<picture>
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="
|
|
8
|
-
<img src="
|
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="./.github/assets/zg-logo-dark.svg">
|
|
11
|
+
<img src="./.github/assets/zg-logo.svg" width="150" alt="zg logo" />
|
|
9
12
|
</picture>
|
|
13
|
+
<p><strong>Know the words—or don’t. Just zg.</strong></p>
|
|
14
|
+
<p>The local-first search layer for humans and agents.</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@zvec/zvec-grep"><img src="https://img.shields.io/npm/v/@zvec/zvec-grep.svg" alt="npm version" /></a>
|
|
18
|
+
<a href="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml"><img src="https://github.com/zvec-ai/zvec-grep/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
19
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0 license" /></a>
|
|
20
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22-blue.svg" alt="Node.js 22 or newer" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<a href="#tour">🎬 <strong>Tour</strong></a> |
|
|
25
|
+
<a href="#features">💫 <strong>Features</strong></a> |
|
|
26
|
+
<a href="#quickstart">🚀 <strong>Quickstart</strong></a> |
|
|
27
|
+
<a href="./docs/README.md">📚 <strong>Docs</strong></a> |
|
|
28
|
+
<a href="#benchmarks">📊 <strong>Benchmarks</strong></a> |
|
|
29
|
+
<a href="#community">🤝 <strong>Community</strong></a>
|
|
30
|
+
</p>
|
|
10
31
|
</div>
|
|
11
32
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"/></a>
|
|
16
|
-
<img src="https://img.shields.io/badge/node-%3E%3D22-blue.svg" alt="Node.js >=22"/>
|
|
17
|
-
<img src="https://img.shields.io/badge/CLI-zg-2ea44f.svg" alt="zg CLI"/>
|
|
18
|
-
</p>
|
|
33
|
+
**zg** (**z**vec-**g**rep) unifies ripgrep, BM25, and vector search behind
|
|
34
|
+
[one local-first interface](./docs/05-architecture.md). Use it directly from the
|
|
35
|
+
terminal, or let your agent use it for you.
|
|
19
36
|
|
|
20
|
-
<
|
|
21
|
-
<a href="#quickstart">🚀 <strong>Quickstart</strong></a> |
|
|
22
|
-
<a href="#features">💫 <strong>Features</strong></a> |
|
|
23
|
-
<a href="#installation">📦 <strong>Installation</strong></a> |
|
|
24
|
-
<a href="#models">🧠 <strong>Models</strong></a> |
|
|
25
|
-
<a href="#library-api">🛠️ <strong>Library API</strong></a>
|
|
26
|
-
</p>
|
|
37
|
+
<a id="tour"></a>
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
## 🎬 See it in action
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
<div align="center">
|
|
42
|
+
<img src="./.github/assets/zvec-grep-tour.gif" width="1000" alt="Install the agent integration, index a repository, and let the agent search it with zvec-grep" />
|
|
43
|
+
</div>
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
45
|
+
Install the integration once, index the workspace, then search from the terminal
|
|
46
|
+
or ask your agent naturally.
|
|
35
47
|
|
|
36
|
-
>
|
|
37
|
-
> **Command interface**
|
|
38
|
-
>
|
|
39
|
-
> - **Hybrid Code Search**: Query code with natural language, exact terms, or both in one command.
|
|
40
|
-
> - **Explicit Index Lifecycle**: New repositories require `zg index --embedding <model>`; agents do not silently create indexes.
|
|
41
|
-
> - **Automatic Refresh**: Existing anonymous indexes are checked and incrementally updated before normal queries.
|
|
42
|
-
> - **Token-Efficient Output**: Agent output defaults to `--preview none`; `--human` defaults to full source previews.
|
|
43
|
-
> - **No-Index Lexical Search**: `zg query --rg` provides managed ripgrep search without requiring an index.
|
|
48
|
+
<a id="features"></a>
|
|
44
49
|
|
|
45
|
-
##
|
|
50
|
+
## 💫 Why zg?
|
|
46
51
|
|
|
47
|
-
- **
|
|
48
|
-
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
- **
|
|
52
|
-
|
|
53
|
-
- **
|
|
54
|
-
|
|
55
|
-
- **Library API**: Use `createZvecGrep()` directly from Node.js tools, agents, or MCP servers.
|
|
52
|
+
- **Works out of the box** — one guided install connects zg to your agent on
|
|
53
|
+
macOS, Linux, or Windows; ask naturally, with no search syntax to learn.
|
|
54
|
+
- **All-in-one retrieval layer** — semantic discovery, BM25-ranked retrieval,
|
|
55
|
+
exact text, and regex search all stay behind zg.
|
|
56
|
+
- **Agent- and human-friendly** — compact, file-oriented context for agents
|
|
57
|
+
and readable terminal output for people, with less noise for both.
|
|
58
|
+
- **Local first, permission aware** — ripgrep, indexes, and local models stay
|
|
59
|
+
on your machine; remote embeddings require explicit authorization.
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
<a id="quickstart"></a>
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
## 🚀 Quickstart
|
|
60
64
|
|
|
61
|
-
|
|
62
|
-
npm install -g @zvec/zvec-grep
|
|
63
|
-
zg version
|
|
64
|
-
```
|
|
65
|
+
Requires Node.js 22 or newer on macOS, Linux, or Windows.
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
### 1. Install and connect your agent
|
|
67
68
|
|
|
68
69
|
```bash
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Install the latest source checkout as a global `zg` command:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
git clone https://github.com/zvec-ai/zvec-grep.git
|
|
76
|
-
cd zvec-grep
|
|
77
|
-
npm ci
|
|
78
|
-
npm run build
|
|
79
|
-
npm install -g .
|
|
80
|
-
zg version
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Run the stdio MCP server:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
zg serve --mcp
|
|
70
|
+
npm install -g @zvec/zvec-grep
|
|
71
|
+
zg install
|
|
87
72
|
```
|
|
88
73
|
|
|
89
|
-
|
|
74
|
+
`zg install` detects Codex, Claude Code, Cursor, and OpenCode and configures the
|
|
75
|
+
local MCP integration. See [Agent integrations](./docs/01-agents.md) for managed
|
|
76
|
+
configuration, permissions, and uninstall instructions. You can also select one
|
|
77
|
+
explicitly:
|
|
90
78
|
|
|
91
79
|
```bash
|
|
92
80
|
zg install --target codex --yes
|
|
93
81
|
```
|
|
94
82
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### ✅ Requirements
|
|
98
|
-
|
|
99
|
-
- Node.js 22 or newer
|
|
100
|
-
- macOS, Linux, or Windows
|
|
101
|
-
- A supported embedding model for indexed search
|
|
102
|
-
|
|
103
|
-
`zg query --rg` works without any embedding model or index.
|
|
104
|
-
|
|
105
|
-
## <a id="quickstart"></a>⚡ Quickstart
|
|
106
|
-
|
|
107
|
-
Index a repository with an explicit embedding model:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
zg index \
|
|
111
|
-
--embedding local/embeddinggemma-300m \
|
|
112
|
-
-g "src/**" \
|
|
113
|
-
-g "docs/**" \
|
|
114
|
-
-g "test/**" \
|
|
115
|
-
-g "!dist/**" \
|
|
116
|
-
-g "!node_modules/**" \
|
|
117
|
-
-g "!coverage/**"
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Check index state:
|
|
83
|
+
### 2. Index your repository
|
|
121
84
|
|
|
122
85
|
```bash
|
|
123
|
-
|
|
86
|
+
cd your-repository
|
|
87
|
+
zg index --embedding local/potion-code-16m-v2
|
|
124
88
|
```
|
|
125
89
|
|
|
126
|
-
|
|
90
|
+
This quickstart uses the lightweight
|
|
91
|
+
[Potion Code v2](./docs/07-embedding.md) model so you can build the first index
|
|
92
|
+
quickly. The first run downloads it; the index stays in `.zvec-grep/`, and later
|
|
93
|
+
updates only need `zg index`. See the
|
|
94
|
+
[retrieval pipeline](./docs/04-pipeline.md#indexing) to control scope, updates, and
|
|
95
|
+
rebuilds.
|
|
127
96
|
|
|
128
|
-
|
|
129
|
-
zg query "where query auto update happens"
|
|
130
|
-
```
|
|
97
|
+
### 3. Ask your agent
|
|
131
98
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
zg query "GPU fallback" --fts "usingCpuFallback" -g "src/**" -t ts --limit 5
|
|
99
|
+
```text
|
|
100
|
+
My app forgets dark mode every time I refresh. Find out why.
|
|
136
101
|
```
|
|
137
102
|
|
|
138
|
-
|
|
103
|
+
The agent uses zg for semantic discovery and ranked keyword retrieval, while
|
|
104
|
+
exact lexical lookup stays with native grep or rg. The
|
|
105
|
+
[MCP guide](./docs/03-mcp.md) describes the default search tool and the optional
|
|
106
|
+
full toolset, which retains managed rg.
|
|
139
107
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Switch to human-readable output:
|
|
108
|
+
To search directly from the terminal, use the same local layer. See the
|
|
109
|
+
[CLI guide](./docs/02-cli.md) for routes, filters, and output controls.
|
|
145
110
|
|
|
146
111
|
```bash
|
|
147
|
-
zg query --human "
|
|
112
|
+
zg query --human "theme preference persistence on startup" --limit 3
|
|
148
113
|
```
|
|
149
114
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
## <a id="models"></a>🧠 Models
|
|
153
|
-
|
|
154
|
-
Local models run through `node-llama-cpp` and keep code search private to your machine:
|
|
115
|
+
<a id="benchmarks"></a>
|
|
155
116
|
|
|
156
|
-
|
|
157
|
-
zg index --embedding local/embeddinggemma-300m
|
|
158
|
-
zg index --embedding local/qwen3-embedding-0.6b
|
|
159
|
-
```
|
|
117
|
+
## 📊 Benchmarks
|
|
160
118
|
|
|
161
|
-
|
|
119
|
+
> 🚧 **Work in progress.**
|
|
162
120
|
|
|
163
|
-
|
|
121
|
+
## 🗺️ Roadmap
|
|
164
122
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
--embedding qwen/text-embedding-v4 \
|
|
168
|
-
--api-key "$DASHSCOPE_API_KEY"
|
|
169
|
-
```
|
|
123
|
+
zg is moving toward richer multimodal formats, stronger hybrid retrieval, a
|
|
124
|
+
more out-of-the-box experience, and support from desktop to mobile.
|
|
170
125
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
```json
|
|
174
|
-
{
|
|
175
|
-
"version": 1,
|
|
176
|
-
"defaults": {
|
|
177
|
-
"embedding": "qwen/text-embedding-v4"
|
|
178
|
-
},
|
|
179
|
-
"providers": {
|
|
180
|
-
"qwen": {
|
|
181
|
-
"apiKey": "...",
|
|
182
|
-
"endpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings"
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
```
|
|
126
|
+
Explore the full [Roadmap](./docs/08-roadmap.md).
|
|
187
127
|
|
|
188
|
-
|
|
128
|
+
<a id="community"></a>
|
|
189
129
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
zg index --rebuild --embedding local/qwen3-embedding-0.6b
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## 🔎 Query Patterns
|
|
197
|
-
|
|
198
|
-
Multiple quoted queries are treated as separate search groups:
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
zg query "request validation" "error handling" --limit 5
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Route options each consume one query and can be repeated. Add `--fuse` when
|
|
205
|
-
you want all groups combined into one ranked result list:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
zg query \
|
|
209
|
-
--hybrid "authentication flow" \
|
|
210
|
-
--fts "AuthService" \
|
|
211
|
-
--vector "where credentials are validated" \
|
|
212
|
-
--fuse \
|
|
213
|
-
--limit 10
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
Use ripgrep-style path and file-type filters early to keep results focused.
|
|
217
|
-
Positive globs include paths and globs beginning with `!` exclude them:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
zg query "cache invalidation" \
|
|
221
|
-
-g "src/**" \
|
|
222
|
-
-g "!test/**" \
|
|
223
|
-
-g "!tests/**" \
|
|
224
|
-
-g "!fixtures/**" \
|
|
225
|
-
-g "!dist/**" \
|
|
226
|
-
-t ts
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
File-type filters are applied in addition to glob filters. For example,
|
|
230
|
-
`-g "docs/**" -t ts` selects TypeScript files under `docs`, not every file in
|
|
231
|
-
that directory.
|
|
232
|
-
|
|
233
|
-
Use `--preview` to control indexed source previews:
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
zg query "plugin lifecycle" --preview none
|
|
237
|
-
zg query "plugin lifecycle" --preview short --limit 5
|
|
238
|
-
zg query "plugin lifecycle" --preview full --limit 2
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
For exact text, symbols, flags, or error codes, use `--fts` or `--rg`:
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
zg query "authentication flow" --fts "AuthService" --fts "ForbiddenError"
|
|
245
|
-
zg query --rg -i -C 2 -g "*.ts" "needle text" src
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
Managed rg mode accepts common ripgrep matching, context, type, glob, ignore,
|
|
249
|
-
depth, size, symlink, encoding, and regex-engine options. Zvec-grep owns the
|
|
250
|
-
result format, so output-changing modes such as `--json`, `--count`, `--files`,
|
|
251
|
-
`-l`, `-o`, `--replace`, and `--vimgrep` are rejected. `.git/**` and
|
|
252
|
-
`.zvec-grep/**` remain excluded.
|
|
253
|
-
|
|
254
|
-
## <a id="library-api"></a>🛠️ Library API
|
|
255
|
-
|
|
256
|
-
```ts
|
|
257
|
-
import { createZvecGrep } from "@zvec/zvec-grep";
|
|
258
|
-
|
|
259
|
-
const zvecGrep = await createZvecGrep({
|
|
260
|
-
root: process.cwd(),
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
const result = await zvecGrep.context({
|
|
264
|
-
query: "ranking implementation",
|
|
265
|
-
limit: 5,
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
for (const item of result.items) {
|
|
269
|
-
const location =
|
|
270
|
-
item.range.kind === "text"
|
|
271
|
-
? `${item.file.relativePath}:${item.range.startLine}`
|
|
272
|
-
: item.file.relativePath;
|
|
273
|
-
console.log(location);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
await zvecGrep.close();
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
For explicit no-index lexical search:
|
|
280
|
-
|
|
281
|
-
```ts
|
|
282
|
-
const result = await zvecGrep.context({
|
|
283
|
-
query: "ZVEC_GREP_HOME",
|
|
284
|
-
rg: true,
|
|
285
|
-
});
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
## 🤝 Join the Zvec Community
|
|
130
|
+
## 🤝 Join Our Community
|
|
289
131
|
|
|
290
132
|
<div align="center">
|
|
291
133
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="DingTalk QR Code"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?
|
|
295
|
-
|
|
|
134
|
+
| 💬 DingTalk | 📱 WeChat | 🎮 Discord | X (Twitter) |
|
|
135
|
+
| :---: | :---: | :---: | :---: |
|
|
136
|
+
| <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/dingding.png" width="150" alt="DingTalk QR Code"/> | <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/qrcode/wechat.png?v1" width="150" alt="WeChat QR Code"/> | [](https://discord.gg/rKddFBBu9z) | [](<https://x.com/ZvecAI>) |
|
|
137
|
+
| Scan to join | Scan to join | Click to join | Click to follow |
|
|
296
138
|
|
|
297
139
|
</div>
|
|
298
140
|
|
|
299
141
|
## ❤️ Contributing
|
|
300
142
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
npm run check
|
|
305
|
-
```
|
|
143
|
+
Community contributions are always welcome—bug fixes, features, and
|
|
144
|
+
documentation improvements all help make zvec-grep better.
|
|
306
145
|
|
|
307
|
-
|
|
146
|
+
Check out our [Contributing Guide](./CONTRIBUTING.md) to get started!
|