@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.
Files changed (317) hide show
  1. package/README.md +88 -249
  2. package/README_CN.md +82 -246
  3. package/dist/authorization/index.d.ts +7 -0
  4. package/dist/authorization/index.js +7 -0
  5. package/dist/authorization/index.js.map +1 -0
  6. package/dist/authorization/manager.d.ts +8 -0
  7. package/dist/authorization/manager.js +19 -0
  8. package/dist/authorization/manager.js.map +1 -0
  9. package/dist/authorization/operation.d.ts +7 -0
  10. package/dist/authorization/operation.js +50 -0
  11. package/dist/authorization/operation.js.map +1 -0
  12. package/dist/authorization/planner.d.ts +21 -0
  13. package/dist/authorization/planner.js +97 -0
  14. package/dist/authorization/planner.js.map +1 -0
  15. package/dist/authorization/prompt.d.ts +11 -0
  16. package/dist/authorization/prompt.js +62 -0
  17. package/dist/authorization/prompt.js.map +1 -0
  18. package/dist/authorization/store.d.ts +20 -0
  19. package/dist/authorization/store.js +251 -0
  20. package/dist/authorization/store.js.map +1 -0
  21. package/dist/authorization/target.d.ts +15 -0
  22. package/dist/authorization/target.js +49 -0
  23. package/dist/authorization/target.js.map +1 -0
  24. package/dist/authorization/types.d.ts +61 -0
  25. package/dist/authorization/types.js +2 -0
  26. package/dist/authorization/types.js.map +1 -0
  27. package/dist/cli/args.d.ts +1 -1
  28. package/dist/cli/args.js +304 -54
  29. package/dist/cli/args.js.map +1 -1
  30. package/dist/cli/auth.d.ts +21 -0
  31. package/dist/cli/auth.js +212 -0
  32. package/dist/cli/auth.js.map +1 -0
  33. package/dist/cli/commands.js +433 -618
  34. package/dist/cli/commands.js.map +1 -1
  35. package/dist/cli/errors.js +2 -2
  36. package/dist/cli/errors.js.map +1 -1
  37. package/dist/cli/format/context.d.ts +1 -0
  38. package/dist/cli/format/context.js +241 -45
  39. package/dist/cli/format/context.js.map +1 -1
  40. package/dist/cli/format/debug.js +2 -2
  41. package/dist/cli/format/debug.js.map +1 -1
  42. package/dist/cli/format/progress.d.ts +4 -0
  43. package/dist/cli/format/progress.js +219 -46
  44. package/dist/cli/format/progress.js.map +1 -1
  45. package/dist/cli/format/status.d.ts +77 -6
  46. package/dist/cli/format/status.js +302 -106
  47. package/dist/cli/format/status.js.map +1 -1
  48. package/dist/cli/help.js +258 -59
  49. package/dist/cli/help.js.map +1 -1
  50. package/dist/cli/index.js +0 -0
  51. package/dist/cli/install.d.ts +4 -0
  52. package/dist/cli/install.js +845 -0
  53. package/dist/cli/install.js.map +1 -0
  54. package/dist/cli/managed-rg.d.ts +10 -0
  55. package/dist/cli/managed-rg.js +329 -0
  56. package/dist/cli/managed-rg.js.map +1 -0
  57. package/dist/cli/types.d.ts +20 -6
  58. package/dist/cli/types.js.map +1 -1
  59. package/dist/client/daemon-client.d.ts +19 -0
  60. package/dist/client/daemon-client.js +180 -0
  61. package/dist/client/daemon-client.js.map +1 -0
  62. package/dist/client/mode-router.d.ts +9 -0
  63. package/dist/client/mode-router.js +28 -0
  64. package/dist/client/mode-router.js.map +1 -0
  65. package/dist/client/search-policy.d.ts +11 -0
  66. package/dist/client/search-policy.js +15 -0
  67. package/dist/client/search-policy.js.map +1 -0
  68. package/dist/daemon/backend.d.ts +76 -0
  69. package/dist/daemon/backend.js +1049 -0
  70. package/dist/daemon/backend.js.map +1 -0
  71. package/dist/daemon/change-set.d.ts +25 -0
  72. package/dist/daemon/change-set.js +101 -0
  73. package/dist/daemon/change-set.js.map +1 -0
  74. package/dist/daemon/config.d.ts +24 -0
  75. package/dist/daemon/config.js +88 -0
  76. package/dist/daemon/config.js.map +1 -0
  77. package/dist/daemon/errors.d.ts +5 -0
  78. package/dist/daemon/errors.js +11 -0
  79. package/dist/daemon/errors.js.map +1 -0
  80. package/dist/daemon/http-server.d.ts +30 -0
  81. package/dist/daemon/http-server.js +287 -0
  82. package/dist/daemon/http-server.js.map +1 -0
  83. package/dist/daemon/index-coordinator.d.ts +23 -0
  84. package/dist/daemon/index-coordinator.js +68 -0
  85. package/dist/daemon/index-coordinator.js.map +1 -0
  86. package/dist/daemon/job-scheduler.d.ts +70 -0
  87. package/dist/daemon/job-scheduler.js +366 -0
  88. package/dist/daemon/job-scheduler.js.map +1 -0
  89. package/dist/daemon/logger.d.ts +9 -0
  90. package/dist/daemon/logger.js +53 -0
  91. package/dist/daemon/logger.js.map +1 -0
  92. package/dist/daemon/model-pool.d.ts +45 -0
  93. package/dist/daemon/model-pool.js +187 -0
  94. package/dist/daemon/model-pool.js.map +1 -0
  95. package/dist/daemon/root-lease.d.ts +14 -0
  96. package/dist/daemon/root-lease.js +188 -0
  97. package/dist/daemon/root-lease.js.map +1 -0
  98. package/dist/daemon/root-runtime.d.ts +78 -0
  99. package/dist/daemon/root-runtime.js +333 -0
  100. package/dist/daemon/root-runtime.js.map +1 -0
  101. package/dist/daemon/runtime-manager.d.ts +45 -0
  102. package/dist/daemon/runtime-manager.js +243 -0
  103. package/dist/daemon/runtime-manager.js.map +1 -0
  104. package/dist/daemon/runtime.d.ts +12 -0
  105. package/dist/daemon/runtime.js +102 -0
  106. package/dist/daemon/runtime.js.map +1 -0
  107. package/dist/daemon/server-controller.d.ts +39 -0
  108. package/dist/daemon/server-controller.js +203 -0
  109. package/dist/daemon/server-controller.js.map +1 -0
  110. package/dist/daemon/watch-manager.d.ts +50 -0
  111. package/dist/daemon/watch-manager.js +293 -0
  112. package/dist/daemon/watch-manager.js.map +1 -0
  113. package/dist/daemon/workspace-read-session-cache.d.ts +31 -0
  114. package/dist/daemon/workspace-read-session-cache.js +115 -0
  115. package/dist/daemon/workspace-read-session-cache.js.map +1 -0
  116. package/dist/engine/config.d.ts +30 -8
  117. package/dist/engine/config.js +171 -45
  118. package/dist/engine/config.js.map +1 -1
  119. package/dist/engine/{errors/index.d.ts → errors.d.ts} +6 -1
  120. package/dist/engine/{errors/details.js → errors.js} +17 -4
  121. package/dist/engine/errors.js.map +1 -0
  122. package/dist/engine/extraction/code/adapter.d.ts +1 -1
  123. package/dist/engine/extraction/code/extractor.d.ts +5 -11
  124. package/dist/engine/extraction/code/extractor.js +105 -44
  125. package/dist/engine/extraction/code/extractor.js.map +1 -1
  126. package/dist/engine/extraction/code/families/c-family.js +1 -1
  127. package/dist/engine/extraction/code/families/c-family.js.map +1 -1
  128. package/dist/engine/extraction/code/families/js-ts.d.ts +1 -1
  129. package/dist/engine/extraction/code/families/metadata.d.ts +1 -1
  130. package/dist/engine/extraction/code/tree-sitter/grammar.js.map +1 -0
  131. package/dist/engine/extraction/code/tree-sitter/nodes.js.map +1 -0
  132. package/dist/engine/extraction/code/tree-sitter/parser.js.map +1 -0
  133. package/dist/engine/extraction/image/extractor.d.ts +5 -0
  134. package/dist/engine/extraction/image/extractor.js +35 -0
  135. package/dist/engine/extraction/image/extractor.js.map +1 -0
  136. package/dist/engine/extraction/index.d.ts +3 -44
  137. package/dist/engine/extraction/index.js +1 -280
  138. package/dist/engine/extraction/index.js.map +1 -1
  139. package/dist/engine/extraction/markdown/extractor.d.ts +5 -11
  140. package/dist/engine/extraction/markdown/extractor.js +35 -16
  141. package/dist/engine/extraction/markdown/extractor.js.map +1 -1
  142. package/dist/engine/extraction/runtime.d.ts +4 -0
  143. package/dist/engine/extraction/runtime.js +26 -0
  144. package/dist/engine/extraction/runtime.js.map +1 -0
  145. package/dist/engine/extraction/source.d.ts +18 -0
  146. package/dist/engine/extraction/source.js +22 -0
  147. package/dist/engine/extraction/source.js.map +1 -0
  148. package/dist/engine/extraction/text/extractor.d.ts +7 -0
  149. package/dist/engine/extraction/text/extractor.js +168 -0
  150. package/dist/engine/extraction/text/extractor.js.map +1 -0
  151. package/dist/engine/extraction/types.d.ts +4 -0
  152. package/dist/engine/{models → extraction}/types.js.map +1 -1
  153. package/dist/engine/{files/file-type.d.ts → file-type.d.ts} +1 -1
  154. package/dist/engine/file-type.js.map +1 -0
  155. package/dist/engine/index-status.d.ts +9 -0
  156. package/dist/engine/index-status.js +38 -0
  157. package/dist/engine/index-status.js.map +1 -0
  158. package/dist/engine/manifest.d.ts +12 -0
  159. package/dist/engine/manifest.js +120 -0
  160. package/dist/engine/manifest.js.map +1 -0
  161. package/dist/engine/models/{providers/llama-cpp/embedding.d.ts → backends/llama-cpp.d.ts} +25 -20
  162. package/dist/engine/models/{providers/llama-cpp/embedding.js → backends/llama-cpp.js} +127 -106
  163. package/dist/engine/models/backends/llama-cpp.js.map +1 -0
  164. package/dist/engine/models/backends/model2vec.d.ts +57 -0
  165. package/dist/engine/models/backends/model2vec.js +332 -0
  166. package/dist/engine/models/backends/model2vec.js.map +1 -0
  167. package/dist/engine/models/backends/qwen.d.ts +44 -0
  168. package/dist/engine/models/{providers/qwen/embedding.js → backends/qwen.js} +155 -94
  169. package/dist/engine/models/backends/qwen.js.map +1 -0
  170. package/dist/engine/models/backends/transformers-js.d.ts +87 -0
  171. package/dist/engine/models/backends/transformers-js.js +316 -0
  172. package/dist/engine/models/backends/transformers-js.js.map +1 -0
  173. package/dist/engine/models/catalog.d.ts +188 -23
  174. package/dist/engine/models/catalog.js +172 -25
  175. package/dist/engine/models/catalog.js.map +1 -1
  176. package/dist/engine/models/download-progress.d.ts +15 -0
  177. package/dist/engine/models/download-progress.js +48 -0
  178. package/dist/engine/models/download-progress.js.map +1 -0
  179. package/dist/engine/models/embeddings.d.ts +58 -18
  180. package/dist/engine/models/embeddings.js +52 -28
  181. package/dist/engine/models/embeddings.js.map +1 -1
  182. package/dist/engine/models/factory.d.ts +2 -5
  183. package/dist/engine/models/factory.js +41 -56
  184. package/dist/engine/models/factory.js.map +1 -1
  185. package/dist/engine/models/index.d.ts +4 -6
  186. package/dist/engine/models/index.js +4 -4
  187. package/dist/engine/models/index.js.map +1 -1
  188. package/dist/engine/models/ranking.d.ts +7 -3
  189. package/dist/engine/models/resolution.d.ts +8 -0
  190. package/dist/engine/models/resolution.js +22 -0
  191. package/dist/engine/models/resolution.js.map +1 -0
  192. package/dist/engine/pipeline/indexing/index.d.ts +9 -7
  193. package/dist/engine/pipeline/indexing/index.js +360 -121
  194. package/dist/engine/pipeline/indexing/index.js.map +1 -1
  195. package/dist/engine/pipeline/indexing/root-paths.js +6 -6
  196. package/dist/engine/pipeline/indexing/root-paths.js.map +1 -1
  197. package/dist/engine/pipeline/indexing/scanner/index.d.ts +6 -1
  198. package/dist/engine/pipeline/indexing/scanner/index.js +233 -29
  199. package/dist/engine/pipeline/indexing/scanner/index.js.map +1 -1
  200. package/dist/engine/pipeline/search/index.d.ts +6 -6
  201. package/dist/engine/pipeline/search/index.js +8 -10
  202. package/dist/engine/pipeline/search/index.js.map +1 -1
  203. package/dist/engine/service/index.d.ts +3 -2
  204. package/dist/engine/service/index.js +1 -1
  205. package/dist/engine/service/index.js.map +1 -1
  206. package/dist/engine/service/root.d.ts +13 -12
  207. package/dist/engine/service/root.js +35 -24
  208. package/dist/engine/service/root.js.map +1 -1
  209. package/dist/engine/service/structure-enrichment.js +12 -14
  210. package/dist/engine/service/structure-enrichment.js.map +1 -1
  211. package/dist/engine/service/types.d.ts +32 -37
  212. package/dist/engine/service/workspace-index.d.ts +24 -0
  213. package/dist/engine/service/workspace-index.js +151 -0
  214. package/dist/engine/service/workspace-index.js.map +1 -0
  215. package/dist/engine/service/zvec-grep.d.ts +12 -1
  216. package/dist/engine/service/zvec-grep.js +677 -486
  217. package/dist/engine/service/zvec-grep.js.map +1 -1
  218. package/dist/engine/storage/index.d.ts +8 -4
  219. package/dist/engine/storage/index.js +1 -1
  220. package/dist/engine/storage/index.js.map +1 -1
  221. package/dist/engine/storage/zvec.d.ts +10 -33
  222. package/dist/engine/storage/zvec.js +95 -38
  223. package/dist/engine/storage/zvec.js.map +1 -1
  224. package/dist/engine/types.d.ts +15 -23
  225. package/dist/engine/types.js +1 -1
  226. package/dist/engine/types.js.map +1 -1
  227. package/dist/engine/utils/daemon-lease.d.ts +17 -0
  228. package/dist/engine/utils/daemon-lease.js +175 -0
  229. package/dist/engine/utils/daemon-lease.js.map +1 -0
  230. package/dist/engine/utils/file-selection.js +38 -1
  231. package/dist/engine/utils/file-selection.js.map +1 -1
  232. package/dist/engine/utils/lock.js +1 -1
  233. package/dist/engine/utils/lock.js.map +1 -1
  234. package/dist/index-progress.d.ts +10 -0
  235. package/dist/index-progress.js +159 -0
  236. package/dist/index-progress.js.map +1 -0
  237. package/dist/index.d.ts +4 -4
  238. package/dist/index.js +1 -1
  239. package/dist/index.js.map +1 -1
  240. package/dist/mcp/http-transport.d.ts +27 -0
  241. package/dist/mcp/http-transport.js +182 -0
  242. package/dist/mcp/http-transport.js.map +1 -0
  243. package/dist/mcp/input-normalization.d.ts +38 -0
  244. package/dist/mcp/input-normalization.js +95 -0
  245. package/dist/mcp/input-normalization.js.map +1 -0
  246. package/dist/mcp/progress-heartbeat.d.ts +17 -0
  247. package/dist/mcp/progress-heartbeat.js +46 -0
  248. package/dist/mcp/progress-heartbeat.js.map +1 -0
  249. package/dist/mcp/request-metadata.d.ts +2 -0
  250. package/dist/mcp/request-metadata.js +11 -0
  251. package/dist/mcp/request-metadata.js.map +1 -0
  252. package/dist/mcp/request-state.d.ts +40 -0
  253. package/dist/mcp/request-state.js +210 -0
  254. package/dist/mcp/request-state.js.map +1 -0
  255. package/dist/mcp/result-format.d.ts +13 -0
  256. package/dist/mcp/result-format.js +75 -0
  257. package/dist/mcp/result-format.js.map +1 -0
  258. package/dist/mcp/schemas.d.ts +430 -0
  259. package/dist/mcp/schemas.js +447 -0
  260. package/dist/mcp/schemas.js.map +1 -0
  261. package/dist/mcp/tools.d.ts +150 -0
  262. package/dist/mcp/tools.js +448 -0
  263. package/dist/mcp/tools.js.map +1 -0
  264. package/dist/mcp/toolset.d.ts +5 -0
  265. package/dist/mcp/toolset.js +12 -0
  266. package/dist/mcp/toolset.js.map +1 -0
  267. package/dist/observability/trace-context.d.ts +11 -0
  268. package/dist/observability/trace-context.js +138 -0
  269. package/dist/observability/trace-context.js.map +1 -0
  270. package/docs/01-agents.md +111 -0
  271. package/docs/02-cli.md +229 -0
  272. package/docs/03-mcp.md +167 -0
  273. package/docs/04-pipeline.md +218 -0
  274. package/docs/05-architecture.md +86 -0
  275. package/docs/06-server.md +210 -0
  276. package/docs/07-embedding.md +179 -0
  277. package/docs/08-roadmap.md +85 -0
  278. package/docs/README.md +53 -0
  279. package/package.json +17 -8
  280. package/skills/zvec-grep/SKILL.md +43 -133
  281. package/skills/zvec-grep/agents/openai.yaml +2 -2
  282. package/skills/zvec-grep/references/cli-fallback.md +85 -0
  283. package/dist/cli/mcp.d.ts +0 -2
  284. package/dist/cli/mcp.js +0 -354
  285. package/dist/cli/mcp.js.map +0 -1
  286. package/dist/engine/collection/index.d.ts +0 -55
  287. package/dist/engine/collection/index.js +0 -710
  288. package/dist/engine/collection/index.js.map +0 -1
  289. package/dist/engine/errors/details.d.ts +0 -6
  290. package/dist/engine/errors/details.js.map +0 -1
  291. package/dist/engine/errors/index.js +0 -16
  292. package/dist/engine/errors/index.js.map +0 -1
  293. package/dist/engine/extraction/tree-sitter/grammar.js.map +0 -1
  294. package/dist/engine/extraction/tree-sitter/nodes.js.map +0 -1
  295. package/dist/engine/extraction/tree-sitter/parser.js.map +0 -1
  296. package/dist/engine/files/file-type.js.map +0 -1
  297. package/dist/engine/models/providers/index.d.ts +0 -2
  298. package/dist/engine/models/providers/index.js +0 -3
  299. package/dist/engine/models/providers/index.js.map +0 -1
  300. package/dist/engine/models/providers/llama-cpp/embedding.js.map +0 -1
  301. package/dist/engine/models/providers/llama-cpp/index.d.ts +0 -1
  302. package/dist/engine/models/providers/llama-cpp/index.js +0 -2
  303. package/dist/engine/models/providers/llama-cpp/index.js.map +0 -1
  304. package/dist/engine/models/providers/qwen/embedding.d.ts +0 -42
  305. package/dist/engine/models/providers/qwen/embedding.js.map +0 -1
  306. package/dist/engine/models/providers/qwen/index.d.ts +0 -1
  307. package/dist/engine/models/providers/qwen/index.js +0 -2
  308. package/dist/engine/models/providers/qwen/index.js.map +0 -1
  309. package/dist/engine/models/types.d.ts +0 -30
  310. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.d.ts +0 -0
  311. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/grammar.js +0 -0
  312. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.d.ts +0 -0
  313. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/nodes.js +0 -0
  314. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.d.ts +0 -0
  315. /package/dist/engine/extraction/{tree-sitter → code/tree-sitter}/parser.js +0 -0
  316. /package/dist/engine/{models → extraction}/types.js +0 -0
  317. /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="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_log_2.svg" />
