@zvec/zvec-grep 0.1.3 → 0.1.5

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 (135) hide show
  1. package/README.md +127 -42
  2. package/README_CN.md +124 -42
  3. package/dist/cli/args.d.ts +3 -0
  4. package/dist/cli/args.js +490 -192
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/commands.d.ts +3 -1
  7. package/dist/cli/commands.js +590 -56
  8. package/dist/cli/commands.js.map +1 -1
  9. package/dist/cli/errors.js +6 -5
  10. package/dist/cli/errors.js.map +1 -1
  11. package/dist/cli/format/context.js +33 -29
  12. package/dist/cli/format/context.js.map +1 -1
  13. package/dist/cli/format/debug.js +12 -14
  14. package/dist/cli/format/debug.js.map +1 -1
  15. package/dist/cli/format/highlight.js.map +1 -1
  16. package/dist/cli/format/progress.js +8 -3
  17. package/dist/cli/format/progress.js.map +1 -1
  18. package/dist/cli/format/range.js.map +1 -1
  19. package/dist/cli/format/status.js +88 -26
  20. package/dist/cli/format/status.js.map +1 -1
  21. package/dist/cli/help.d.ts +1 -1
  22. package/dist/cli/help.js +170 -85
  23. package/dist/cli/help.js.map +1 -1
  24. package/dist/cli/index.js +4 -4
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/cli/mcp.d.ts +2 -0
  27. package/dist/cli/mcp.js +354 -0
  28. package/dist/cli/mcp.js.map +1 -0
  29. package/dist/cli/types.d.ts +22 -9
  30. package/dist/cli/types.js.map +1 -1
  31. package/dist/cli/version.js +3 -1
  32. package/dist/cli/version.js.map +1 -1
  33. package/dist/engine/collection/index.js +15 -15
  34. package/dist/engine/collection/index.js.map +1 -1
  35. package/dist/engine/config.d.ts +28 -0
  36. package/dist/engine/config.js +195 -0
  37. package/dist/engine/config.js.map +1 -0
  38. package/dist/engine/errors/details.js.map +1 -1
  39. package/dist/engine/errors/index.js.map +1 -1
  40. package/dist/engine/extraction/code/adapter.js.map +1 -1
  41. package/dist/engine/extraction/code/extractor.js +87 -73
  42. package/dist/engine/extraction/code/extractor.js.map +1 -1
  43. package/dist/engine/extraction/code/families/c-family.js +12 -6
  44. package/dist/engine/extraction/code/families/c-family.js.map +1 -1
  45. package/dist/engine/extraction/code/families/js-ts.js +24 -18
  46. package/dist/engine/extraction/code/families/js-ts.js.map +1 -1
  47. package/dist/engine/extraction/code/families/metadata.js +11 -8
  48. package/dist/engine/extraction/code/families/metadata.js.map +1 -1
  49. package/dist/engine/extraction/code/families/name-field.js +5 -5
  50. package/dist/engine/extraction/code/families/name-field.js.map +1 -1
  51. package/dist/engine/extraction/code/languages/c.js +1 -4
  52. package/dist/engine/extraction/code/languages/c.js.map +1 -1
  53. package/dist/engine/extraction/code/languages/cpp.js.map +1 -1
  54. package/dist/engine/extraction/code/languages/go.js +1 -3
  55. package/dist/engine/extraction/code/languages/go.js.map +1 -1
  56. package/dist/engine/extraction/code/languages/java.js.map +1 -1
  57. package/dist/engine/extraction/code/languages/javascript.js +1 -3
  58. package/dist/engine/extraction/code/languages/javascript.js.map +1 -1
  59. package/dist/engine/extraction/code/languages/python.js +5 -6
  60. package/dist/engine/extraction/code/languages/python.js.map +1 -1
  61. package/dist/engine/extraction/code/languages/rust.js +1 -5
  62. package/dist/engine/extraction/code/languages/rust.js.map +1 -1
  63. package/dist/engine/extraction/code/languages/typescript.js.map +1 -1
  64. package/dist/engine/extraction/ids.js.map +1 -1
  65. package/dist/engine/extraction/index.js +3 -3
  66. package/dist/engine/extraction/index.js.map +1 -1
  67. package/dist/engine/extraction/markdown/extractor.js +4 -2
  68. package/dist/engine/extraction/markdown/extractor.js.map +1 -1
  69. package/dist/engine/extraction/tree-sitter/grammar.js.map +1 -1
  70. package/dist/engine/extraction/tree-sitter/nodes.js +2 -1
  71. package/dist/engine/extraction/tree-sitter/nodes.js.map +1 -1
  72. package/dist/engine/extraction/tree-sitter/parser.js.map +1 -1
  73. package/dist/engine/files/file-type.js.map +1 -1
  74. package/dist/engine/models/catalog.js +7 -23
  75. package/dist/engine/models/catalog.js.map +1 -1
  76. package/dist/engine/models/embeddings.js +3 -3
  77. package/dist/engine/models/embeddings.js.map +1 -1
  78. package/dist/engine/models/factory.js.map +1 -1
  79. package/dist/engine/models/index.d.ts +1 -1
  80. package/dist/engine/models/index.js.map +1 -1
  81. package/dist/engine/models/providers/index.d.ts +1 -1
  82. package/dist/engine/models/providers/index.js +1 -1
  83. package/dist/engine/models/providers/index.js.map +1 -1
  84. package/dist/engine/models/providers/llama-cpp/embedding.js +49 -18
  85. package/dist/engine/models/providers/llama-cpp/embedding.js.map +1 -1
  86. package/dist/engine/models/providers/qwen/embedding.js +16 -11
  87. package/dist/engine/models/providers/qwen/embedding.js.map +1 -1
  88. package/dist/engine/models/providers/qwen/index.d.ts +1 -1
  89. package/dist/engine/models/providers/qwen/index.js +1 -1
  90. package/dist/engine/models/providers/qwen/index.js.map +1 -1
  91. package/dist/engine/pipeline/indexing/index.js +46 -33
  92. package/dist/engine/pipeline/indexing/index.js.map +1 -1
  93. package/dist/engine/pipeline/indexing/root-paths.js +10 -13
  94. package/dist/engine/pipeline/indexing/root-paths.js.map +1 -1
  95. package/dist/engine/pipeline/indexing/scanner/index.js +121 -46
  96. package/dist/engine/pipeline/indexing/scanner/index.js.map +1 -1
  97. package/dist/engine/pipeline/search/index.js +68 -24
  98. package/dist/engine/pipeline/search/index.js.map +1 -1
  99. package/dist/engine/service/index.d.ts +1 -1
  100. package/dist/engine/service/lexical.d.ts +14 -15
  101. package/dist/engine/service/lexical.js +78 -114
  102. package/dist/engine/service/lexical.js.map +1 -1
  103. package/dist/engine/service/root.js +2 -2
  104. package/dist/engine/service/root.js.map +1 -1
  105. package/dist/engine/service/structure-enrichment.js +17 -11
  106. package/dist/engine/service/structure-enrichment.js.map +1 -1
  107. package/dist/engine/service/types.d.ts +39 -8
  108. package/dist/engine/service/zvec-grep.js +303 -160
  109. package/dist/engine/service/zvec-grep.js.map +1 -1
  110. package/dist/engine/storage/index.js.map +1 -1
  111. package/dist/engine/storage/zvec.js +49 -28
  112. package/dist/engine/storage/zvec.js.map +1 -1
  113. package/dist/engine/types.d.ts +14 -0
  114. package/dist/engine/types.js.map +1 -1
  115. package/dist/engine/utils/file-selection.d.ts +10 -0
  116. package/dist/engine/utils/file-selection.js +120 -0
  117. package/dist/engine/utils/file-selection.js.map +1 -0
  118. package/dist/engine/utils/glob.d.ts +3 -0
  119. package/dist/engine/utils/glob.js +116 -18
  120. package/dist/engine/utils/glob.js.map +1 -1
  121. package/dist/engine/utils/hash.js.map +1 -1
  122. package/dist/engine/utils/json.d.ts +6 -2
  123. package/dist/engine/utils/json.js +50 -12
  124. package/dist/engine/utils/json.js.map +1 -1
  125. package/dist/engine/utils/lock.js +6 -6
  126. package/dist/engine/utils/lock.js.map +1 -1
  127. package/dist/engine/utils/path.js +2 -2
  128. package/dist/engine/utils/path.js.map +1 -1
  129. package/dist/engine/utils/timing.js.map +1 -1
  130. package/dist/index.d.ts +3 -3
  131. package/dist/index.js +2 -2
  132. package/dist/index.js.map +1 -1
  133. package/package.json +34 -7
  134. package/skills/zvec-grep/SKILL.md +58 -48
  135. package/skills/zvec-grep/agents/openai.yaml +1 -1
