@grepai/cli 0.6.6 → 0.6.8
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 +61 -2
- package/index.js +24306 -5362
- package/index.js.map +148 -15
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ grepai search "database config" --topK 50
|
|
|
25
25
|
|
|
26
26
|
Create a `.grepairc.json` or `grepai-config.json` in your project root. Supports `${ENV_VAR}` substitution.
|
|
27
27
|
|
|
28
|
+
### Minimal Example (Turso)
|
|
29
|
+
|
|
28
30
|
```json
|
|
29
31
|
{
|
|
30
32
|
"$schema": "https://raw.githubusercontent.com/bismuth1991/grepai-ts/refs/heads/main/packages/core/src/grepai-config-schema.json",
|
|
@@ -36,16 +38,73 @@ Create a `.grepairc.json` or `grepai-config.json` in your project root. Supports
|
|
|
36
38
|
"embedding": {
|
|
37
39
|
"provider": "google",
|
|
38
40
|
"model": "gemini-embedding-001",
|
|
39
|
-
"apiKey": "${GEMINI_API_KEY}"
|
|
40
|
-
"dimensions": 3072
|
|
41
|
+
"apiKey": "${GEMINI_API_KEY}"
|
|
41
42
|
},
|
|
42
43
|
"include": ["src/**/*.ts"],
|
|
43
44
|
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
44
45
|
}
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
### Postgres Example
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"storage": {
|
|
53
|
+
"type": "postgres",
|
|
54
|
+
"connectionString": "postgres://user:pass@localhost:5432/grepai"
|
|
55
|
+
},
|
|
56
|
+
"embedding": {
|
|
57
|
+
"provider": "google",
|
|
58
|
+
"model": "gemini-embedding-001",
|
|
59
|
+
"apiKey": "${GEMINI_API_KEY}",
|
|
60
|
+
"dimensions": 1536
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Local LanceDB Example
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"storage": {
|
|
70
|
+
"type": "lancedb"
|
|
71
|
+
},
|
|
72
|
+
"embedding": {
|
|
73
|
+
"provider": "google",
|
|
74
|
+
"model": "gemini-embedding-001",
|
|
75
|
+
"apiKey": "${GEMINI_API_KEY}",
|
|
76
|
+
"dimensions": 1536
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Advanced Configuration
|
|
82
|
+
|
|
83
|
+
Full list of options:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"embedding": {
|
|
88
|
+
"provider": "google",
|
|
89
|
+
"model": "gemini-embedding-001",
|
|
90
|
+
"apiKey": "${GEMINI_API_KEY}",
|
|
91
|
+
"dimensions": 3072, // 768, 1536, or 3072
|
|
92
|
+
"targetChunkSize": 256, // Preferred tokens per chunk
|
|
93
|
+
"maxChunkSize": 1024, // Max tokens per chunk
|
|
94
|
+
"tokenizer": "gemini-embedding-001" // or "simple"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
47
99
|
Read `https://github.com/bismuth1991/grepai-ts/blob/main/packages/core/src/domain/config.ts` for full configuration details.
|
|
48
100
|
|
|
101
|
+
## How it works
|
|
102
|
+
|
|
103
|
+
1. **AST Parsing**: GrepAI parses your code (TypeScript/TSX) into an Abstract Syntax Tree.
|
|
104
|
+
2. **Smart Chunking**: It splits code into meaningful chunks, preserving scope context (class names, function signatures) even for deep nested code.
|
|
105
|
+
3. **Embedding**: Chunks are embedded using Google's Gemini models.
|
|
106
|
+
4. **Vector Search**: Queries are embedded and compared against code chunks using cosine similarity.
|
|
107
|
+
|
|
49
108
|
## Links
|
|
50
109
|
|
|
51
110
|
[Repository](https://github.com/bismuth1991/grepai-ts) | [Issues](https://github.com/bismuth1991/grepai-ts/issues) | [License](LICENSE)
|