opencode-codebase-index 0.13.1 → 0.14.0

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.
@@ -10,7 +10,7 @@
10
10
  "name": "codebase-index",
11
11
  "description": "Semantic code search and codebase graph tools for Claude Code",
12
12
  "source": "./",
13
- "version": "0.13.1"
13
+ "version": "0.13.2"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Semantic code search and codebase graph tools for Claude Code",
5
5
  "displayName": "Codebase Index",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Semantic code search and codebase graph tools for Codex",
5
5
  "author": {
6
6
  "name": "Kenneth",
package/README.md CHANGED
@@ -99,6 +99,15 @@ The plugin includes:
99
99
  - `.mcp.json` running the published `opencode-codebase-index` CLI via `npx … --host codex`, so a git marketplace install works without a local build
100
100
  - `.agents/plugins/marketplace.json` so this repo can act as a Codex marketplace source
101
101
 
102
+ For local plugin development from this checkout, build and link the local MCP bin once:
103
+
104
+ ```bash
105
+ npm run build:ts
106
+ npm run dev:link-mcp
107
+ ```
108
+
109
+ After that, the normal `.mcp.json` command also works when Codex starts the plugin from this repository.
110
+
102
111
  ## 🧩 Claude Code Plugin
103
112
  Install once for Claude Code sessions and get skill guidance plus MCP tools in one manifest.
104
113
 
@@ -155,7 +164,7 @@ Use the same semantic search from any MCP-compatible client. Index once, search
155
164
  "mcpServers": {
156
165
  "codebase-index": {
157
166
  "command": "npx",
158
- "args": ["opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
167
+ "args": ["-y", "--package", "opencode-codebase-index", "opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
159
168
  }
160
169
  }
161
170
  }
@@ -167,7 +176,7 @@ Use the same semantic search from any MCP-compatible client. Index once, search
167
176
  "mcpServers": {
168
177
  "codebase-index": {
169
178
  "command": "npx",
170
- "args": ["opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
179
+ "args": ["-y", "--package", "opencode-codebase-index", "opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
171
180
  }
172
181
  }
173
182
  }
@@ -175,14 +184,16 @@ Use the same semantic search from any MCP-compatible client. Index once, search
175
184
 
176
185
  3. **CLI options**
177
186
  ```bash
178
- npx opencode-codebase-index-mcp --project /path/to/repo # specify project root
179
- npx opencode-codebase-index-mcp --config /path/to/config # custom config file
180
- npx opencode-codebase-index-mcp # uses current directory
187
+ npx -y --package opencode-codebase-index opencode-codebase-index-mcp --project /path/to/repo
188
+ npx -y --package opencode-codebase-index opencode-codebase-index-mcp --config /path/to/config
189
+ npx -y --package opencode-codebase-index opencode-codebase-index-mcp
181
190
  ```
182
191
 
183
192
  The MCP server exposes all 12 tools (`codebase_search`, `codebase_peek`, `find_similar`, `implementation_lookup`, `call_graph`, `call_graph_path`, `pr_impact`, `index_codebase`, `index_status`, `index_health_check`, `index_metrics`, `index_logs`) and 5 prompts (`search`, `find`, `definition`, `index`, `status`).
184
193
 
185
- The MCP dependencies (`@modelcontextprotocol/sdk`, `zod`) are optional peer dependencies they're only needed if you use the MCP server.
194
+ The MCP dependencies (`@modelcontextprotocol/sdk`, `zod`) ship with the package so published `npx --package opencode-codebase-index` launches work in clean MCP clients.
195
+
196
+ If you are testing the MCP command from inside this repository checkout and see `opencode-codebase-index-mcp: command not found`, run `npm run build:ts && npm run dev:link-mcp`. That adds the local bin shim expected by `npx` without changing the published MCP config.
186
197
 
187
198
  ## 🔍 See It In Action
188
199
 
@@ -382,6 +393,7 @@ The plugin exposes these tools to the OpenCode agent:
382
393
  - **Use for**: Discovery, understanding flows, finding logic when you don't know the names.
383
394
  - **Example**: `"find the middleware that sanitizes input"`
384
395
  - **Ranking path**: hybrid retrieval → fusion (`search.fusionStrategy`) → deterministic rerank (`search.rerankTopN`) → filters
396
+ - **Blame filters**: when `indexing.gitBlame.enabled` is `true`, filter with `blameAuthor`, `blameSha`, or `blameSince`.
385
397
 
386
398
  **Writing good queries:**
387
399
 
@@ -400,6 +412,7 @@ The plugin exposes these tools to the OpenCode agent:
400
412
  - **Example output**:
401
413
  ```
402
414
  [1] function "validatePayment" at src/billing.ts:45-67 (score: 0.92)
415
+ abc1234 | Jane Doe | 2025-03-14 | billing: validate payment state
403
416
  [2] class "PaymentProcessor" at src/processor.ts:12-89 (score: 0.87)
404
417
 
405
418
  Use Read tool to examine specific files.
@@ -439,7 +452,7 @@ Returns recent debug logs with optional filtering.
439
452
 
440
453
  ### `call_graph`
441
454
 
442
- Query the call graph to find callers or callees of a function/method. Automatically built during indexing for TypeScript, JavaScript, Python, Go, Rust, PHP, Apex, Zig, GDScript, and MATLAB.
455
+ Query the call graph to find callers or callees of a function/method. Automatically built during indexing for TypeScript, JavaScript, Python, Go, Rust, PHP, Apex, Zig, GDScript, MATLAB, and Bash.
443
456
 
444
457
  - **Use for**: Understanding code flow, tracing dependencies, impact analysis.
445
458
  - **Parameters**: `name` (function name), `direction` (`callers` or `callees`), `symbolId` (required for `callees`, returned by previous queries), `relationshipType` (optional: `Call`, `MethodCall`, `Constructor`, `Import`, `Inherits`, `Implements`).
@@ -775,6 +788,7 @@ String values in `codebase-index.json` can reference environment variables with
775
788
  | `maxDepth` | `5` | Max directory traversal depth. `-1` = unlimited, `0` = only files in root dir, `1` = one level of subdirectories, etc. |
776
789
  | `maxFilesPerDirectory` | `100` | Max files to index per directory. Always picks the smallest files first. |
777
790
  | `fallbackToTextOnMaxChunks` | `true` | When a file exceeds `maxChunksPerFile`, fallback to text-based (line-by-line) chunking instead of skipping the rest of the file. |
791
+ | `gitBlame.enabled` | `false` | Annotate changed chunks with `git blame` commit SHA, author, author email, commit timestamp, and summary. Enables `blameAuthor`, `blameSha`, and `blameSince` filters. |
778
792
  | **search** | | |
779
793
  | `maxResults` | `20` | Maximum results to return |
780
794
  | `minScore` | `0.1` | Minimum similarity score (0-1). Lower = more results |
@@ -1164,7 +1178,7 @@ The Rust native module handles performance-critical operations:
1164
1178
  - **usearch**: High-performance vector similarity search with F16 quantization
1165
1179
  - **SQLite**: Persistent storage for embeddings, chunks, branch catalog, symbols, and call edges
1166
1180
  - **BM25 inverted index**: Fast keyword search for hybrid retrieval
1167
- - **Call graph extraction**: Tree-sitter query-based extraction of function calls, method calls, constructors, and imports (TypeScript/JavaScript, Python, Go, Rust, PHP, Apex, Zig, GDScript, MATLAB)
1181
+ - **Call graph extraction**: Tree-sitter query-based extraction of function calls, method calls, constructors, and imports (TypeScript/JavaScript, Python, Go, Rust, PHP, Apex, Zig, GDScript, MATLAB, Bash)
1168
1182
  - **xxhash**: Fast content hashing for change detection
1169
1183
 
1170
1184
  Rebuild with: `npm run build:native` (requires Rust toolchain)
package/commands/peek.md CHANGED
@@ -11,6 +11,9 @@ The first part is the search query. Look for optional parameters:
11
11
  - `type=X` or mentions "functions"/"classes"/"methods" → set chunkType
12
12
  - `dir=X` or "in folder X" → set directory filter
13
13
  - File extensions like ".ts", "typescript", ".py" → set fileType
14
+ - `author=X` or `blameAuthor=X` → set blameAuthor filter
15
+ - `sha=X` or `blameSha=X` → set blameSha filter
16
+ - `since=YYYY-MM-DD` or `blameSince=YYYY-MM-DD` → set blameSince filter
14
17
 
15
18
  Call `codebase_peek` with the parsed arguments.
16
19
 
@@ -18,6 +21,7 @@ Examples:
18
21
  - `/peek authentication logic` → query="authentication logic"
19
22
  - `/peek error handling limit=5` → query="error handling", limit=5
20
23
  - `/peek validation functions` → query="validation", chunkType="function"
24
+ - `/peek auth logic author=jane@example.com since=2025-01-01` → query="auth logic", blameAuthor="jane@example.com", blameSince="2025-01-01"
21
25
 
22
26
  If the index doesn't exist, run `index_codebase` first.
23
27
 
@@ -11,6 +11,9 @@ The first part is the search query. Look for optional parameters:
11
11
  - `type=X` or mentions "functions"/"classes"/"methods" → set chunkType
12
12
  - `dir=X` or "in folder X" → set directory filter
13
13
  - File extensions like ".ts", "typescript", ".py" → set fileType
14
+ - `author=X` or `blameAuthor=X` → set blameAuthor filter
15
+ - `sha=X` or `blameSha=X` → set blameSha filter
16
+ - `since=YYYY-MM-DD` or `blameSince=YYYY-MM-DD` → set blameSince filter
14
17
 
15
18
  Call `codebase_search` with the parsed arguments.
16
19
 
@@ -18,6 +21,7 @@ Examples:
18
21
  - `/search authentication logic` → query="authentication logic"
19
22
  - `/search error handling limit=5` → query="error handling", limit=5
20
23
  - `/search validation functions` → query="validation", chunkType="function"
24
+ - `/search auth logic author=jane@example.com since=2025-01-01` → query="auth logic", blameAuthor="jane@example.com", blameSince="2025-01-01"
21
25
 
22
26
  If the index doesn't exist, run `index_codebase` first.
23
27