indexer-cli 0.2.9 → 0.3.4
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 +62 -51
- package/dist/cli/commands/init.js +27 -9
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/search.js +2 -2
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/skill-template.md +17 -28
- package/dist/cli/commands/skills.d.ts +7 -0
- package/dist/cli/commands/skills.js +207 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/uninstall.js +7 -4
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/package.json +50 -50
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# indexer-cli
|
|
2
2
|
|
|
3
|
-
Project indexer that installs
|
|
3
|
+
Project indexer that installs focused discovery skills for coding agents and helps them spend fewer tokens finding the
|
|
4
|
+
right code.
|
|
4
5
|
|
|
5
6
|
## Overview
|
|
6
7
|
|
|
7
8
|
The main feature of `indexer-cli` is not just search on its own: it turns your repository into something coding agents
|
|
8
|
-
can navigate efficiently. Running `indexer-cli init` installs
|
|
9
|
-
OpenCode, and similar tools
|
|
9
|
+
can navigate efficiently. Running `indexer-cli init` installs project-local discovery skills with semantic names so
|
|
10
|
+
Claude, OpenCode, and similar tools can pick the right indexed workflow instead of wasting tokens on blind `grep`,
|
|
10
11
|
`find`, and repeated file reads.
|
|
11
12
|
|
|
12
13
|
Under the hood, `indexer-cli` indexes source code, generates vector embeddings through a local Ollama instance, and
|
|
@@ -15,8 +16,9 @@ search, repo structure snapshots, and low-friction incremental reindexing withou
|
|
|
15
16
|
|
|
16
17
|
## Features
|
|
17
18
|
|
|
18
|
-
- **Code-agent repo
|
|
19
|
-
- **Token savings for agents**: Pushes agents toward indexed discovery instead of expensive blind search and repeated
|
|
19
|
+
- **Code-agent repo skills**: `init` installs focused autonomous discovery skills for Claude and OpenCode workflows
|
|
20
|
+
- **Token savings for agents**: Pushes agents toward indexed discovery instead of expensive blind search and repeated
|
|
21
|
+
context loading
|
|
20
22
|
- **Multi-language support**: TypeScript/JavaScript, Python, C#, GDScript, Ruby
|
|
21
23
|
- **Semantic code search**: Natural language queries over your entire codebase
|
|
22
24
|
- **Incremental indexing**: Uses `git diff` to re-index only changed files, bulk-copies unchanged vectors
|
|
@@ -28,7 +30,8 @@ search, repo structure snapshots, and low-friction incremental reindexing withou
|
|
|
28
30
|
|
|
29
31
|
## Prerequisites
|
|
30
32
|
|
|
31
|
-
- [Ollama](https://ollama.ai) installed manually. `npx indexer-cli setup` will verify it, start the daemon if needed,
|
|
33
|
+
- [Ollama](https://ollama.ai) installed manually. `npx indexer-cli setup` will verify it, start the daemon if needed,
|
|
34
|
+
and prepare the `jina-8k` model.
|
|
32
35
|
- Node.js 18+ and build tools (python3, make, C++ compiler) for native dependencies.
|
|
33
36
|
|
|
34
37
|
## Quick Start
|
|
@@ -37,7 +40,7 @@ search, repo structure snapshots, and low-friction incremental reindexing withou
|
|
|
37
40
|
# 1. Check prerequisites and prepare the embedding model
|
|
38
41
|
npx indexer-cli setup
|
|
39
42
|
|
|
40
|
-
# 2. Initialize indexing and install the
|
|
43
|
+
# 2. Initialize indexing and install the discovery skills
|
|
41
44
|
cd /path/to/your/project
|
|
42
45
|
npx indexer-cli init
|
|
43
46
|
|
|
@@ -45,18 +48,20 @@ npx indexer-cli init
|
|
|
45
48
|
npx indexer-cli index
|
|
46
49
|
|
|
47
50
|
# 4. Search semantically yourself
|
|
48
|
-
npx indexer-cli search "authentication middleware"
|
|
51
|
+
npx indexer-cli search "authentication middleware" --txt
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
After `init`, the repo
|
|
54
|
+
After `init`, the repo contains focused skills like `.claude/skills/semantic-search/SKILL.md`,
|
|
55
|
+
`.claude/skills/repo-structure/SKILL.md`, `.claude/skills/repo-context/SKILL.md`, and
|
|
56
|
+
`.claude/skills/dependency-trace/SKILL.md`, so coding agents can load the right indexed discovery workflow for
|
|
52
57
|
`npx indexer-cli search`, `npx indexer-cli structure`, `npx indexer-cli architecture`, `npx indexer-cli context`,
|
|
53
58
|
`npx indexer-cli explain`, and `npx indexer-cli deps` before they start burning tokens on broad filesystem scans.
|
|
54
59
|
|
|
55
60
|
## Why agents save tokens with this
|
|
56
61
|
|
|
57
|
-
Without
|
|
58
|
-
reads, and trial-and-error navigation. With `indexer-cli`,
|
|
59
|
-
|
|
62
|
+
Without repo-local skills, agents often spend tokens on repetitive repository discovery: broad `grep`, repeated file
|
|
63
|
+
reads, and trial-and-error navigation. With `indexer-cli`, agents can load a focused skill that matches the current
|
|
64
|
+
discovery intent and start from indexed search or structure-aware commands immediately.
|
|
60
65
|
|
|
61
66
|
In practice, that means:
|
|
62
67
|
|
|
@@ -67,46 +72,51 @@ In practice, that means:
|
|
|
67
72
|
|
|
68
73
|
## Agent Integration
|
|
69
74
|
|
|
70
|
-
When you run `npx indexer-cli init`, the CLI creates
|
|
71
|
-
`.claude/skills
|
|
75
|
+
When you run `npx indexer-cli init`, the CLI creates focused discovery skills for each major read-only discovery
|
|
76
|
+
command under `.claude/skills/` and adds `.claude/` to `.gitignore`.
|
|
72
77
|
|
|
73
|
-
|
|
78
|
+
Those skills cover repository discovery flows such as:
|
|
74
79
|
|
|
75
80
|
```bash
|
|
76
81
|
npx indexer-cli search "<query>"
|
|
77
82
|
npx indexer-cli structure --path-prefix src/<area>
|
|
78
83
|
npx indexer-cli architecture
|
|
79
|
-
npx indexer-cli
|
|
84
|
+
npx indexer-cli context --scope relevant-to:src/<area>
|
|
80
85
|
```
|
|
81
86
|
|
|
82
87
|
By default, discovery commands now return JSON. Use `--txt` whenever you want human-readable output instead.
|
|
83
88
|
|
|
84
89
|
This is especially useful in Claude and OpenCode setups, where project-local skills can guide the agent away from
|
|
85
|
-
blind `grep`/`find` usage and toward indexed
|
|
86
|
-
|
|
90
|
+
blind `grep`/`find` usage and toward indexed discovery, which usually means less wasted context and lower token usage
|
|
91
|
+
during repo discovery.
|
|
87
92
|
|
|
88
93
|
## CLI Commands
|
|
89
94
|
|
|
90
95
|
### `npx indexer-cli setup`
|
|
91
96
|
|
|
92
|
-
Check system prerequisites and prepare the Ollama embedding model. `setup` can install some system tools where
|
|
97
|
+
Check system prerequisites and prepare the Ollama embedding model. `setup` can install some system tools where
|
|
98
|
+
appropriate, but Ollama itself must be installed manually first. Works on macOS and Linux.
|
|
93
99
|
|
|
94
100
|
### `npx indexer-cli init`
|
|
95
101
|
|
|
96
102
|
Create the `.indexer-cli/` directory, initialize the SQLite database and LanceDB vector store, and add `.indexer-cli/`
|
|
97
|
-
to `.gitignore` in the current working directory. Also writes
|
|
98
|
-
|
|
103
|
+
to `.gitignore` in the current working directory. Also writes focused discovery skills under `.claude/skills/` and
|
|
104
|
+
adds `.claude/` to `.gitignore`.
|
|
105
|
+
|
|
106
|
+
| Option | Description |
|
|
107
|
+
|---------------------|---------------------------------------------------------------------------------|
|
|
108
|
+
| `--refresh-skills` | Remove this CLI's generated skills under `.claude/skills/` and recreate them |
|
|
99
109
|
|
|
100
110
|
### `npx indexer-cli index`
|
|
101
111
|
|
|
102
112
|
Index all supported source files in the current working directory.
|
|
103
113
|
|
|
104
|
-
| Option | Description
|
|
105
|
-
|
|
106
|
-
| `--full` | Force a full reindex instead of incremental
|
|
107
|
-
| `--dry-run` | Preview what would be indexed without writing anything
|
|
108
|
-
| `--status` | Show indexing status for the current project
|
|
109
|
-
| `--tree` | Show indexed file tree (use with `--status`)
|
|
114
|
+
| Option | Description |
|
|
115
|
+
|-------------|------------------------------------------------------------|
|
|
116
|
+
| `--full` | Force a full reindex instead of incremental |
|
|
117
|
+
| `--dry-run` | Preview what would be indexed without writing anything |
|
|
118
|
+
| `--status` | Show indexing status for the current project |
|
|
119
|
+
| `--tree` | Show indexed file tree (use with `--status`) |
|
|
110
120
|
| `--txt` | Output status as human-readable text (use with `--status`) |
|
|
111
121
|
|
|
112
122
|
### `npx indexer-cli search <query>`
|
|
@@ -115,16 +125,17 @@ Run a semantic search against the indexed codebase. Automatically re-indexes cha
|
|
|
115
125
|
|
|
116
126
|
| Option | Default | Description |
|
|
117
127
|
|--------------------------|---------|--------------------------------------------------------------------------------------------------------------|
|
|
118
|
-
| `--
|
|
128
|
+
| `--max-files <number>` | 3 | Number of results to return |
|
|
119
129
|
| `--path-prefix <string>` | — | Limit results to files under this path |
|
|
120
130
|
| `--chunk-types <string>` | — | Comma-separated filter: `full_file`, `imports`, `preamble`, `declaration`, `module_section`, `impl`, `types` |
|
|
121
131
|
| `--fields <list>` | — | Comma-separated output fields: `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`, `content` |
|
|
122
132
|
| `--min-score <number>` | — | Filter out results below this score (0..1) |
|
|
123
|
-
| `--omit-content` |
|
|
124
|
-
| `--include-content` | — | Include `content` in JSON output
|
|
133
|
+
| `--omit-content` | + | Explicitly exclude content from results (default behavior in JSON mode) |
|
|
134
|
+
| `--include-content` | — | Include `content` in JSON output |
|
|
125
135
|
| `--txt` | — | Output results as human-readable text |
|
|
126
136
|
|
|
127
|
-
`search` returns JSON by default. In JSON mode, `content` is omitted unless you pass `--include-content`; use `--txt`
|
|
137
|
+
`search` returns JSON by default. In JSON mode, `content` is omitted unless you pass `--include-content`; use `--txt`
|
|
138
|
+
for the older human-readable layout.
|
|
128
139
|
|
|
129
140
|
### `npx indexer-cli structure`
|
|
130
141
|
|
|
@@ -144,48 +155,48 @@ files if needed.
|
|
|
144
155
|
Print an architecture snapshot for the current working directory: file statistics, detected entry points, and a
|
|
145
156
|
dependency graph.
|
|
146
157
|
|
|
147
|
-
| Option | Description
|
|
148
|
-
|
|
149
|
-
| `--path-prefix <string>` | Limit output to files under this path
|
|
150
|
-
| `--include-fixtures` | Include fixture/vendor paths in output
|
|
151
|
-
| `--txt` | Output as human-readable text
|
|
158
|
+
| Option | Description |
|
|
159
|
+
|--------------------------|----------------------------------------|
|
|
160
|
+
| `--path-prefix <string>` | Limit output to files under this path |
|
|
161
|
+
| `--include-fixtures` | Include fixture/vendor paths in output |
|
|
162
|
+
| `--txt` | Output as human-readable text |
|
|
152
163
|
|
|
153
164
|
### `npx indexer-cli context`
|
|
154
165
|
|
|
155
166
|
Output dense project context aggregated from the index. Useful for getting a concise overview of a codebase area
|
|
156
167
|
without pulling in entire files.
|
|
157
168
|
|
|
158
|
-
| Option | Default | Description
|
|
159
|
-
|
|
160
|
-
| `--txt` | — | Output results as human-readable text
|
|
161
|
-
| `--scope <scope>` | all | `all`, `changed` (uncommitted changes), or `relevant-to:<path>`
|
|
162
|
-
| `--max-deps <number>` | 30 | Maximum number of dependency edges to output
|
|
163
|
-
| `--include-fixtures` | — | Include fixture/vendor paths in output
|
|
169
|
+
| Option | Default | Description |
|
|
170
|
+
|-----------------------|---------|-----------------------------------------------------------------|
|
|
171
|
+
| `--txt` | — | Output results as human-readable text |
|
|
172
|
+
| `--scope <scope>` | all | `all`, `changed` (uncommitted changes), or `relevant-to:<path>` |
|
|
173
|
+
| `--max-deps <number>` | 30 | Maximum number of dependency edges to output |
|
|
174
|
+
| `--include-fixtures` | — | Include fixture/vendor paths in output |
|
|
164
175
|
|
|
165
176
|
### `npx indexer-cli explain <symbol>`
|
|
166
177
|
|
|
167
178
|
Show context for a symbol: its signature, callers, and containing module. Use this to quickly understand what a
|
|
168
179
|
specific function, class, or type does and how it is used.
|
|
169
180
|
|
|
170
|
-
| Option
|
|
171
|
-
|
|
172
|
-
| `--txt`
|
|
181
|
+
| Option | Description |
|
|
182
|
+
|---------|-------------------------------|
|
|
183
|
+
| `--txt` | Output as human-readable text |
|
|
173
184
|
|
|
174
185
|
### `npx indexer-cli deps <path>`
|
|
175
186
|
|
|
176
187
|
Show callers (who imports this) and callees (what this imports) for a module or symbol. Useful for tracing impact
|
|
177
188
|
of changes and understanding dependency chains.
|
|
178
189
|
|
|
179
|
-
| Option | Default | Description
|
|
180
|
-
|
|
181
|
-
| `--direction <dir>` | both | `callers`, `callees`, or `both`
|
|
182
|
-
| `--depth <n>` | 1 | Traversal depth
|
|
183
|
-
| `--txt` | — | Output as human-readable text
|
|
190
|
+
| Option | Default | Description |
|
|
191
|
+
|---------------------|---------|---------------------------------|
|
|
192
|
+
| `--direction <dir>` | both | `callers`, `callees`, or `both` |
|
|
193
|
+
| `--depth <n>` | 1 | Traversal depth |
|
|
194
|
+
| `--txt` | — | Output as human-readable text |
|
|
184
195
|
|
|
185
196
|
### `npx indexer-cli uninstall`
|
|
186
197
|
|
|
187
198
|
Remove the `.indexer-cli/` directory from the current working directory. Also removes the generated
|
|
188
|
-
`.claude/skills
|
|
199
|
+
`.claude/skills/` directories created by `indexer-cli` when present. Prompts for confirmation unless `-f` is given.
|
|
189
200
|
|
|
190
201
|
## License
|
|
191
202
|
|
|
@@ -14,7 +14,7 @@ const sqlite_js_1 = require("../../storage/sqlite.js");
|
|
|
14
14
|
const vectors_js_1 = require("../../storage/vectors.js");
|
|
15
15
|
const help_text_js_1 = require("../help-text.js");
|
|
16
16
|
const ensure_indexed_js_1 = require("./ensure-indexed.js");
|
|
17
|
-
const
|
|
17
|
+
const skills_js_1 = require("./skills.js");
|
|
18
18
|
const HOOK_MARKER_START = "# >>> indexer-cli >>>";
|
|
19
19
|
const HOOK_MARKER_END = "# <<< indexer-cli <<<";
|
|
20
20
|
const HOOK_BLOCK = `\n${HOOK_MARKER_START}\nnohup npx indexer-cli index > /dev/null 2>&1 &\n${HOOK_MARKER_END}\n`;
|
|
@@ -27,12 +27,24 @@ async function pathExists(targetPath) {
|
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
async function writeClaudeSkills(projectRoot, skills = skills_js_1.GENERATED_SKILLS) {
|
|
31
|
+
for (const skill of skills) {
|
|
32
|
+
const skillDir = node_path_1.default.join(projectRoot, ".claude", "skills", skill.directory);
|
|
33
|
+
await (0, promises_1.mkdir)(skillDir, { recursive: true });
|
|
34
|
+
const skillPath = node_path_1.default.join(skillDir, "SKILL.md");
|
|
35
|
+
await (0, promises_1.writeFile)(skillPath, skill.content, "utf8");
|
|
36
|
+
console.log(` Skill: ${skillPath}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function refreshClaudeSkills(projectRoot, skillDirectories = skills_js_1.GENERATED_SKILL_DIRECTORIES, skills = skills_js_1.GENERATED_SKILLS) {
|
|
40
|
+
for (const skillDirectory of skillDirectories) {
|
|
41
|
+
const skillDir = node_path_1.default.join(projectRoot, ".claude", "skills", skillDirectory);
|
|
42
|
+
if (await pathExists(skillDir)) {
|
|
43
|
+
await (0, promises_1.rm)(skillDir, { recursive: true, force: true });
|
|
44
|
+
console.log(` Removed stale skill: ${skillDir}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await writeClaudeSkills(projectRoot, skills);
|
|
36
48
|
}
|
|
37
49
|
async function ensureGitignoreEntries(projectRoot, entries) {
|
|
38
50
|
const gitignorePath = node_path_1.default.join(projectRoot, ".gitignore");
|
|
@@ -81,8 +93,9 @@ function registerInitCommand(program) {
|
|
|
81
93
|
program
|
|
82
94
|
.command("init")
|
|
83
95
|
.description("Initialize indexer storage for a project")
|
|
96
|
+
.option("--refresh-skills", "remove this CLI's generated skills and recreate them under .claude/skills")
|
|
84
97
|
.addHelpText("after", `\n${help_text_js_1.PROJECT_ROOT_COMMAND_HELP}\n`)
|
|
85
|
-
.action(async () => {
|
|
98
|
+
.action(async (options) => {
|
|
86
99
|
const resolvedProjectPath = process.cwd();
|
|
87
100
|
const dataDir = node_path_1.default.join(resolvedProjectPath, ".indexer-cli");
|
|
88
101
|
const dbPath = node_path_1.default.join(dataDir, "db.sqlite");
|
|
@@ -108,7 +121,12 @@ function registerInitCommand(program) {
|
|
|
108
121
|
]);
|
|
109
122
|
await ensurePostCommitHook(resolvedProjectPath);
|
|
110
123
|
console.log(`Initialized indexer-cli in ${resolvedProjectPath}`);
|
|
111
|
-
|
|
124
|
+
if (options?.refreshSkills) {
|
|
125
|
+
await refreshClaudeSkills(resolvedProjectPath);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
await writeClaudeSkills(resolvedProjectPath);
|
|
129
|
+
}
|
|
112
130
|
console.log(` SQLite: ${dbPath}`);
|
|
113
131
|
console.log(` Config: ${configPath}`);
|
|
114
132
|
await (0, ensure_indexed_js_1.ensureIndexed)(metadata, resolvedProjectPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;AA2HA,kDA2EC;AAtMD,qCAAmD;AACnD,+CAO0B;AAC1B,0DAA6B;AAE7B,oDAA8C;AAC9C,oDAAkD;AAClD,sDAAwD;AACxD,uDAA8D;AAC9D,yDAAgE;AAChE,kDAA4D;AAC5D,2DAAoD;AACpD,2CAA4E;AAE5E,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAClD,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,UAAU,GAAG,KAAK,iBAAiB,qDAAqD,eAAe,IAAI,CAAC;AAElH,KAAK,UAAU,UAAU,CAAC,UAAkB;IAC3C,IAAI,CAAC;QACJ,MAAM,IAAA,iBAAM,EAAC,UAAU,EAAE,mBAAW,CAAC,IAAI,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,KAAK,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,MAAM,GAAG,4BAAgB;IAEzB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CACzB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,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
86
86
|
!options.includeContent) {
|
|
87
|
-
|
|
87
|
+
return rawFields.filter((field) => field !== "content");
|
|
88
88
|
}
|
|
89
89
|
return rawFields;
|
|
90
90
|
}
|
|
@@ -119,7 +119,7 @@ function registerSearchCommand(program) {
|
|
|
119
119
|
.command("search <query>")
|
|
120
120
|
.description("Search indexed code semantically")
|
|
121
121
|
.addHelpText("after", `\n${help_text_js_1.PROJECT_ROOT_COMMAND_HELP}\n`)
|
|
122
|
-
.option("--
|
|
122
|
+
.option("--max-files <number>", "number of results to return", "3")
|
|
123
123
|
.option("--path-prefix <string>", "limit search to files under a path prefix")
|
|
124
124
|
.option("--chunk-types <string>", "comma-separated chunk types to include")
|
|
125
125
|
.option("--fields <list>", `comma-separated output fields: ${SEARCH_FIELDS.join(", ")}`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":";;;;;AA+JA,sDAuKC;AAtUD,0DAA4B;AAE5B,oDAA2C;AAC3C,kDAAsD;AACtD,oDAA+C;AAC/C,yDAAiE;AACjE,0DAAqD;AACrD,uDAA2D;AAC3D,yDAA6D;AAC7D,kDAAyD;AACzD,sDAA8C;AAC9C,2DAAiD;AAEjD,MAAM,aAAa,GAAG;IACpB,UAAU;IACV,WAAW;IACX,SAAS;IACT,OAAO;IACP,eAAe;IACf,SAAS;CACD,CAAA;AAWV,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,aAAa,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,KAAK;SACF,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE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ACN,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;gBACvD,CAAC;gBAED,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,uBAAuB,CAAC,CAAA;gBACxD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACxD,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YAC1D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;YAC5C,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACtB,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,UAAU,CAAC;gBACvB,QAAQ,CAAC,KAAK,EAAE;gBAChB,OAAO,CAAC,KAAK,EAAE;gBACf,QAAQ,CAAC,KAAK,EAAE;aACjB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CACF,CAAA;AACL,CAAC"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: repo-discovery
|
|
3
|
-
description:
|
|
3
|
+
description: REQUIRED: use indexer-cli first for repo discovery in this repository, before grep/glob/find or broad file reads when finding implementations, tracing symbols or behavior, mapping structure, or exploring unfamiliar code.
|
|
4
4
|
allowed-tools: Bash(npx indexer-cli:*)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# MANDATORY: use indexer-cli first for repo discovery
|
|
8
8
|
|
|
9
|
-
Use this skill for
|
|
10
|
-
|
|
9
|
+
Use this skill for discovery work in this repo.
|
|
10
|
+
Auto-load it for requests to find, trace, inspect, understand, or map code here.
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
Always start with indexer-cli for repository discovery.
|
|
15
|
-
Do not use grep, glob, or find unless indexer-cli was insufficient or you need an exact literal match after narrowing
|
|
16
|
-
the area.
|
|
17
|
-
|
|
18
|
-
## Auto-load triggers
|
|
19
|
-
|
|
20
|
-
Load this skill automatically for prompts like:
|
|
12
|
+
## Auto-load when
|
|
21
13
|
|
|
22
14
|
- Find where something is implemented in this repo
|
|
23
15
|
- Trace a symbol, handler, feature, or behavior through the codebase
|
|
@@ -26,23 +18,19 @@ Load this skill automatically for prompts like:
|
|
|
26
18
|
- Map entry points, dependencies, callers, or imports
|
|
27
19
|
- Explore the codebase when the right file is not known yet
|
|
28
20
|
|
|
29
|
-
##
|
|
21
|
+
## Rules
|
|
30
22
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
- You need structure, entry points, or dependency context
|
|
35
|
-
- The task is exploratory and you do not yet know the right file
|
|
23
|
+
- Start with `indexer-cli`.
|
|
24
|
+
- Do not start with `grep`, `glob`, `find`, or repeated full-file reads.
|
|
25
|
+
- Use literal search only after `indexer-cli` narrows the area or when the exact file is already known.
|
|
36
26
|
|
|
37
|
-
## Skip
|
|
27
|
+
## Skip when
|
|
38
28
|
|
|
39
29
|
- The exact file is already known and the task stays inside it
|
|
40
30
|
- You only need an exact literal text match
|
|
41
31
|
- The task is outside this repository
|
|
42
32
|
|
|
43
|
-
## First
|
|
44
|
-
|
|
45
|
-
Run one of these first:
|
|
33
|
+
## First commands
|
|
46
34
|
|
|
47
35
|
```bash
|
|
48
36
|
npx indexer-cli search "<query>"
|
|
@@ -53,11 +41,14 @@ npx indexer-cli structure --kind class
|
|
|
53
41
|
npx indexer-cli architecture
|
|
54
42
|
```
|
|
55
43
|
|
|
56
|
-
## Reading
|
|
44
|
+
## Reading results
|
|
57
45
|
|
|
58
46
|
`npx indexer-cli search` returns ranked code chunks as JSON by default, not whole files.
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
Default fields: `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`.
|
|
48
|
+
Add `--include-content` only when needed.
|
|
49
|
+
|
|
50
|
+
- Prefer default JSON output for agent workflows.
|
|
51
|
+
- Do not pipe `--txt` output through `head`, `tail`, or shell filtering unless a human explicitly needs text output.
|
|
61
52
|
|
|
62
53
|
- Use `score` to prefer the most relevant chunks first and filter obvious low-relevance noise.
|
|
63
54
|
- Use `primarySymbol` to see which function/class/type the chunk belongs to before opening the file.
|
|
@@ -68,8 +59,6 @@ Use `--include-content` when you need `content` in JSON output.
|
|
|
68
59
|
Discovery: `npx indexer-cli search "<query>"`, `npx indexer-cli structure`, `npx indexer-cli architecture`,
|
|
69
60
|
`npx indexer-cli context`, `npx indexer-cli explain <symbol>`, `npx indexer-cli deps <path>`
|
|
70
61
|
|
|
71
|
-
Use `--txt` for human-readable output when you are browsing manually.
|
|
72
|
-
|
|
73
62
|
Narrow when needed with: `--path-prefix`, `--chunk-types`, `--fields`, `--min-score`, `--kind`, `--max-depth`,
|
|
74
63
|
`--max-files`, `--scope`, `--max-deps`, `--direction`, `--include-fixtures`, `--omit-content`, `--include-content`
|
|
75
64
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GENERATED_SKILL_DIRECTORIES = exports.GENERATED_SKILLS = void 0;
|
|
4
|
+
function renderSkill(definition) {
|
|
5
|
+
const sections = [
|
|
6
|
+
"---",
|
|
7
|
+
`name: ${definition.name}`,
|
|
8
|
+
`description: ${definition.description}`,
|
|
9
|
+
`allowed-tools: ${definition.allowedTools.join(", ")}`,
|
|
10
|
+
"---",
|
|
11
|
+
"",
|
|
12
|
+
`# ${definition.heading}`,
|
|
13
|
+
"",
|
|
14
|
+
definition.purpose,
|
|
15
|
+
"",
|
|
16
|
+
"## Auto-load when",
|
|
17
|
+
"",
|
|
18
|
+
...definition.autoLoadWhen.map((item) => `- ${item}`),
|
|
19
|
+
"",
|
|
20
|
+
"## Rules",
|
|
21
|
+
"",
|
|
22
|
+
...definition.rules.map((item) => `- ${item}`),
|
|
23
|
+
];
|
|
24
|
+
if (definition.skipWhen && definition.skipWhen.length > 0) {
|
|
25
|
+
sections.push("", "## Skip when", "", ...definition.skipWhen.map((item) => `- ${item}`));
|
|
26
|
+
}
|
|
27
|
+
sections.push("", "## First commands", "", "```bash", ...definition.firstCommands, "```");
|
|
28
|
+
if (definition.notes && definition.notes.length > 0) {
|
|
29
|
+
sections.push("", "## Notes", "", ...definition.notes.map((item) => `- ${item}`));
|
|
30
|
+
}
|
|
31
|
+
return `${sections.join("\n")}\n`;
|
|
32
|
+
}
|
|
33
|
+
const SKILL_DEFINITIONS = [
|
|
34
|
+
{
|
|
35
|
+
name: "semantic-search",
|
|
36
|
+
directory: "semantic-search",
|
|
37
|
+
description: "Use for semantic implementation search in this repository with npx indexer-cli search before opening many files.",
|
|
38
|
+
heading: "Use semantic-search for implementation hunting",
|
|
39
|
+
purpose: "Use this when the agent already knows it needs semantic search results, not a tree or architecture map. Keep the prompt short and centered on the code concept to find.",
|
|
40
|
+
allowedTools: ["Bash(npx indexer-cli search:*)"],
|
|
41
|
+
autoLoadWhen: [
|
|
42
|
+
"Find where a feature, function, handler, or pattern is implemented",
|
|
43
|
+
"Search for examples of a concept across the repo",
|
|
44
|
+
"Narrow discovery by path, chunk type, score, or fields",
|
|
45
|
+
],
|
|
46
|
+
rules: [
|
|
47
|
+
"Start with npx indexer-cli search instead of grep when the request is semantic or concept-based.",
|
|
48
|
+
"Prefer compact JSON fields first; include content only after the right chunk is found.",
|
|
49
|
+
"Use --path-prefix or --chunk-types when you already know the likely area.",
|
|
50
|
+
],
|
|
51
|
+
skipWhen: [
|
|
52
|
+
"You need a file tree or symbol inventory instead of search results",
|
|
53
|
+
"You already know the exact file and line range to inspect",
|
|
54
|
+
],
|
|
55
|
+
firstCommands: [
|
|
56
|
+
'npx indexer-cli search "<query>"',
|
|
57
|
+
'npx indexer-cli search "<query>" --path-prefix src/<area>',
|
|
58
|
+
'npx indexer-cli search "<query>" --chunk-types impl,types',
|
|
59
|
+
],
|
|
60
|
+
notes: [
|
|
61
|
+
"Useful fields: filePath, startLine, endLine, score, primarySymbol.",
|
|
62
|
+
"Valid --chunk-types values: full_file, imports, preamble, declaration, module_section, impl, types.",
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "repo-structure",
|
|
67
|
+
directory: "repo-structure",
|
|
68
|
+
description: "Use for file-tree and symbol-map questions in this repository with npx indexer-cli structure.",
|
|
69
|
+
heading: "Use repo-structure for tree and symbol-map questions",
|
|
70
|
+
purpose: "Use this when the agent needs to see how files and symbols are organized in an area of the repo before reading implementation details.",
|
|
71
|
+
allowedTools: ["Bash(npx indexer-cli structure:*)"],
|
|
72
|
+
autoLoadWhen: [
|
|
73
|
+
"Show the file tree for a module or directory",
|
|
74
|
+
"List symbols by area or symbol kind",
|
|
75
|
+
"Limit structure output to a path prefix or max depth",
|
|
76
|
+
],
|
|
77
|
+
rules: [
|
|
78
|
+
"Prefer structure when layout matters more than implementation snippets.",
|
|
79
|
+
"Use --path-prefix and --kind to keep output focused.",
|
|
80
|
+
"Use JSON output for agents unless a human explicitly asks for text.",
|
|
81
|
+
],
|
|
82
|
+
skipWhen: [
|
|
83
|
+
"You need dependency relationships rather than physical structure",
|
|
84
|
+
"You need semantic search results rather than a tree",
|
|
85
|
+
],
|
|
86
|
+
firstCommands: [
|
|
87
|
+
"npx indexer-cli structure",
|
|
88
|
+
"npx indexer-cli structure --path-prefix src/<area>",
|
|
89
|
+
"npx indexer-cli structure --kind function",
|
|
90
|
+
],
|
|
91
|
+
notes: [
|
|
92
|
+
"Valid --kind values: function, class, method, interface, type, variable, module, signal.",
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "repo-architecture",
|
|
97
|
+
directory: "repo-architecture",
|
|
98
|
+
description: "Use for entry points, dependency graphs, and module-level architecture questions with npx indexer-cli architecture.",
|
|
99
|
+
heading: "Use repo-architecture for dependency-graph questions",
|
|
100
|
+
purpose: "Use this when the agent needs a high-level snapshot of modules, entry points, and dependency shape before going deeper.",
|
|
101
|
+
allowedTools: ["Bash(npx indexer-cli architecture:*)"],
|
|
102
|
+
autoLoadWhen: [
|
|
103
|
+
"Identify entry points or major modules",
|
|
104
|
+
"Inspect dependency-map shape across an area of the repo",
|
|
105
|
+
"Understand architecture before refactoring or large changes",
|
|
106
|
+
],
|
|
107
|
+
rules: [
|
|
108
|
+
"Use architecture when the question is about system shape, not a single symbol.",
|
|
109
|
+
"Filter by path prefix when only one subsystem matters.",
|
|
110
|
+
"Use JSON output to preserve structured dependency data.",
|
|
111
|
+
],
|
|
112
|
+
skipWhen: [
|
|
113
|
+
"You need callers/callees for one specific file or symbol",
|
|
114
|
+
"You need dense narrative context instead of a graph-shaped overview",
|
|
115
|
+
],
|
|
116
|
+
firstCommands: [
|
|
117
|
+
"npx indexer-cli architecture",
|
|
118
|
+
"npx indexer-cli architecture --path-prefix src/<area>",
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "repo-context",
|
|
123
|
+
directory: "repo-context",
|
|
124
|
+
description: "Use for dense, token-efficient project summaries with npx indexer-cli context.",
|
|
125
|
+
heading: "Use repo-context for dense summaries",
|
|
126
|
+
purpose: "Use this when the agent wants a compressed view of a subsystem, changed area, or dependency neighborhood without opening many files.",
|
|
127
|
+
allowedTools: ["Bash(npx indexer-cli context:*)"],
|
|
128
|
+
autoLoadWhen: [
|
|
129
|
+
"Summarize the current project or a changed area",
|
|
130
|
+
"Collect context relevant to one path before editing",
|
|
131
|
+
"Get dependency-limited snapshots for prompt building",
|
|
132
|
+
],
|
|
133
|
+
rules: [
|
|
134
|
+
"Prefer context when you want breadth over exact source snippets.",
|
|
135
|
+
"Use --scope to target all, changed, or relevant-to:<path>.",
|
|
136
|
+
"Lower --max-deps when you need a tighter prompt budget.",
|
|
137
|
+
],
|
|
138
|
+
skipWhen: [
|
|
139
|
+
"You need exact implementation locations or ranked chunks",
|
|
140
|
+
"You need a file tree or architecture graph instead of a summary",
|
|
141
|
+
],
|
|
142
|
+
firstCommands: [
|
|
143
|
+
"npx indexer-cli context",
|
|
144
|
+
"npx indexer-cli context --scope changed",
|
|
145
|
+
"npx indexer-cli context --scope relevant-to:src/<area>",
|
|
146
|
+
],
|
|
147
|
+
notes: ["Valid --scope values: all, changed, relevant-to:<path>."],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "symbol-explain",
|
|
151
|
+
directory: "symbol-explain",
|
|
152
|
+
description: "Use for one-symbol understanding with npx indexer-cli explain <symbol>.",
|
|
153
|
+
heading: "Use symbol-explain for one symbol at a time",
|
|
154
|
+
purpose: "Use this when the task centers on one function, class, type, or symbol and the agent needs signature, usage, and containing module context fast.",
|
|
155
|
+
allowedTools: ["Bash(npx indexer-cli explain:*)"],
|
|
156
|
+
autoLoadWhen: [
|
|
157
|
+
"Understand what one symbol does",
|
|
158
|
+
"Inspect the signature and callers of one function or class",
|
|
159
|
+
"Get targeted context before editing a known symbol",
|
|
160
|
+
],
|
|
161
|
+
rules: [
|
|
162
|
+
"Use explain only when the symbol name is already known.",
|
|
163
|
+
"Do not use this skill for symbol discovery; use it only once the symbol name is already known.",
|
|
164
|
+
"Keep the prompt centered on a single symbol for the cleanest output.",
|
|
165
|
+
],
|
|
166
|
+
skipWhen: [
|
|
167
|
+
"You need to discover candidate symbols first",
|
|
168
|
+
"You need repo-wide structure rather than one-symbol context",
|
|
169
|
+
],
|
|
170
|
+
firstCommands: ["npx indexer-cli explain <symbol>"],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "dependency-trace",
|
|
174
|
+
directory: "dependency-trace",
|
|
175
|
+
description: "Use for caller/callee and impact-trace questions with npx indexer-cli deps <path>.",
|
|
176
|
+
heading: "Use dependency-trace for impact analysis",
|
|
177
|
+
purpose: "Use this when the agent needs to know who imports a module, what it imports, or how far change impact may spread.",
|
|
178
|
+
allowedTools: ["Bash(npx indexer-cli deps:*)"],
|
|
179
|
+
autoLoadWhen: [
|
|
180
|
+
"Trace callers or callees for a module or symbol",
|
|
181
|
+
"Estimate change impact before refactoring",
|
|
182
|
+
"Follow dependency chains in one direction or both",
|
|
183
|
+
],
|
|
184
|
+
rules: [
|
|
185
|
+
"Use deps when the question is about relationships, not source snippets.",
|
|
186
|
+
"Set --direction callers or --direction callees when only one side matters.",
|
|
187
|
+
"Increase depth only when the first hop is not enough.",
|
|
188
|
+
],
|
|
189
|
+
skipWhen: [
|
|
190
|
+
"You need a repo-wide architecture snapshot rather than one trace",
|
|
191
|
+
"You do not yet know the path or symbol to trace",
|
|
192
|
+
],
|
|
193
|
+
firstCommands: [
|
|
194
|
+
"npx indexer-cli deps <path>",
|
|
195
|
+
"npx indexer-cli deps <path> --direction callers",
|
|
196
|
+
"npx indexer-cli deps <path> --direction callees",
|
|
197
|
+
],
|
|
198
|
+
notes: ["Valid --direction values: callers, callees, both."],
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
exports.GENERATED_SKILLS = SKILL_DEFINITIONS.map((definition) => ({
|
|
202
|
+
name: definition.name,
|
|
203
|
+
directory: definition.directory,
|
|
204
|
+
content: renderSkill(definition),
|
|
205
|
+
}));
|
|
206
|
+
exports.GENERATED_SKILL_DIRECTORIES = exports.GENERATED_SKILLS.map((skill) => skill.directory);
|
|
207
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/cli/commands/skills.ts"],"names":[],"mappings":";;;AAcA,SAAS,WAAW,CAAC,U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;QACnD,OAAO,EACN,mHAAmH;QACpH,YAAY,EAAE,CAAC,8BAA8B,CAAC;QAC9C,YAAY,EAAE;YACb,iDAAiD;YACjD,2CAA2C;YAC3C,mDAAmD;SACnD;QACD,KAAK,EAAE;YACN,yEAAyE;YACzE,4EAA4E;YAC5E,uDAAuD;SACvD;QACD,QAAQ,EAAE;YACT,kEAAkE;YAClE,iDAAiD;SACjD;QACD,aAAa,EAAE;YACd,6BAA6B;YAC7B,iDAAiD;YACjD,iDAAiD;SACjD;QACD,KAAK,EAAE,CAAC,mDAAmD,CAAC;KAC5D;CACD,CAAC;AAQW,QAAA,gBAAgB,GAAqB,iBAAiB,CAAC,GAAG,CACtE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,SAAS,EAAE,UAAU,CAAC,SAAS;IAC/B,OAAO,EAAE,WAAW,CAAC,UAAU,CAAC;CAChC,CAAC,CACF,CAAC;AAEW,QAAA,2BAA2B,GAAG,wBAAgB,CAAC,GAAG,CAC9D,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAC1B,CAAC"}
|
|
@@ -10,6 +10,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
10
10
|
const node_process_1 = require("node:process");
|
|
11
11
|
const promises_2 = require("node:readline/promises");
|
|
12
12
|
const help_text_js_1 = require("../help-text.js");
|
|
13
|
+
const skills_js_1 = require("./skills.js");
|
|
13
14
|
const HOOK_MARKER_START = "# >>> indexer-cli >>>";
|
|
14
15
|
const HOOK_MARKER_END = "# <<< indexer-cli <<<";
|
|
15
16
|
async function pathExists(targetPath) {
|
|
@@ -26,10 +27,12 @@ async function isDirEmpty(dirPath) {
|
|
|
26
27
|
return entries.length === 0;
|
|
27
28
|
}
|
|
28
29
|
async function removeClaudeSkill(projectRoot) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
for (const skillDirectory of skills_js_1.GENERATED_SKILL_DIRECTORIES) {
|
|
31
|
+
const skillDir = node_path_1.default.join(projectRoot, ".claude", "skills", skillDirectory);
|
|
32
|
+
if (await pathExists(skillDir)) {
|
|
33
|
+
await (0, promises_1.rm)(skillDir, { recursive: true, force: true });
|
|
34
|
+
console.log(`Removed ${skillDir}`);
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
const skillsDir = node_path_1.default.join(projectRoot, ".claude", "skills");
|
|
35
38
|
if (await pathExists(skillsDir)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/cli/commands/uninstall.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/cli/commands/uninstall.ts"],"names":[],"mappings":";;;;;AAoHA,4DA6CC;AAjKD,qCAAmD;AACnD,+CAO0B;AAC1B,0DAA6B;AAC7B,+CAAgE;AAChE,qDAAyD;AAEzD,kDAA4D;AAC5D,2CAA0D;AAE1D,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAClD,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEhD,KAAK,UAAU,UAAU,CAAC,UAAkB;IAC3C,IAAI,CAAC;QACJ,MAAM,IAAA,iBAAM,EAAC,UAAU,EAAE,mBAAW,CAAC,IAAI,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,OAAO,GAAG,MAAM,IAAA,kBAAO,EAAC,OAAO,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;AAC7B,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IACnD,KAAK,MAAM,cAAc,IAAI,uCAA2B,EAAE,CAAC;QAC1D,MAAM,QAAQ,GAAG,mB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;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;YAC9C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACtB,CAAC;IACF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "indexer-cli",
|
|
3
|
+
"version": "0.3.4",
|
|
4
|
+
"description": "Lightweight CLI project indexer with semantic search via Ollama",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"indexer-cli": "./bin/indexer-cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"start": "tsx bin/indexer-cli.js",
|
|
25
|
+
"indexer-cli": "tsx bin/indexer-cli.js",
|
|
26
|
+
"install:global": "npm run build && npm link --force",
|
|
27
|
+
"uninstall:global": "npm unlink -g indexer-cli",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"release": "bash scripts/publish.sh"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"better-sqlite3": "^12.0.0",
|
|
34
|
+
"commander": "^12.1.0",
|
|
35
|
+
"p-limit": "^4.0.0",
|
|
36
|
+
"sqlite-vec": "^0.1.9",
|
|
37
|
+
"tree-sitter": "^0.21.1",
|
|
38
|
+
"tree-sitter-c-sharp": "^0.23.1",
|
|
39
|
+
"tree-sitter-gdscript": "^6.1.0",
|
|
40
|
+
"tree-sitter-python": "^0.21.0",
|
|
41
|
+
"tree-sitter-ruby": "^0.23.1",
|
|
42
|
+
"ts-morph": "^21.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
46
|
+
"@types/node": "^22.10.0",
|
|
47
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
48
|
+
"tsx": "^4.19.0",
|
|
49
|
+
"typescript": "^5.7.0",
|
|
50
|
+
"vitest": "^4.1.3"
|
|
51
|
+
}
|
|
52
52
|
}
|