xindex 1.0.24 → 1.0.26
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 +15 -7
- package/apps/run.reindex.ts +23 -0
- package/bin/xindex-reindex +2 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -35,10 +35,12 @@ Index lives in `./.xindex/` — add it to `.gitignore`.
|
|
|
35
35
|
### Zero-install, all projects
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
claude mcp add --scope user xindex -- npx xindex
|
|
38
|
+
claude mcp add --scope user xindex -- npx -y xindex
|
|
39
39
|
# remove later: claude mcp remove xindex --scope user
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
Use **`npx -y`** so `npx` does not wait for confirmation when it must fetch the package (MCP often runs without a TTY). If `npm` still errors on peer resolution, install globally with `npm i -g xindex --legacy-peer-deps` and point MCP at `xindex-mcp` instead (see below).
|
|
43
|
+
|
|
42
44
|
### Per-project
|
|
43
45
|
|
|
44
46
|
Drop this into `.mcp.json` at the repo root — `npx` fetches on demand:
|
|
@@ -48,7 +50,7 @@ Drop this into `.mcp.json` at the repo root — `npx` fetches on demand:
|
|
|
48
50
|
"mcpServers": {
|
|
49
51
|
"xindex": {
|
|
50
52
|
"command": "npx",
|
|
51
|
-
"args": ["xindex"]
|
|
53
|
+
"args": ["-y", "xindex"]
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -121,7 +123,7 @@ name: xindex
|
|
|
121
123
|
description: Manages xindex semantic search — index, search, reset via MCP tools. For research questions, use /ask-xi.
|
|
122
124
|
argument-hint: "[search query | index | reset]"
|
|
123
125
|
---
|
|
124
|
-
Full xindex tool management. For research, use `/ask-xi`. Install: `npm i -g xindex` ([npm](https://www.npmjs.com/package/xindex)).
|
|
126
|
+
Full xindex tool management. For research, use `/ask-xi`. Install: `npm i -g xindex`, or user MCP `claude mcp add --scope user xindex -- npx -y xindex` ([npm](https://www.npmjs.com/package/xindex)).
|
|
125
127
|
|
|
126
128
|
**Tools:**
|
|
127
129
|
- `xindex_search` — find files by meaning (synonyms, semantics). Try before grepping blindly.
|
|
@@ -142,7 +144,7 @@ Both skills assume the `xindex` MCP server is registered (see the section above)
|
|
|
142
144
|
|
|
143
145
|
## CLI reference
|
|
144
146
|
|
|
145
|
-
All
|
|
147
|
+
All six binaries run from any directory; they index/search the current working directory.
|
|
146
148
|
|
|
147
149
|
### `xindex-index [paths...]`
|
|
148
150
|
|
|
@@ -180,6 +182,15 @@ Wipe and recreate the index. Destructive.
|
|
|
180
182
|
xindex-reset
|
|
181
183
|
```
|
|
182
184
|
|
|
185
|
+
### `xindex-reindex [paths...]`
|
|
186
|
+
|
|
187
|
+
Reset the index, then build it again. Same as `xindex-reset` followed by `xindex-index`. Defaults to `.`.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
xindex-reindex
|
|
191
|
+
xindex-reindex apps features
|
|
192
|
+
```
|
|
193
|
+
|
|
183
194
|
### `xindex-mcp`
|
|
184
195
|
|
|
185
196
|
MCP stdio server; background watcher by default. Flags: `--watch-disabled`, `--watch-dir=./src` — rare use cases; defaults are fine for most setups.
|
|
@@ -270,9 +281,6 @@ yarn test.compilation
|
|
|
270
281
|
|
|
271
282
|
MIT
|
|
272
283
|
|
|
273
|
-
## Version
|
|
274
|
-
1.0.21
|
|
275
|
-
|
|
276
284
|
## Links
|
|
277
285
|
|
|
278
286
|
- [Claude Code skills](https://docs.claude.com/en/docs/claude-code/skills)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {BuildComponents} from "../components/buildComponents.js";
|
|
2
|
+
import {BufferedLoggerToStdOut} from "../components/logger.js";
|
|
3
|
+
import {WalkFiles} from "../components/walkFiles.js";
|
|
4
|
+
import {IndexApp} from "./indexApp.js";
|
|
5
|
+
import {AppId} from "../components/appId.js";
|
|
6
|
+
import {INDEXING_COALESCE_MS} from "../components/config/INDEXING_COALESCE_MS.js";
|
|
7
|
+
|
|
8
|
+
const appId = AppId();
|
|
9
|
+
const cwd = process.cwd();
|
|
10
|
+
const log = BufferedLoggerToStdOut();
|
|
11
|
+
const {indexContentBatch, getIndexStats, resetIndex, config, flush} = await BuildComponents({log, indexingCoalesceMs: INDEXING_COALESCE_MS});
|
|
12
|
+
const walkFiles = WalkFiles({cwd, log, ignoreFiles: config.ignoreFiles, followSymlinks: config.followSymlinks});
|
|
13
|
+
const indexApp = IndexApp({walkFiles, indexContent: indexContentBatch, log, maxFileBytes: config.maxFileBytes});
|
|
14
|
+
|
|
15
|
+
const inputs = process.argv.slice(2);
|
|
16
|
+
if (!inputs.length) inputs.push(".");
|
|
17
|
+
|
|
18
|
+
log(`[${appId}] resetting index...`);
|
|
19
|
+
await resetIndex();
|
|
20
|
+
log(`[${appId}] started, indexing: ${inputs.join(", ")}`);
|
|
21
|
+
await indexApp(inputs);
|
|
22
|
+
await flush();
|
|
23
|
+
log(`[${appId}] done:`, await getIndexStats());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xindex",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Local semantic code search — index codebase, search by meaning or keywords",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "xindex.ts",
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
"xindex-search": "bin/xindex-search",
|
|
11
11
|
"xindex-mcp": "bin/xindex-mcp",
|
|
12
12
|
"xindex-reset": "bin/xindex-reset",
|
|
13
|
+
"xindex-reindex": "bin/xindex-reindex",
|
|
13
14
|
"xindex-watch": "bin/xindex-watch"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
17
|
"index": "tsx apps/run.index.ts",
|
|
17
18
|
"search": "tsx apps/run.search.ts",
|
|
18
19
|
"reset": "tsx apps/run.reset.ts",
|
|
20
|
+
"reindex": "tsx apps/run.reindex.ts",
|
|
19
21
|
"test": "npm run test.functional && npm run test.compilation",
|
|
20
22
|
"dev.ci": "npm run test && npm run test.npx",
|
|
21
23
|
"mcp": "tsx apps/run.mcp.ts",
|