opencode-codebase-index 0.12.0 → 0.13.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.
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "helweg-plugins",
3
+ "owner": {
4
+ "name": "Kenneth",
5
+ "email": "kenneth@example.com",
6
+ "url": "https://github.com/Helweg/opencode-codebase-index"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "codebase-index",
11
+ "description": "Semantic code search and codebase graph tools for Claude Code",
12
+ "source": "./",
13
+ "version": "0.12.0"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "codebase-index",
3
+ "version": "0.13.0",
4
+ "description": "Semantic code search and codebase graph tools for Claude Code",
5
+ "displayName": "Codebase Index",
6
+ "author": {
7
+ "name": "Kenneth",
8
+ "email": "kenneth@example.com",
9
+ "url": "https://github.com/Helweg/opencode-codebase-index"
10
+ },
11
+ "homepage": "https://github.com/Helweg/opencode-codebase-index",
12
+ "repository": "https://github.com/Helweg/opencode-codebase-index",
13
+ "license": "MIT",
14
+ "keywords": [
15
+ "codebase-index",
16
+ "semantic search",
17
+ "claude",
18
+ "claude-code",
19
+ "mcp"
20
+ ],
21
+ "skills": "./skills/",
22
+ "hooks": "./hooks/hooks.json",
23
+ "mcpServers": {
24
+ "codebase-index": {
25
+ "command": "npx",
26
+ "args": ["-y", "--package", "opencode-codebase-index", "opencode-codebase-index-mcp", "--host", "claude"]
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "codebase-index",
3
+ "version": "0.13.0",
4
+ "description": "Semantic code search and codebase graph tools for Codex",
5
+ "author": {
6
+ "name": "Kenneth",
7
+ "email": "kenneth@example.com",
8
+ "url": "https://github.com/Helweg/opencode-codebase-index"
9
+ },
10
+ "homepage": "https://github.com/Helweg/opencode-codebase-index",
11
+ "repository": "https://github.com/Helweg/opencode-codebase-index",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "codebase-index",
15
+ "semantic search",
16
+ "opencode",
17
+ "codex",
18
+ "mcp"
19
+ ],
20
+ "skills": "./skills/",
21
+ "hooks": "./hooks/hooks.json",
22
+ "id": "codebase-index",
23
+ "mcpServers": "./.mcp.json",
24
+ "interface": {
25
+ "displayName": "Codebase Index",
26
+ "shortDescription": "Navigate large codebases with semantic search and graph tools",
27
+ "longDescription": "Install this plugin to get semantic search tools in Codex. The skill layer gives usage guidance, and MCP tools provide searchable context for large repos.",
28
+ "developerName": "Kenneth",
29
+ "category": "Productivity",
30
+ "capabilities": [
31
+ "Instructions",
32
+ "MCP Tools",
33
+ "Search"
34
+ ],
35
+ "websiteURL": "https://github.com/Helweg/opencode-codebase-index",
36
+ "privacyPolicyURL": "https://github.com/Helweg/opencode-codebase-index/blob/main/SECURITY.md",
37
+ "termsOfServiceURL": "https://github.com/Helweg/opencode-codebase-index/blob/main/LICENSE",
38
+ "brandColor": "#3B82F6",
39
+ "defaultPrompt": [
40
+ "Use codebase-search skills and MCP tools to find local implementation context before edits."
41
+ ]
42
+ }
43
+ }
package/.mcp.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "codebase-index": {
4
+ "command": "npx",
5
+ "args": ["-y", "--package", "opencode-codebase-index", "opencode-codebase-index-mcp", "--host", "codex"]
6
+ }
7
+ }
8
+ }
package/README.md CHANGED
@@ -8,11 +8,14 @@
8
8
 
9
9
  > **Stop grepping for concepts. Start searching for meaning.**
10
10
 