@@ -1,39 +1,39 @@
1
1
  ---
2
2
  name: zvec-grep
3
- description: Use zvec-grep instead of grep or rg: check the index state once per repository investigation when needed, use existing indexed context when available, and use explicit zg --rg for lexical search when no index exists unless the user asks to build an index.
3
+ description: Use zvec-grep instead of grep or rg: check the index state once per repository investigation when needed, use existing indexed context when available, and use explicit zg query --rg for lexical search when no index exists unless the user asks to build an index.
4
4
  ---
5
5
 
6
6
  # zvec-grep
7
7
 
8
- Use zvec-grep through the `zg` command for repository search instead of `grep`, `rg`, or broad manual file scans. zvec-grep provides higher-quality results by combining indexed semantic context with lexical matching, while `zg --rg` provides an explicit no-index lexical search route.
8
+ Use zvec-grep through the `zg` command for repository search instead of `grep`, `rg`, or broad manual file scans. zvec-grep provides higher-quality results by combining indexed semantic context with lexical matching, while `zg query --rg` provides an explicit no-index lexical search route.
9
9
 
10
10
  At the start of a repository investigation, check the current repository's anonymous index status once:
11
11
 
12
12
  ```bash
13
- zg --info
13
+ zg status
14
14
  ```
15
15
 
