indexer-cli 0.2.5 → 0.2.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.
package/README.md CHANGED
@@ -46,8 +46,8 @@ npx indexer-cli search "authentication middleware"
46
46
  ```
47
47
 
48
48
  After `init`, the repo also contains `.claude/skills/repo-discovery/SKILL.md`, so coding agents can be steered toward
49
- `npx indexer-cli search`, `npx indexer-cli structure`, and `npx indexer-cli architecture` before they start burning tokens on broad
50
- filesystem scans.
49
+ `npx indexer-cli search`, `npx indexer-cli structure`, `npx indexer-cli architecture`, `npx indexer-cli context`,
50
+ `npx indexer-cli explain`, and `npx indexer-cli deps` before they start burning tokens on broad filesystem scans.
51
51
 
52
52
  ## Why agents save tokens with this
53
53
 
@@ -110,9 +110,13 @@ Run a semantic search against the indexed codebase. Automatically re-indexes cha
110
110
 
111
111
  | Option | Default | Description |
112
112
  |--------------------------|---------|--------------------------------------------------------------------------------------------------------------|
113
- | `--top-k <number>` | 10 | Number of results to return |
113
+ | `--top-k <number>` | 3 | Number of results to return |
114
114
  | `--path-prefix <string>` | — | Limit results to files under this path |
115
115
  | `--chunk-types <string>` | — | Comma-separated filter: `full_file`, `imports`, `preamble`, `declaration`, `module_section`, `impl`, `types` |
116
+ | `--fields <list>` | — | Comma-separated output fields: `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`, `content` |
117
+ | `--min-score <number>` | — | Filter out results below this score (0..1) |
118
+ | `--omit-content` | — | Exclude content from results (token-saving) |
119
+ | `--include-content` | — | Include content in JSON output |
116
120
  | `--json` | — | Output results as JSON |
117
121
 
118
122
  ### `npx indexer-cli structure`
@@ -124,6 +128,8 @@ files if needed.
124
128
  |--------------------------|-----------------------------------------------------------------------------------------------------------|
125
129
  | `--path-prefix <string>` | Limit output to files under this path |
126
130
  | `--kind <string>` | Filter by symbol kind: `function`, `class`, `method`, `interface`, `type`, `variable`, `module`, `signal` |
131
+ | `--max-depth <number>` | Limit directory traversal depth in the rendered tree |
132
+ | `--max-files <number>` | Limit number of files shown in output |
127
133
  | `--json` | Output structure as JSON |
128
134
 
129
135
  ### `npx indexer-cli architecture`
@@ -131,10 +137,49 @@ files if needed.
131
137
  Print an architecture snapshot for the current working directory: file statistics, detected entry points, and a
132
138
  dependency graph.
133
139
 
140
+ | Option | Description |
141
+ |--------------------------|----------------------------------------------|
142
+ | `--path-prefix <string>` | Limit output to files under this path |
143
+ | `--include-fixtures` | Include fixture/vendor paths in output |
144
+ | `--json` | Output as JSON |
145
+
146
+ ### `npx indexer-cli context`
147
+
148
+ Output dense project context aggregated from the index. Useful for getting a concise overview of a codebase area
149
+ without pulling in entire files.
150
+
151
+ | Option | Default | Description |
152
+ |-----------------------|---------|--------------------------------------------------------------------------|
153
+ | `--format <format>` | plain | Output format: `plain` or `json` |
154
+ | `--scope <scope>` | all | `all`, `changed` (uncommitted changes), or `relevant-to:<path>` |
155
+ | `--max-deps <number>` | 30 | Maximum number of dependency edges to output |
156
+ | `--include-fixtures` | — | Include fixture/vendor paths in output |
157
+ | `--json` | — | Shorthand for `--format=json` |
158
+
159
+ ### `npx indexer-cli explain <symbol>`
160
+
161
+ Show context for a symbol: its signature, callers, and containing module. Use this to quickly understand what a
162
+ specific function, class, or type does and how it is used.
163
+
164
+ | Option | Description |
165
+ |----------|----------------------|
166
+ | `--json` | Output as JSON |
167
+
168
+ ### `npx indexer-cli deps <path>`
169
+
170
+ Show callers (who imports this) and callees (what this imports) for a module or symbol. Useful for tracing impact
171
+ of changes and understanding dependency chains.
172
+
173
+ | Option | Default | Description |
174
+ |---------------------|---------|---------------------------------------------------|
175
+ | `--direction <dir>` | both | `callers`, `callees`, or `both` |
176
+ | `--depth <n>` | 1 | Traversal depth |
177
+ | `--json` | — | Output as JSON |
178
+
134
179
  ### `npx indexer-cli uninstall`
135
180
 
136
181
  Remove the `.indexer-cli/` directory from the current working directory. Also removes the generated
137
- `.claude/skills/repo-discovery/` skill directory when present, then prompts for confirmation before deleting.
182
+ `.claude/skills/repo-discovery/` skill directory when present. Prompts for confirmation unless `-f` is given.
138
183
 
139
184
  ## License
140
185
 
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Written to `.claude/skills/repo-discovery/SKILL.md` during `indexer-cli init`.
5
5
  */
6
- export declare const SKILL_MD = "---\nname: repo-discovery\ndescription: Mandatory for repository discovery. Before grep/glob/find, first use indexer-cli whenever the task involves finding implementations, tracing behavior, locating symbols, identifying entry points, inspecting module structure, or understanding an unfamiliar area of this repo.\nallowed-tools: Bash(npx indexer-cli:*)\n---\n\n# Repository discovery with indexer-cli\n\nUse this skill for discovery tasks inside this repository.\n\n## Required behavior\n\nAlways start with indexer-cli for repository discovery.\nDo not use grep, glob, or find until indexer-cli was insufficient, or you need an exact literal text match after narrowing the area.\n\n## Load this skill when\n\n- You need to find where something is implemented\n- You need to trace a symbol, handler, feature, or behavior\n- You are entering an unfamiliar module or directory\n- You need structure, entry points, or dependency context\n- The task is exploratory and you do not yet know the right file\n\n## Skip this skill when\n\n- The exact file is already known and the task stays inside it\n- You only need an exact literal text match\n- The task is outside this repository\n\n## First command\n\nRun one of these first:\n\n ```bash\n npx indexer-cli search \"<query>\" --json\n npx indexer-cli search \"<query>\" --json --path-prefix src/<area>\n npx indexer-cli search \"<query>\" --json --chunk-types impl,types\n npx indexer-cli structure --json --path-prefix src/<area>\n npx indexer-cli structure --json --kind class\n npx indexer-cli architecture --json\n npx indexer-cli index --status --json\n ```\n\n## Reading search results\n\n `npx indexer-cli search --json` returns ranked code chunks, not whole files.\nEach result includes `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`, and `content`.\n\n- Use `score` to prefer the most relevant chunks first and filter obvious low-relevance noise.\n- Use `primarySymbol` to see which function/class/type the chunk belongs to before opening the file.\n- Treat `content` as supporting context, but rank and filter with `score` + `primarySymbol` instead of raw text alone.\n\n## Reference\n\n### Chunk types (--chunk-types)\n\n`full_file`, `imports`, `preamble`, `declaration`, `module_section`, `impl`, `types`\n\n### Symbol kinds (--kind)\n\n`function`, `class`, `method`, `interface`, `type`, `variable`, `module`, `signal`\n";
6
+ export declare const SKILL_MD: string;
@@ -1,72 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.SKILL_MD = void 0;
7
+ const node_fs_1 = require("node:fs");
8
+ const node_path_1 = __importDefault(require("node:path"));
4
9
  /**
5
10
  * SKILL.md template for Claude Code integration.
6
11
  *
7
12
  * Written to `.claude/skills/repo-discovery/SKILL.md` during `indexer-cli init`.
8
13
  */