8
- <img src="https://zvec.oss-cn-hongkong.aliyuncs.com/logo/github_logo_1.svg" width="400" alt="zvec logo" />
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
- <p align="center">
13
- <a href="https://www.npmjs.com/package/@zvec/zvec-grep"><img src="https://img.shields.io/npm/v/@zvec/zvec-grep.svg" alt="npm Release"/></a>
14
- <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>
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
- <p align="center">
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
- **zvec-grep** is an agent-friendly hybrid code search tool built on Zvec. It gives repositories a root-local semantic index, combines vector search with full-text search, and keeps CLI output compact enough for AI agents while still offering rich terminal output for humans.
39
+ ## 🎬 See it in action
29
40
 
30
- The command is intentionally short:
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
- ```bash
33
- zg query "where query auto update happens"
34
- ```
45
+ Install the integration once, index the workspace, then search from the terminal
46
+ or ask your agent naturally.
35
47
 
36
- > [!IMPORTANT]
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
- ## <a id="features"></a>💫 Features
50
+ ## 💫 Why zg?
46
51
 
47
- - **Semantic + Lexical Retrieval**: Blend vector search and full-text search for code, docs, tests, scripts, and configuration.
48
- - **Root-Local Indexes**: Anonymous indexes live under `<repo>/.zvec-grep/`, so repository state stays with the repository.
49
- - **Agent-Ready Output**: Default output is grouped by file and keeps previews small to save tokens.
50
- - **Human Output Mode**: Add `--human` for a terminal-friendly summary with full previews by default.
51
- - **Managed ripgrep Route**: `zg query --rg` supports common `rg` flags and works even before a repository is indexed.
52
- - **Explicit Model Choice**: The first index build requires a model such as `local/embeddinggemma-300m`, `local/qwen3-embedding-0.6b`, or `qwen/text-embedding-v4`.
53
- - **Schema Reuse**: Re-running `zg index` on an existing index reuses the stored embedding schema unless you explicitly change it.
54
- - **MCP Server**: Run `zg serve --mcp` to expose indexed and no-index lexical search tools to MCP clients. Indexing and status remain CLI-only operations.
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
- ## <a id="installation"></a>📦 Installation
61
+ <a id="quickstart"></a>
58
62
 