16
- Do not run `zg --info` before every search. Reuse the initial status for subsequent `zg` queries in the same root. Check again only when switching roots or collections, after an index/rebuild, or when a query reports an index problem that you need to diagnose.
16
+ Do not run `zg status` before every search. Reuse the initial status for subsequent `zg query` calls in the same root. Check again only when switching roots or collections, after an index/rebuild, or when a query reports an index problem that you need to diagnose.
17
17
 
18
- If the index is missing, do not build it automatically and do not run a default `zg "<query>"` search. Use `zg --rg` for explicit exhaustive literal/regex search, and mention `zg --index` when the user wants persistent indexed semantic search. Indexing creates repository-local state, may load local models or call remote embedding providers, and should be a user-owned action.
18
+ If the index is missing, do not build it automatically and do not run a default `zg query "<query>"` search. Use `zg query --rg` for explicit exhaustive literal/regex search, and mention `zg index` when the user wants persistent indexed semantic search. Indexing creates repository-local state, may load local models or call remote embedding providers, and should be a user-owned action.
19
19
 
20
- When indexing or rebuilding, choose useful repo paths instead of indexing everything. Prefer source, tests, docs, config, and scripts. zvec-grep skips dependency, build, cache, `.gitignore`d, and over-1MB files by default; use `--include` and `--exclude` to further keep the index focused:
20
+ When indexing or rebuilding, choose useful repo paths instead of indexing everything. Prefer source, tests, docs, config, and scripts. zvec-grep skips dependency, third-party, generated, build, cache, hidden, nested-git, `.gitignore`d, and over-1MB files by default; use repeatable rg-style `-g`/`--glob` and `-t`/`--type` filters to keep the index focused:
21
21
 