11
- **opencode-codebase-index** brings semantic understanding to your [OpenCode](https://opencode.ai) workflow and now to any MCP-compatible client like Cursor, Claude Code, and Windsurf. Instead of guessing function names or grepping for keywords, ask your codebase questions in plain English.
11
+ **opencode-codebase-index** brings semantic understanding to your [OpenCode](https://opencode.ai), [Pi](https://pi.dev), Codex, and MCP-compatible workflows. Instead of guessing function names or grepping for keywords, ask your codebase questions in plain English.
12
12
 
13
13
  ## 📌 Quick Navigation
14
14
 
15
15
  - [⚡ Quick Start](#-quick-start)
16
+ - [🥧 Pi Package](#-pi-package)
17
+ - [🧩 Codex Plugin](#-codex-plugin)
18
+ - [🧩 Claude Code Plugin](#-claude-code-plugin)
16
19
  - [🌐 MCP Server (Cursor, Claude Code, Windsurf, etc.)](#-mcp-server-cursor-claude-code-windsurf-etc)
17
20
  - [🎯 When to Use What](#-when-to-use-what)
18
21
  - [🧭 OMO CodeGraph Compatibility](#-omo-codegraph-compatibility)
@@ -26,6 +29,7 @@
26
29
  ## 👋 Choose Your Path
27
30
 
28
31
  - **I want to try it now** → go to [Quick Start](#-quick-start)
32
+ - **I use Pi** → go to [Pi Package](#-pi-package)
29
33
  - **I use Cursor/Claude Code/Windsurf** → go to [MCP Server setup](#-mcp-server-cursor-claude-code-windsurf-etc)
30
34
  - **I’m comparing tools and workflows** → go to [When to Use What](#-when-to-use-what)
31
35
  - **I’m tuning behavior/cost/performance** → go to [Configuration](#️-configuration)
@@ -38,6 +42,7 @@
38
42
  - 🌿 **Branch-Aware**: Seamlessly handles git branch switches — reuses embeddings, filters stale results.
39
43
  - 🔒 **Privacy Focused**: Your vector index is stored locally in your project.
40
44
  - 🔌 **Model Agnostic**: Works out-of-the-box with GitHub Copilot, OpenAI, Gemini, or local Ollama models.
45
+ - 🥧 **Pi Package**: First-class Pi extension and skill package with native tools.
41
46
  - 🌐 **MCP Server**: Use with Cursor, Claude Code, Windsurf, or any MCP-compatible client — index once, search from anywhere.
42
47
 
43
48
  ## ⚡ Quick Start
@@ -62,6 +67,57 @@
62
67
  4. **Start Searching**
63
68
  Ask:
64
69
  > "Find the function that handles credit card validation errors"
70
+ ## 🥧 Pi Package
71
+
72
+ Install as a Pi package to get first-class `codebase_search`, `index_codebase`, call graph, PR impact, and knowledge-base tools plus the `codebase-search` skill.
73
+
74
+ ```bash
75
+ pi install npm:opencode-codebase-index
76
+ # or, for local development:
77
+ pi install ./path/to/opencode-codebase-index
78
+ ```
79
+
80
+ Pi uses the neutral `.codebase-index/` project storage and falls back to existing OpenCode state when present.
81
+
82
+ ## 🧩 Codex Plugin
83
+ Install once for Codex threads and get skill guidance plus MCP tools in one manifest.
84
+
85
+ 1. **Add this repo as a marketplace source**
86
+ ```bash
87
+ codex plugin marketplace add Helweg/opencode-codebase-index
88
+ ```
89
+ 2. **Install the plugin**
90
+ ```bash
91
+ codex plugin add codebase-index@helweg-plugins
92
+ ```
93
+ 3. **Restart or open a new thread** in the target workspace.
94
+ 4. Use MCP tools (`index_codebase`, `index_status`, `codebase_search`, etc.) and the `codebase-search` skill guidance.
95
+
96
+ The plugin includes:
97
+ - `skills/` guidance for local workflows
98
+ - `hooks/hooks.json` lightweight session-start guidance
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
+ - `.agents/plugins/marketplace.json` so this repo can act as a Codex marketplace source
101
+
102
+ ## 🧩 Claude Code Plugin
103
+ Install once for Claude Code sessions and get skill guidance plus MCP tools in one manifest.
104
+
105
+ 1. **Add this repo as a marketplace source**
106
+ ```bash
107
+ /plugin marketplace add Helweg/opencode-codebase-index
108
+ ```
109
+ 2. **Install the plugin**
110
+ ```bash
111
+ /plugin install codebase-index@helweg-plugins
112
+ ```
113
+ 3. **Restart or open a new session** in the target workspace.
114
+ 4. Use MCP tools (`index_codebase`, `index_status`, `codebase_search`, etc.) and the `codebase-search` skill guidance.
115
+
116
+ The plugin includes:
117
+ - `skills/` guidance for local workflows
118
+ - `hooks/hooks.json` lightweight session-start guidance
119
+ - inline `mcpServers` (in `.claude-plugin/plugin.json`) running the published `opencode-codebase-index` CLI via `npx … --host claude`, so a git marketplace install works without a local build
120
+ - `.claude-plugin/marketplace.json` so this repo can act as a Claude Code marketplace source
65
121
 
66
122
  ### Provider selection notes
67
123
 
@@ -402,6 +458,28 @@ Find the shortest known call-graph path between two symbols. Use it after `codeb
402
458
  Analyzes a PR's changed files to determine impact scope within the codebase.
403
459
  - **Use for**: Understanding which symbols are affected by a PR, their call-graph reach, risk level, and community/cluster detection.
404
460
  - **Parameters**: `checkConflicts` (optional, default `false`) — when `true`, detects overlapping concurrent PRs sharing affected symbols and returns `conflictingPRs`.
461
+
462
+ ### `index_visualize`
463
+ Generate a self-contained temporal call graph view for browser-based exploration.
464
+
465
+ - **Use for**: Onboarding, architecture walkthroughs, and understanding what moved recently before drilling into call relationships.
466
+ - **What it shows**: Recent change lenses, module overview, symbol exploration, hotspots, and cycles.
467
+ - **Concepts**: Modules are path-based code areas such as `src/tools` or `native`; symbols are indexed functions, classes, methods, or similar named code units; edges are caller/callee relationships.
468
+ - **Parameters**: `directory` (optional folder filter), `maxNodes` (default `5000`), `includeOrphans` (include disconnected symbols).
469
+ - **Output**: Writes a temporary HTML file you can open in any browser.
470
+ - **Example**: `index_visualize(directory="src/tools", maxNodes=1500)`
471
+
472
+ CLI shortcut after building locally:
473
+
474
+ ```bash
475
+ npm run build
476
+ npm run visualize
477
+ npm run visualize -- native
478
+ npm run visualize -- src/tools max=1000
479
+ npm run visualize -- src/indexer orphans
480
+ ```
481
+
482
+
405
483
  ### `add_knowledge_base`
406
484
  Add a folder as a knowledge base to be indexed alongside project code.
407
485
  - **Use for**: Indexing external documentation, API references, example programs.
@@ -430,6 +508,7 @@ The plugin automatically registers these slash commands:
430
508
  | `/find <query>` | **Hybrid Search**. Combines semantic search + grep. Best for "Find usage of X". |
431
509
  | `/call-graph <query>` | **Call Graph Trace**. Find callers/callees to understand execution flow. |
432
510
  | `/pr-impact <PR number or branch>` | **PR Impact Analysis**. Analyze changed files, affected symbols, communities, hub nodes, and risk. |
511
+ | `/visualize [directory|max=N|orphans]` | **Temporal Call Graph Visualization**. Open recent changes, module overview, symbol exploration, hotspots, and cycles in a browser-ready HTML file. |
433
512
  | `/index` | **Update Index**. Runs incremental indexing by default; use `/index force` for a full rebuild. |
434
513
  | `/status` | **Check Status**. Shows if indexed, chunk count, and provider info. |
435
514
 
@@ -544,6 +623,27 @@ Any OpenAI-compatible reranking endpoint. Examples:
544
623
 
545
624
  ## ⚙️ Configuration
546
625
 
626
+ ### Storage Paths (OpenCode + Codex + Claude + Pi)
627
+ OpenCode default (existing behavior):
628
+ - project config: `.opencode/codebase-index.json`
629
+ - project index: `.opencode/index`
630
+ - global config: `~/.config/opencode/codebase-index.json`
631
+ - global index: `~/.opencode/global-index`
632
+
633
+ Codex/Pi host mode (neutral default):
634
+ - project config: `.codebase-index/config.json`
635
+ - project index: `.codebase-index/index`
636
+ - global config: `~/.config/codebase-index/config.json`
637
+ - global index: `~/.codebase-index/global-index`
638
+
639
+ Claude Code host mode (`--host claude`):
640
+ - project config: `.claude/codebase-index.json`
641
+ - project index: `.claude/index`
642
+ - global config: `~/.claude/codebase-index.json`
643
+ - global index: `~/.claude/global-index`
644
+
645
+ Codex, Claude Code, and Pi read legacy OpenCode paths when host-native paths are absent, so existing state continues to work.
646
+
547
647
  Zero-config by default (uses `auto` mode). Customize in `.opencode/codebase-index.json`:
548
648
 
549
649
  ### Full Configuration Example
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Generate temporal HTML call graph visualization
3
+ ---
4
+
5
+ Generate an interactive temporal call graph visualization that starts with recent movement/onboarding context, then supports module overview, symbol exploration, hotspots, and cycles.
6
+
7
+ User input: $ARGUMENTS
8
+
9
+ Parse input for optional parameters:
10
+ - Plain text → directory filter (e.g., `/visualize src/services`)
11
+ - `max=N` or "limit N" → sets maxNodes
12
+ - `orphans` or `include-orphans` → sets includeOrphans=true
13
+ - No input → visualize recent code movement plus entire call graph
14
+
15
+ Call `index_visualize` with parsed parameters.
16
+
17
+ Examples:
18
+ - `/visualize` → temporal onboarding view with changes, modules, symbols, hotspots, and cycles
19
+ - `/visualize src/tools` → only symbols in src/tools/
20
+ - `/visualize max=1000` → limit to 1000 nodes
21
+ - `/visualize src/indexer orphans` → include disconnected nodes
22
+
23
+ If the index doesn't exist, run `index_codebase` first.
24
+
25
+ Return the generated file path and open instructions.
26
+
27
+ Terminology:
28
+ - Modules are path-based code areas, such as `src/tools` or `native`.
29
+ - Symbols are indexed named code units, such as functions, methods, classes, or Rust modules.
30
+ - Cycles are loops where code can eventually call or depend back on itself.