59
- Install the CLI from npm:
63
+ ## 🚀 Quickstart
60
64
 
61
- ```bash
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
- Or run it without a global install:
67
+ ### 1. Install and connect your agent
67
68
 
68
69
  ```bash
69
- npx @zvec/zvec-grep help
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
- Install the Codex MCP integration:
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
- Codex MCP tool calls default to a 600-second timeout. Override it during installation with `--mcp-tool-timeout <seconds>`.
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
- zg status
86
+ cd your-repository
87
+ zg index --embedding local/potion-code-16m-v2
124
88
  ```
125
89
 
126
- Search with natural language:
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
- ```bash
129
- zg query "where query auto update happens"
130
- ```
97
+ ### 3. Ask your agent
131
98
 
132
- Combine semantic intent with exact anchors:
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
- Use exhaustive lexical search without an index:
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
- ```bash
141
- zg query --rg -F "ZVEC_GREP_HOME" src
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 "root local index discovery" --limit 3
112
+ zg query --human "theme preference persistence on startup" --limit 3
148
113
  ```
149
114
 
150
- Use from an MCP client with `zvec_grep_search` and `zvec_grep_rg`. MCP inputs use JSON-friendly fields such as `include: ["src/**"]`; use the CLI for `zg status` and `zg index`. The Codex installer writes managed zvec-grep blocks to `${CODEX_HOME:-$HOME/.codex}/config.toml` and `${CODEX_HOME:-$HOME/.codex}/AGENTS.md`.
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
- ```bash
157
- zg index --embedding local/embeddinggemma-300m
158
- zg index --embedding local/qwen3-embedding-0.6b
159
- ```
117
+ ## 📊 Benchmarks
160
118
 
161
- On Apple Silicon, local builds use quiet llama.cpp CMake defaults to avoid harmless OpenMP and ARM native-detection warnings. Override any llama.cpp CMake option with `NODE_LLAMA_CPP_CMAKE_OPTION_<name>`, for example `NODE_LLAMA_CPP_CMAKE_OPTION_GGML_NATIVE=ON` to opt back into native CPU tuning.
119
+ > 🚧 **Work in progress.**
162
120
 
163
- Remote Qwen embeddings are useful when you prefer a managed embedding service or want to avoid local model setup:
121
+ ## 🗺️ Roadmap
164
122
 
165
- ```bash
166
- zg index \
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
- After a successful index, explicitly passed global model and provider options are saved to `~/.zvec-grep/config.json` with user-only permissions. This lets an already-running `zg` MCP server load a newly configured remote API key on its next model request without restarting Codex. Values read only from environment variables are not persisted.
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
- Resolution order is explicit CLI or library options, then environment variables, then global config, then built-in defaults. Repository roots and file-selection settings remain in each repository's `.zvec-grep` metadata rather than global config.
128
+ <a id="community"></a>
189
129
 
190
- For existing indexes, `zg index` without `--embedding` reuses the stored schema. Use `--rebuild --embedding <model>` only when you intentionally want to rebuild with a different model:
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
- | 💬 DingTalk | 📱 WeChat | 🎮 Discord | X (Twitter) |
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?v=6" width="150" alt="WeChat QR Code"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](https://x.com/ZvecAI) |
295
- | Scan to join | Scan to join | Click to join | Click to follow |
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"/> | [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rKddFBBu9z) | [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZvecAI)](<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
- Issues and pull requests are welcome. Please keep changes focused, add tests for behavior changes, and run:
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
- Pull request titles use Conventional Commits syntax.
146
+ Check out our [Contributing Guide](./CONTRIBUTING.md) to get started!