22
22
  ```bash
23
- zg --index --embedding local/embeddinggemma-300m --include "src/**" --include "docs/**" --include "test/**" --exclude "dist/**,node_modules/**,coverage/**,.zvec-grep/**"
24
- zg --index --rebuild --embedding local/embeddinggemma-300m --include "src/**" --exclude "dist/**,node_modules/**,coverage/**,.zvec-grep/**"
23
+ zg index --embedding local/embeddinggemma-300m -g "src/**" -g "docs/**" -g "test/**" -g "!dist/**" -g "!node_modules/**"
24
+ zg index --rebuild --embedding local/embeddinggemma-300m -g "src/**" -g "!dist/**" -g "!node_modules/**" -t ts
25
25
  ```
26
26
 
27
- If `zg --info` reports incompatible settings, ask before rebuilding. Existing anonymous indexes are checked and incrementally refreshed by query commands by default; use `--no-auto-update` only when diagnosing stale-index behavior. Rebuild only when the embedding schema or index version requires it:
27
+ If `zg status` reports incompatible settings, ask before rebuilding. Existing anonymous indexes are checked and incrementally refreshed by query commands by default; use `--no-auto-update` only when diagnosing stale-index behavior. Rebuild only when the embedding schema or index version requires it:
28
28
 
29
29
  ```bash
30
- zg --index --rebuild --embedding local/embeddinggemma-300m
30
+ zg index --rebuild --embedding local/embeddinggemma-300m
31
31
  ```
32
32
 
33
33
  After an anonymous index exists, start with high-quality semantic context:
34
34
 
35
35
  ```bash
36
- zg "<query>"
36
+ zg query "<query>"
37
37
  ```
38
38
 
39
39
  Prefer the default indexed/hybrid search for exploration. Agent output uses `--preview none` by default to keep results token-efficient; `--human` uses `--preview full` by default for terminal reading. Use `--limit` to control candidate width, `--preview short` for a small deterministic source window, and `--preview full` after narrowing to a few results.
@@ -41,93 +41,103 @@ Prefer the default indexed/hybrid search for exploration. Agent output uses `--p
41
41
  Use filters early. For source-code investigations, start with implementation paths and exclude tests, fixtures, generated output, dependencies, and build artifacts unless the task is specifically about those areas. Good filters keep candidate sets smaller and reduce token use:
42
42
 
43
43
  ```bash
44
- zg "plugin loading lifecycle" --include "src/**" --exclude "test/**,tests/**,**/*.test.*,**/*.spec.*,fixtures/**,dist/**"
45
- zg "query planning" --include "src/**,packages/*/src/**" --exclude "test/**,tests/**,fixtures/**,node_modules/**,dist/**"
44
+ zg query "plugin loading lifecycle" -g "src/**" -g "!test/**" -g "!tests/**" -g "!**/*.test.*" -g "!**/*.spec.*"
45
+ zg query "query planning" -g "src/**" -g "packages/*/src/**" -g "!fixtures/**" -g "!node_modules/**" -t ts
46
46
  ```
47
47
 
48
48
  Indexed agent results use `--preview none` by default: essential metadata plus one representative source line when source is available. Human results use `--preview full` by default. Use `--preview short` for essential metadata plus a small deterministic source window, or `--preview full` after narrowing to a few results. `--preview` is for indexed/semantic results; with `--rg`, use ripgrep context flags such as `-A`, `-B`, or `-C` instead.
49
49
 
50
50
  ```bash
51
- zg "plugin loading" --limit 30 --preview none
52
- zg "plugin loading" --limit 10 --preview short
53
- zg "plugin loading" --limit 3 --preview full
51
+ zg query "plugin loading" --limit 30 --preview none
52
+ zg query "plugin loading" --limit 10 --preview short
53
+ zg query "plugin loading" --limit 3 --preview full
54
54
  ```
55
55
 
56
56
  Use multiple quoted queries when you are exploring related ideas or comparing several names/concepts. Each query gets its own search group, and `--limit` applies per query/group:
57
57
 
58
58
  ```bash
59
- zg "request validation" "error handling"
60
- zg "authentication flow" "session refresh" "permission checks" --limit 5
59
+ zg query "request validation" "error handling"
60
+ zg query "authentication flow" "session refresh" "permission checks" --limit 5
61
61
  ```
62
62
 
63
- Use `zg --rg` only when you need exhaustive literal/regex search, exact verification, or ripgrep-specific flags. For exploratory code understanding, prefer default `zg` indexed search first:
63
+ Use `--fuse` only when those groups should contribute to one combined ranking;
64
+ then `--limit` applies to the final fused list:
64
65
 
65
66
  ```bash