9
- exports.SKILL_MD = `\
10
- ---
11
- name: repo-discovery
12
- description: Mandatory for repository discovery. Before grep/glob/find, first use indexer-cli whenever the task involves finding implementations, tracing behavior, locating symbols, identifying entry points, inspecting module structure, or understanding an unfamiliar area of this repo.
13
- allowed-tools: Bash(npx indexer-cli:*)
14
- ---
15
-
16
- # Repository discovery with indexer-cli
17
-
18
- Use this skill for discovery tasks inside this repository.
19
-
20
- ## Required behavior
21
-
22
- Always start with indexer-cli for repository discovery.
23
- Do not use grep, glob, or find until indexer-cli was insufficient, or you need an exact literal text match after narrowing the area.
24
-
25
- ## Load this skill when
26
-
27
- - You need to find where something is implemented
28
- - You need to trace a symbol, handler, feature, or behavior
29
- - You are entering an unfamiliar module or directory
30
- - You need structure, entry points, or dependency context
31
- - The task is exploratory and you do not yet know the right file
32
-
33
- ## Skip this skill when
34
-
35
- - The exact file is already known and the task stays inside it
36
- - You only need an exact literal text match
37
- - The task is outside this repository
38
-
39
- ## First command
40
-
41
- Run one of these first:
42
-
43
- \`\`\`bash
44
- npx indexer-cli search "<query>" --json
45
- npx indexer-cli search "<query>" --json --path-prefix src/<area>
46
- npx indexer-cli search "<query>" --json --chunk-types impl,types
47
- npx indexer-cli structure --json --path-prefix src/<area>
48
- npx indexer-cli structure --json --kind class
49
- npx indexer-cli architecture --json
50
- npx indexer-cli index --status --json
51
- \`\`\`
52
-
53
- ## Reading search results
54
-
55
- \`npx indexer-cli search --json\` returns ranked code chunks, not whole files.
56
- Each result includes \`filePath\`, \`startLine\`, \`endLine\`, \`score\`, \`primarySymbol\`, and \`content\`.
57
-
58
- - Use \`score\` to prefer the most relevant chunks first and filter obvious low-relevance noise.
59
- - Use \`primarySymbol\` to see which function/class/type the chunk belongs to before opening the file.
60
- - Treat \`content\` as supporting context, but rank and filter with \`score\` + \`primarySymbol\` instead of raw text alone.
61
-
62
- ## Reference
63
-
64
- ### Chunk types (--chunk-types)
65
-
66
- \`full_file\`, \`imports\`, \`preamble\`, \`declaration\`, \`module_section\`, \`impl\`, \`types\`
67
-
68
- ### Symbol kinds (--kind)
69
-
70
- \`function\`, \`class\`, \`method\`, \`interface\`, \`type\`, \`variable\`, \`module\`, \`signal\`
71
- `;
14
+ exports.SKILL_MD = (0, node_fs_1.readFileSync)(node_path_1.default.join(__dirname, "skill-template.md"), "utf8");
72
15
  //# sourceMappingURL=skill-template.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-template.js","sourceRoot":"","sources":["../../../src/cli/commands/skill-template.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DvB,CAAC"}