66
- zg --rg "SymbolName|LogMessage"
67
- zg --rg -F "ExactSymbolOrText" src
68
- zg --rg -i -C 2 -g "*.ts" -g "!dist/**" "needle text" src
67
+ zg query --hybrid "authentication flow" --fts "AuthService" --vector "credential validation" --fuse --limit 10
69
68
  ```
70
69
 
71
- Do not call `grep` or `rg` directly for repository search. If exhaustive regex or literal matching is required, use `zg --rg`; otherwise keep using default `zg` indexed search to avoid noisy, token-heavy match lists.
70
+ Use `zg query --rg` only when you need exhaustive literal/regex search, exact verification, or ripgrep-specific flags. For exploratory code understanding, prefer indexed `zg query` search first:
71
+
72
+ ```bash
73
+ zg query --rg "SymbolName|LogMessage"
74
+ zg query --rg -F "ExactSymbolOrText" src
75
+ zg query --rg -i -C 2 -g "*.ts" -g "!dist/**" "needle text" src
76
+ ```
77
+
78
+ Do not call `grep` or `rg` directly for repository search. If exhaustive regex or literal matching is required, use `zg query --rg`; otherwise keep using indexed `zg query` search to avoid noisy, token-heavy match lists.
72
79
 
73
80
  Check the local anonymous index explicitly only when starting a repository investigation or diagnosing index state. Build it only when the user asks for persistent indexed semantic search:
74
81
 
75
82
  ```bash
76
- zg --info
77
- zg --index --embedding local/embeddinggemma-300m
78
- zg --index --rebuild --embedding local/embeddinggemma-300m
83
+ zg status
84
+ zg index --embedding local/embeddinggemma-300m
85
+ zg index --rebuild --embedding local/embeddinggemma-300m
79
86
  ```
80
87
 
81
- For a new index, always pass `--embedding <model>` or set `ZVEC_GREP_EMBEDDING`; `zg --index` does not choose a model silently. For an existing index, rerunning `zg --index` without `--embedding` reuses the collection's stored embedding schema. Use `--embedding <model>` when intentionally choosing or changing models. Local models use `local/model`, such as `local/embeddinggemma-300m` and `local/qwen3-embedding-0.6b`. Remote models use `provider/model`, such as `qwen/text-embedding-v4`.
88
+ For a new index, always pass `--embedding <model>` or set `ZVEC_GREP_EMBEDDING`; `zg index` does not choose a model silently. For an existing index, rerunning `zg index` without `--embedding` reuses the collection's stored embedding schema. Use `--embedding <model>` when intentionally choosing or changing models. Local models use `local/model`, such as `local/embeddinggemma-300m` and `local/qwen3-embedding-0.6b`. Remote models use `provider/model`, such as `qwen/text-embedding-v4`.
82
89
 
83
90
  ```bash
84
- zg --index --embedding local/qwen3-embedding-0.6b
85
- zg --index --embedding qwen/text-embedding-v4 --api-key "$DASHSCOPE_API_KEY"
91
+ zg index --embedding local/qwen3-embedding-0.6b
92
+ zg index --embedding qwen/text-embedding-v4 --api-key "$DASHSCOPE_API_KEY"
86
93
  ```
87
94
 
88
95
  Use explicit routes only when the intent is clear:
89
96
 
90
97
  ```bash
91
- zg --fts "ExactSymbolOrToken"
92
- zg --vector "natural language description of the code you need"
93
- zg --fts "AuthService" "validateRequest" --vector "where incoming requests are authorized"
98
+ zg query --fts "ExactSymbolOrToken"
99
+ zg query --vector "natural language description of the code you need"
100
+ zg query --fts "AuthService" --fts "validateRequest" --vector "where incoming requests are authorized"
94
101
  ```
95
102
 
96
103
  Combine default hybrid queries with `--fts` when you want broad semantic/lexical recall plus exact anchors such as symbols, flags, error codes, or log text. Put the default hybrid queries first, then add one or more `--fts` terms:
97
104
 
98
105
  ```bash
99
- zg "authentication flow" --fts "AuthService" --include "src/**"
100
- zg "cache invalidation" "stale data handling" --fts "CACHE_TTL" "invalidateCache" --limit 5
101
- zg "request routing behavior" --fts "routeRequest" "RouteOptions" --include "src/**"
106
+ zg query "authentication flow" --fts "AuthService" -g "src/**" -t ts
107
+ zg query "cache invalidation" "stale data handling" --fts "CACHE_TTL" --fts "invalidateCache" --limit 5
108
+ zg query "request routing behavior" --fts "routeRequest" --fts "RouteOptions" -g "src/**" -t ts
102
109
  ```
103
110
 
104
- Use query filters to narrow noisy searches before reading results. Prefer adding `--include` and `--exclude` to the first query when you already know the relevant area:
111
+ Use query filters to narrow noisy searches before reading results. Prefer adding `-g`/`--glob`, `--iglob`, `-t`/`--type`, and `-T`/`--type-not` to the first query when you already know the relevant area:
105
112
 
106
113
  ```bash
107
- zg "error handling" --include "src/**" --exclude "dist/**,node_modules/**"
108
- zg "database migration" --include "src/**" --exclude "**/*.test.*"
109
- zg "recent API changes" --modified-after 2026-06-01 --modified-before 2026-06-25
110
- zg "create user" --symbol-type function --prefer-symbol
111
- zg "service lifecycle" "resource cleanup" --symbol-type class --symbol-type function --limit 5
114
+ zg query "error handling" -g "src/**" -g "!dist/**" -g "!node_modules/**"
115
+ zg query "database migration" -g "src/**" -g "!**/*.test.*"
116
+ zg query "recent API changes" --modified-after 2026-06-01 --modified-before 2026-06-25
117
+ zg query "create user" --symbol-type function --prefer-symbol
118
+ zg query "service lifecycle" "resource cleanup" --symbol-type class --symbol-type function --limit 5
112
119
  ```
113
120
 
114
121
  Filter notes:
115
122
 
116
123
  - Quote glob filters so the shell does not expand them.
117
- - `--include` and `--exclude` accept comma-separated globs and can be repeated.
118
- - Dependency, build, cache, `.gitignore`d, and over-1MB files are skipped during indexing by default. Hidden dot paths are skipped by default; explicitly include useful hidden paths such as `.github/**`, `.codex/**`, or `.agents/**` with `--include` when needed. `.git/**` and `.zvec-grep/**` remain excluded.
124
+ - `-g`/`--glob` accepts one glob and can be repeated. Prefix a glob with `!` to exclude it. Use `--iglob` for case-insensitive globs.
125
+ - `-t`/`--type` and `-T`/`--type-not` use ripgrep's file-type names and work in indexed and rg modes.
126
+ - Type filters further restrict the glob-selected files. For example, `-g "docs/**" -t ts` selects only TypeScript files under `docs`.
127
+ - Dependency, third-party, generated, build, cache, nested-git, `.gitignore`d, and over-1MB files are skipped during indexing by default. Hidden dot paths are skipped by default; use `--hidden` when explicitly needed. `.git/**` and `.zvec-grep/**` remain excluded.
119
128
  - `--modified-after` and `--modified-before` accept epoch milliseconds, `YYYY-MM-DD`, or other parseable date strings.
120
129
  - `--symbol-type` can be repeated; supported values are `module`, `class`, `interface`, `function`, `value`, and `alias`.
121
130
  - `--prefer-symbol` is useful when a query names a symbol and you want exact indexed symbol hits ranked first.
122
- - `--rg` is for exhaustive ripgrep search; do not combine it with indexed symbol options such as `--symbol-type` or `--prefer-symbol`. It uses rg regex syntax by default, so use `-F`/`--fixed-strings` for literal text, and use `-e`/`--regexp` when the pattern begins with `-`. It accepts common agent rg flags: `-n`, `-H`, `-F`, `-i`, `-w`, `-A`, `-B`, `-C`, `-e`/`--regexp`, `-g`/`--glob`, `--hidden`, `-t`/`--type`, `-T`/`--type-not`, `--max-depth`, `--ignore-file`, `--no-ignore`, `--smart-case`, and `--pcre2`. In `--rg`, `--limit` is a global match limit.
131
+ - `--rg` is for exhaustive ripgrep search outside `.git/**` and `.zvec-grep/**`; do not combine it with indexed symbol options such as `--symbol-type` or `--prefer-symbol`. It uses rg regex syntax by default, so use `-F` for literal text and `-e` when a pattern begins with `-`. Managed rg supports common matching, pattern-file, context, glob, type, ignore, depth, size, symlink, encoding, multiline, and regex-engine flags. Zvec-grep owns the result format, so output-changing flags such as `--json`, `--count`, `--files`, `-l`, `-o`, `--replace`, and `--vimgrep` are rejected. In `--rg`, `--limit` is a global result limit while `-m`/`--max-count` retains rg's per-file meaning.
123
132
 
124
133
  Combine multiple queries, explicit routes, and filters for focused context:
125
134
 
126
135
  ```bash
127
- zg "authorization failure" "permission checks" \
128
- --fts "ForbiddenError" "hasPermission" \
129
- --include "src/**" \
130
- --exclude "dist/**,**/*.test.*" \
136
+ zg query "authorization failure" "permission checks" \
137
+ --fts "ForbiddenError" --fts "hasPermission" \
138
+ -g "src/**" \
139
+ -g "!dist/**" \
140
+ -g "!**/*.test.*" \
131
141
  --symbol-type function \