1
+ {"version":3,"file":"skill-template.js","sourceRoot":"","sources":["../../../src/cli/commands/skill-template.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAuC;AACvC,0DAA6B;AAE7B;;;;GAIG;AACU,QAAA,QAAQ,GAAG,IAAA,sBAAY,EACnC,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EACzC,MAAM,CACN,CAAC"}
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: repo-discovery
3
+ description: Mandatory for repository discovery. Use indexer-cli before grep/glob/find when locating implementations, tracing behavior, finding symbols or entry points, inspecting module structure, or exploring an unfamiliar area of this repo.
4
+ allowed-tools: Bash(npx indexer-cli:*)
5
+ ---
6
+
7
+ # Repository discovery with indexer-cli
8
+
9
+ ## Required behavior
10
+
11
+ Always start with indexer-cli for repository discovery.
12
+ Do not use grep, glob, or find unless indexer-cli was insufficient or you need an exact literal match after narrowing the area.
13
+
14
+ ## Load this skill when
15
+
16
+ - You need to find where something is implemented
17
+ - You need to trace a symbol, handler, feature, or behavior
18
+ - You are entering an unfamiliar module or directory
19
+ - You need structure, entry points, or dependency context
20
+ - The task is exploratory and you do not yet know the right file
21
+
22
+ ## Skip this skill when
23
+
24
+ - The exact file is already known and the task stays inside it
25
+ - You only need an exact literal text match
26
+ - The task is outside this repository
27
+
28
+ ## First command
29
+
30
+ Run one of these first:
31
+
32
+ ```bash
33
+ npx indexer-cli search "<query>" --json
34
+ npx indexer-cli search "<query>" --json --path-prefix src/<area>
35
+ npx indexer-cli search "<query>" --json --chunk-types impl,types
36
+ npx indexer-cli structure --json --path-prefix src/<area>
37
+ npx indexer-cli structure --json --kind class
38
+ npx indexer-cli architecture --json
39
+ npx indexer-cli index --status --json
40
+ ```
41
+
42
+ ## Reading search results
43
+
44
+ `npx indexer-cli search --json` returns ranked code chunks, not whole files.
45
+ Each result includes `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`, and `content`.
46
+
47
+ - Use `score` to prefer the most relevant chunks first and filter obvious low-relevance noise.
48
+ - Use `primarySymbol` to see which function/class/type the chunk belongs to before opening the file.
49
+ - Treat `content` as supporting context, but rank and filter with `score` + `primarySymbol` instead of raw text alone.
50
+ - Content is omitted by default in JSON output; use `--include-content` to include it, or `--omit-content` to make that explicit and save tokens.
51
+
52
+ ## Commands Reference
53
+
54
+ ### `search <query>` — Semantic code search
55
+
56
+ Semantic search over indexed code. Re-indexes changed files if needed.
57
+
58
+ | Option | Default | Description |
59
+ |--------|---------|-------------|
60
+ | `--top-k <number>` | 3 | Max results |
61
+ | `--path-prefix <string>` | — | Restrict to this path prefix |
62
+ | `--chunk-types <string>` | — | Comma-separated chunk type filter |
63
+ | `--fields <list>` | — | Return only these comma-separated fields: `filePath`, `startLine`, `endLine`, `score`, `primarySymbol`, `content` |
64
+ | `--min-score <number>` | — | Drop results below this score (0..1) |
65
+ | `--omit-content` | — | Exclude content to save tokens |
66
+ | `--include-content` | — | Include content in JSON |
67
+ | `--json` | — | JSON output |
68
+
69
+ ### `structure` — File tree with symbols
70
+
71
+ Annotated file tree with extracted symbols. Re-indexes changed files if needed.
72
+
73
+ | Option | Description |
74
+ |--------|-------------|
75
+ | `--path-prefix <string>` | Restrict to this path prefix |
76
+ | `--kind <string>` | Filter symbol kinds |
77
+ | `--max-depth <number>` | Limit traversal depth |
78
+ | `--max-files <number>` | Limit files shown |
79
+ | `--json` | JSON output |
80
+
81
+ ### `architecture` — Architecture snapshot
82
+
83
+ Repo snapshot: file stats, entry points, and dependency graph.
84
+
85
+ | Option | Description |
86
+ |--------|-------------|
87
+ | `--path-prefix <string>` | Restrict to this path prefix |
88
+ | `--include-fixtures` | Include fixture/vendor paths |
89
+ | `--json` | JSON output |
90
+
91
+ ### `context` — Dense project context
92
+
93
+ Dense project context from the index. Useful for a concise area overview.
94
+
95
+ | Option | Default | Description |
96
+ |--------|---------|-------------|
97
+ | `--format <format>` | plain | `plain` or `json` |
98
+ | `--scope <scope>` | all | `all`, `changed`, or `relevant-to:<path>` |
99
+ | `--max-deps <number>` | 30 | Max dependency edges |
100
+ | `--include-fixtures` | — | Include fixture/vendor paths |
101
+ | `--json` | — | Shorthand for `--format=json` |
102
+
103
+ ### `explain <symbol>` — Symbol context
104
+
105
+ Show a symbol's signature, callers, and containing module.
106
+
107
+ | Option | Description |
108
+ |--------|-------------|
109
+ | `--json` | JSON output |
110
+
111
+ ### `deps <path>` — Dependency graph for a path
112
+
113
+ Show importers and imports for a module or symbol.
114
+
115
+ | Option | Default | Description |
116
+ |--------|---------|-------------|
117
+ | `--direction <dir>` | both | `callers`, `callees`, or `both` |
118
+ | `--depth <n>` | 1 | Traversal depth |
119
+ | `--json` | — | JSON output |
120
+
121
+ ### `index` — Index project files
122
+
123
+ | Option | Description |
124
+ |--------|-------------|
125
+ | `--full` | Force full reindex instead of incremental |
126
+ | `--dry-run` | Preview what would be indexed |
127
+ | `--status` | Show indexing status |
128
+ | `--tree` | Show indexed file tree (use with `--status`) |
129
+ | `--json` | Output status as JSON (use with `--status`) |
130
+
131
+ ### `setup` / `init` / `uninstall`
132
+
133
+ - `setup` — Check prerequisites and prepare the Ollama embedding model.
134
+ - `init` — Create `.indexer-cli/`, initialize databases, and install this skill.
135
+ - `uninstall` — Remove indexer data (`-f` skips confirmation).
136
+
137
+ ## Type Reference
138
+
139
+ ### Chunk types (--chunk-types)
140
+
141
+ `full_file`, `imports`, `preamble`, `declaration`, `module_section`, `impl`, `types`
142
+
143
+ ### Symbol kinds (--kind)
144
+
145
+ `function`, `class`, `method`, `interface`, `type`, `variable`, `module`, `signal`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indexer-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Lightweight CLI project indexer with semantic search via Ollama",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "scripts": {
22
- "build": "tsc",
22
+ "build": "tsc && node scripts/copy-skill-template.mjs",
23
23
  "dev": "tsc --watch",
24
24
  "start": "tsx bin/indexer-cli.js",
25
25
  "indexer-cli": "tsx bin/indexer-cli.js",