132
142
  --limit 5
133
143
  ```
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "zvec-grep"
3
3
  short_description: "Agent-friendly indexed repository search"
4
- default_prompt: "Use zvec-grep through the zg command instead of grep or rg: check zg --info once at the start of a repository investigation when needed, then reuse that status for later searches in the same root; when indexing or rebuilding the local index, use --include and --exclude to index useful source/docs/tests/config/scripts and exclude generated, dependency, cache, build, log, and .zvec-grep garbage; prefer default zg indexed/hybrid queries for high-quality, token-efficient context; use --preview none for broad candidate scans and --preview full only after narrowing; use filters early, especially --include implementation paths and --exclude tests/fixtures/generated output when the task is about source code; use multiple quoted queries for related concepts; combine default hybrid queries with --fts exact anchors for symbols/flags/errors; narrow noisy searches with --include/--exclude/--modified-after/--modified-before/--symbol-type/--prefer-symbol; and use zg --rg only for exhaustive literal/regex verification with common rg flags such as -F, -i, -w, -A/-B/-C, -e/--regexp, -g/--glob, --hidden, --type, --type-not, --no-ignore, --smart-case, and --pcre2; use -e/--regexp when an rg pattern begins with -."
4
+ default_prompt: "Use zvec-grep through the zg command instead of grep or rg: check zg status once at the start of a repository investigation when needed, then reuse that status for later searches in the same root; when indexing or rebuilding the local index, use zg index with repeatable rg-style -g/--glob filters and, for language-specific scopes, -t/--type filters to index useful source/docs/tests/config/scripts and exclude generated, dependency, cache, build, log, and .zvec-grep garbage; prefer zg query indexed/hybrid searches for high-quality, token-efficient context; use --preview none for broad candidate scans and --preview full only after narrowing; use the same -g/--iglob/-t/-T filters for indexed and rg queries when applicable; use multiple quoted queries for related concepts; combine hybrid queries with repeated --fts exact anchors for symbols/flags/errors; narrow noisy searches with globs, types, --modified-after/--modified-before/--symbol-type/--prefer-symbol; and use zg query --rg only for exhaustive literal/regex verification with common rg matching, pattern-file, context, ignore, depth, size, encoding, multiline, and regex-engine flags; use -e/--regexp when an rg pattern begins with -."