@openez-graph/cli 1.0.3 → 1.3.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.
- package/README.md +46 -37
- package/dist/CHANGELOG.md +68 -0
- package/dist/cli.cjs +6094 -2467
- package/dist/registry-template.sqlite +0 -0
- package/dist/web/assets/{WorkspaceGraph-C7MlKPGF.js → WorkspaceGraph-BKsjhxlB.js} +1 -1
- package/dist/web/assets/index-BFGg8xfE.js +372 -0
- package/dist/web/index.html +1 -1
- package/package.json +2 -1
- package/dist/web/assets/index-BMNDu0y4.js +0 -367
package/README.md
CHANGED
|
@@ -9,21 +9,21 @@ OpenEZ Graph indexes your codebase into a local SQLite database, builds a code g
|
|
|
9
9
|
|
|
10
10
|
**Zero config. No Docker. No Postgres. No Redis. Just install and go.**
|
|
11
11
|
|
|
12
|
-
> **v1.0: Bun-powered, Rust-native parsing.** The CLI now runs exclusively on [Bun](https://bun.sh) 1.1+ with native `bun:sqlite` (no `better-sqlite3` compilation step). TS/JS parsing uses [oxc-parser](https://oxc.rs) (Rust-based, ~13x faster than Babel) instead of `ts-morph`. Python/Go/Rust use tree-sitter
|
|
12
|
+
> **v1.0: Bun-powered, Rust-native parsing.** The CLI now runs exclusively on [Bun](https://bun.sh) 1.1+ with native `bun:sqlite` (no `better-sqlite3` compilation step). TS/JS parsing uses [oxc-parser](https://oxc.rs) (Rust-based, ~13x faster than Babel) instead of `ts-morph`. Python/Go/Rust/Ruby use tree-sitter (WASM) with regex fallback. Requires Bun 1.1+.
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
15
|
|
|
16
16
|
- **Bun-powered** — native `bun:sqlite` driver, no native compilation, near-instant startup
|
|
17
|
-
- **Rust-native parsing** — [oxc-parser](https://oxc.rs) for TS/JS (~13x faster than Babel), tree-sitter for Python/Go/Rust
|
|
18
|
-
- **Zero-config** — auto-registers workspace, auto-indexes
|
|
17
|
+
- **Rust-native parsing** — [oxc-parser](https://oxc.rs) for TS/JS (~13x faster than Babel), tree-sitter (WASM) for Python/Go/Rust/Ruby with regex fallback
|
|
18
|
+
- **Zero-config** — auto-registers workspace, auto-indexes; opt-in auto-sync via `OPENEZ_MCP_WATCH=1`
|
|
19
19
|
- **SQLite-first** — all data stored locally in `.openez/` per workspace, no Postgres/Redis
|
|
20
20
|
- **FTS5 full-text search** — SQLite FTS5 with BM25 ranking and porter tokenizer
|
|
21
|
-
- **Vector search** — optional OpenAI/Ollama embeddings with cosine similarity
|
|
21
|
+
- **Vector search** — optional OpenAI/Ollama/local embeddings with cosine similarity
|
|
22
22
|
- **MCP-first** — exposes `code_query`, `code_context`, `graph_neighbors`, `memory_recall`, `memory_write`, `index_workspace`, `list_workspaces` tools
|
|
23
23
|
- **Multi-workspace** — register and query across multiple codebases
|
|
24
24
|
- **Code graph** — symbols, files, chunks, and edges (calls, imports, contains)
|
|
25
25
|
- **Web dashboard** — built-in graph explorer and workspace management UI
|
|
26
|
-
- **Auto-sync** — file watcher re-indexes on changes (
|
|
26
|
+
- **Auto-sync** — file watcher re-indexes on changes (2s debounce)
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
@@ -53,7 +53,7 @@ openez setup opencode # OpenCode
|
|
|
53
53
|
openez setup windsurf # Windsurf / Devin Desktop
|
|
54
54
|
openez setup devin # Devin CLI
|
|
55
55
|
|
|
56
|
-
# 3. Restart your agent — it will auto-index
|
|
56
|
+
# 3. Restart your agent — it will auto-index (auto-sync opt-in via OPENEZ_MCP_WATCH=1)
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## Commands
|
|
@@ -61,9 +61,10 @@ openez setup devin # Devin CLI
|
|
|
61
61
|
```bash
|
|
62
62
|
openez init [path] # register + index a workspace
|
|
63
63
|
openez index [path] # incremental index
|
|
64
|
-
openez
|
|
64
|
+
openez embed [path] # create configured provider vectors
|
|
65
|
+
openez reindex [path] # full rebuild (removes vectors; run embed after)
|
|
65
66
|
openez watch [path] # watch + auto-reindex on changes
|
|
66
|
-
openez serve --mcp # start MCP server (auto-index
|
|
67
|
+
openez serve --mcp # start MCP server (auto-index; auto-sync opt-in via OPENEZ_MCP_WATCH=1)
|
|
67
68
|
openez serve --web # start web dashboard (default port 17881)
|
|
68
69
|
openez serve --web --port 8080 # start web dashboard on custom port
|
|
69
70
|
openez status [path] # show workspace status
|
|
@@ -78,60 +79,68 @@ openez config set <key> <value> # set embedding config value
|
|
|
78
79
|
openez config list # list all DB-stored config overrides
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
Valid config keys: `embedding.provider`, `embedding.openai_api_key`, `embedding.openai_base_url`, `embedding.openai_model`, `embedding.ollama_base_url`, `embedding.ollama_model`. API keys are encrypted at rest with AES-256-GCM.
|
|
82
|
+
Valid config keys: `embedding.provider`, `embedding.openai_api_key`, `embedding.openai_base_url`, `embedding.openai_model`, `embedding.ollama_base_url`, `embedding.ollama_model`, `embedding.local_model`. API keys are encrypted at rest with AES-256-GCM.
|
|
82
83
|
|
|
83
84
|
## MCP Tools
|
|
84
85
|
|
|
85
|
-
| Tool | Description
|
|
86
|
-
| ----------------- |
|
|
87
|
-
| `list_workspaces` | List all registered workspaces
|
|
88
|
-
| `code_query` | Hybrid FTS/vector search + graph expansion over indexed code and docs
|
|
89
|
-
| `code_context` | Get budgeted symbol context with callers, callees, and related files
|
|
90
|
-
| `graph_neighbors` | Traverse graph edges from a node or label
|
|
91
|
-
| `memory_recall` | Recall active memory entries and technical decisions
|
|
92
|
-
| `memory_write` | Write a memory entry (notes, decisions, patterns)
|
|
93
|
-
| `index_workspace` | Trigger indexing for a workspace
|
|
86
|
+
| Tool | Description |
|
|
87
|
+
| ----------------- | --------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| `list_workspaces` | List all registered workspaces |
|
|
89
|
+
| `code_query` | Hybrid FTS/vector search + graph expansion over indexed code and docs |
|
|
90
|
+
| `code_context` | Get budgeted symbol context with callers, callees, and related files (limit: 50/workspace, max 200) |
|
|
91
|
+
| `graph_neighbors` | Traverse graph edges from a node or label |
|
|
92
|
+
| `memory_recall` | Recall active memory entries and technical decisions |
|
|
93
|
+
| `memory_write` | Write a memory entry (notes, decisions, patterns) |
|
|
94
|
+
| `index_workspace` | Trigger indexing for a workspace |
|
|
94
95
|
|
|
95
96
|
`memory_query` is accepted as a deprecated compatibility alias for `code_query`, but is not advertised to new clients.
|
|
96
97
|
|
|
97
98
|
## How it works
|
|
98
99
|
|
|
99
|
-
1. **`openez setup <agent>`** writes MCP server config to the agent's config file (e.g. `~/.claude/settings.json`, `~/.codeium/windsurf/mcp_config.json`, `~/.config/devin/config.json`)
|
|
100
|
+
1. **`openez setup <agent>`** writes MCP server config to the agent's config file (e.g. `~/.claude/settings.json`, `~/.codeium/windsurf/mcp_config.json`, `~/.config/devin/config.json`) and installs agent instructions (`AGENTS.md` or `CLAUDE.md`) in the project root. These instruction files tell the agent to prefer OpenEZ MCP tools over grep/ripgrep. They are safe to commit or gitignore — `openez setup` will update them idempotently if already present.
|
|
100
101
|
2. When Claude Code starts, it launches the MCP server via `openez serve --mcp`
|
|
101
102
|
3. The MCP server auto-registers the current project as a workspace
|
|
102
103
|
4. It auto-indexes if the workspace has no documents yet
|
|
103
|
-
5.
|
|
104
|
+
5. Live file watching is opt-in via `OPENEZ_MCP_WATCH=1` (2s debounce); without it, read tools run throttled incremental catch-up before querying
|
|
104
105
|
6. All data is stored in `<project>/.openez/index.sqlite` — local, portable, gitignored
|
|
105
106
|
|
|
106
107
|
## Supported languages
|
|
107
108
|
|
|
108
|
-
| Language
|
|
109
|
-
|
|
|
110
|
-
| TypeScript / JavaScript
|
|
111
|
-
| Python
|
|
112
|
-
| Go
|
|
113
|
-
| Rust
|
|
114
|
-
|
|
|
115
|
-
|
|
|
109
|
+
| Language | Parser | Indexing depth |
|
|
110
|
+
| ----------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------- |
|
|
111
|
+
| TypeScript / JavaScript | [oxc-parser](https://oxc.rs) | Richest — symbol extraction, imports, calls (~13x faster than Babel) |
|
|
112
|
+
| Python | tree-sitter (WASM) | Symbol extraction, decorators, imports, calls |
|
|
113
|
+
| Go | tree-sitter (WASM) | Symbol extraction, receiver-qualified methods, calls |
|
|
114
|
+
| Rust | tree-sitter (WASM) | Symbol extraction, impl blocks, calls |
|
|
115
|
+
| Ruby | tree-sitter (WASM) | Symbol extraction, `class << self` context, `self.foo` calls, `require_relative` imports |
|
|
116
|
+
| CoffeeScript / Slim / CSS / SCSS / SASS / LESS / Haml | Fallback parser | Scanned and chunked (no symbol extraction) |
|
|
117
|
+
| YAML / JSON / TOML | Structure-aware | Structure-aware chunking |
|
|
118
|
+
| Markdown | Section-oriented | Section-oriented chunking |
|
|
116
119
|
|
|
117
120
|
## Retrieval quality
|
|
118
121
|
|
|
119
|
-
|
|
122
|
+
Measured on 2026-08-10 against the openez codebase (180 files, 979 chunks, 17 fixture-backed
|
|
123
|
+
queries):
|
|
120
124
|
|
|
121
|
-
| Metric
|
|
122
|
-
|
|
|
123
|
-
| Recall@5
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
| Avg latency | 5 ms | 249 ms |
|
|
125
|
+
| Metric | FTS only |
|
|
126
|
+
| ----------- | -------: |
|
|
127
|
+
| Recall@5 | 76.47% |
|
|
128
|
+
| MRR | 0.6564 |
|
|
129
|
+
| Avg latency | 12.1 ms |
|
|
127
130
|
|
|
128
|
-
|
|
131
|
+
FTS-only remains the default. Embedding comparison is opt-in and is not claimed by this baseline.
|
|
129
132
|
|
|
130
133
|
```bash
|
|
131
134
|
# Enable Ollama embeddings (bge-m3 recommended for code search)
|
|
132
135
|
openez config set embedding.provider ollama
|
|
133
136
|
openez config set embedding.ollama_model bge-m3
|
|
134
|
-
openez
|
|
137
|
+
openez embed .
|
|
138
|
+
pnpm benchmark:retrieval:embeddings
|
|
139
|
+
|
|
140
|
+
# Or use the public pinned local code model
|
|
141
|
+
openez config set embedding.provider local
|
|
142
|
+
openez config set embedding.local_model jina-code-static-256
|
|
143
|
+
openez embed .
|
|
135
144
|
```
|
|
136
145
|
|
|
137
146
|
See [BENCHMARK.md](https://github.com/asta-nguyen/openez-graph/blob/main/BENCHMARK.md) for full analysis.
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,71 @@ All notable changes to OpenEZ Graph are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.0] - 2026-08-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Ruby indexing** — tree-sitter WASM symbol extraction for classes, modules, methods, singleton methods, named lambdas, `class << self` nesting, and `require_relative` import edges.
|
|
13
|
+
- **Ruby and frontend language scanning** — `.rb`, `.rake`, `.gemspec`, CoffeeScript, Slim, CSS, SCSS, Sass, Less, and Haml files are now indexed; unsupported languages use fallback chunking.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Ruby graph extraction** — preserves calls inside ordinary assignments, qualifies `self` calls in class bodies, keeps regex fallback nesting correct, and aligns method export metadata with the AST parser.
|
|
18
|
+
|
|
19
|
+
## [1.2.0] - 2026-08-11
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Lease-based indexing ownership** — indexing claims a 60-second lease with 15-second heartbeat. If the lease expires (e.g. process crash), another process can take over. Completion and failure writes are fenced by owner token — a stale owner cannot overwrite the status set by a newer owner.
|
|
24
|
+
- **Graph build warnings in MCP** — `code_query` response includes a `warnings` array when graph expansion fails, so callers see FTS-only results instead of silently missing graph expansion.
|
|
25
|
+
- **Web UI: Reindex button** — workspace detail page now has a "Reindex workspace" button with loading state and error display, triggering a full rebuild via `startIndexRun(workspaceId, "full")`.
|
|
26
|
+
- **Web UI: Build & Open Graph** — workspace detail page shows "Build & Open Graph" button when graph data is empty, or "Open Graph" when graph exists. Graph is built lazily on first access via `ensureGraphReady`.
|
|
27
|
+
- **Web UI: Local embedding model picker** — settings page now supports selecting local embedding model preset (`jina-code-static-256`) with server-side validation against `LOCAL_EMBEDDING_MODELS` catalog. Provider dropdown includes "OpenEZ local" option alongside OpenAI and Ollama.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **MCP `code_context` validation** — removed misplaced `nodeId`/`label` guard that threw on every `code_context` call (schema requires `symbolOrPath`).
|
|
32
|
+
- **MCP truncation pairing** — `fitToTokenBudget` now drops whole result entries instead of emptying inner source arrays (`callers`, `callees`, `relatedChunks`, `sources`, `files`), keeping context and structured sources paired under token truncation.
|
|
33
|
+
- **Retrieval preflight** — `vectorSearch` checks `hasLegacyEmbeddings()` and active-model vector existence before calling `provider.embed`, avoiding wasted API calls for workspaces with legacy TEXT or no embeddings.
|
|
34
|
+
- **Optional tokenizer dependency** — `@huggingface/tokenizers` is now a dynamic import in `local-embedding.ts`, making embeddings truly optional. The static import forced the dependency on all core package consumers.
|
|
35
|
+
- **Lease-fenced index completion/failure** — `completeIndexing` and `failIndexing` check `index_build_owner` in the WHERE clause, mirroring graph build fencing. A stale lease holder can no longer overwrite the status set by a newer owner.
|
|
36
|
+
- **Authoritative schema initialization** — web server delegates registry and workspace schema creation to `@openez-graph/db` (`getRegistryDdl`, `getFullWorkspaceDdl`, `migrateRegistrySchema`), eliminating duplicated DDL and missing migrations (registry_meta, graph invalidation backfill).
|
|
37
|
+
- **Browser tokenizer boundary** — local embedding model catalog exposed via settings API (`localModels: string[]`) instead of direct `@openez-graph/core` import, preventing `@huggingface/tokenizers` from entering the Vite client bundle.
|
|
38
|
+
- **Strict TypeScript gates** — explicit type parameters on all `queryOptions` calls; test fetch mocks use `as unknown as typeof fetch` double cast.
|
|
39
|
+
- **Docs reconciliation** — corrected stale reindex docs (full reindex replaces chunks and removes vectors), documented `code_context` limit contract (50/workspace, max 200, token-budgeted), corrected watcher debounce from 250ms to 2s, documented MCP auto-sync as opt-in via `OPENEZ_MCP_WATCH=1`, documented `openez setup` AGENTS.md/CLAUDE.md instruction file mutation.
|
|
40
|
+
|
|
41
|
+
## [1.1.0] - 2026-08-10
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- **`openez embed` command** — standalone embedding step separated from indexing. Run `openez embed [path]` after `openez index` to create vectors. Supports `--force` to rebuild vectors for the active provider/model.
|
|
46
|
+
- **Local embedding provider (`local`)** — zero-config in-process embedding using `jina-code-static-256` (256d static token embeddings). Downloads model files from HuggingFace on first use with SHA256 checksum verification and atomic writes. No Ollama or OpenAI required.
|
|
47
|
+
- **`embedding.local_model` config key** — configurable local model preset via `openez config set embedding.local_model jina-code-static-256`.
|
|
48
|
+
- **Lazy graph build lifecycle** — graph construction deferred to the first query or another approved CLI command, with invalidation tracking on reindex.
|
|
49
|
+
- **Nested TypeScript symbol discovery** — `oxc-parser` now registers named nested functions and arrow functions assigned to variables as first-class graph symbols.
|
|
50
|
+
- **Graph invalidation generations** — persisted invalidation markers ensure stale graph edges are rebuilt after incremental reindex.
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- **Indexing no longer creates embeddings** — `openez index` writes chunks, FTS, and graph only. Use `openez embed` for vectors. Retrieval falls back to FTS + graph when embeddings are absent.
|
|
55
|
+
- **BLOB cosine search is the supported vector path** — legacy TEXT embeddings detected and skipped; run `openez reindex` then `openez embed --force` to rebuild as BLOB vectors (reindex alone does not write vectors).
|
|
56
|
+
- **FTS metadata normalization** — Unicode-aware text composition for FTS indexing preserves complete chunk content.
|
|
57
|
+
- **Token strategy scoped** — `fastTokenCounter` (chars/4) for indexing, `exactTokenCounter` (GPT BPE) for retrieval budgeting, with concurrency-safe lazy loading.
|
|
58
|
+
- **Parser cache** — parsed document results cached per-file to avoid redundant AST walks during incremental reindex.
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- **FTS Unicode normalization** — chunk content with multi-byte characters no longer truncated in FTS index.
|
|
63
|
+
- **FTS metadata JSON parsing** — guarded against malformed metadata causing indexing failures.
|
|
64
|
+
- **Stale FTS version rebuild ordering** — FTS triggers correctly restored after bulk write phase.
|
|
65
|
+
- **Graph build produced 0 symbol nodes** — `oxc-parser` native binding resolution fixed in bundled CLI.
|
|
66
|
+
- **Registry `graph_status` not updated** — registry now reflects actual node/edge counts after graph build.
|
|
67
|
+
- **RAG flow correctness** — second-round review blockers resolved in retrieval pipeline.
|
|
68
|
+
|
|
69
|
+
### Contributors
|
|
70
|
+
|
|
71
|
+
- **Asta Nguyen** — [@asta-nguyen](https://github.com/asta-nguyen)
|
|
72
|
+
|
|
8
73
|
## [1.0.3] - 2026-08-08
|
|
9
74
|
|
|
10
75
|
### Fixed
|
|
@@ -234,6 +299,9 @@ Remediation release — index/graph correctness, data protection, and web flow f
|
|
|
234
299
|
- Error handling and validation for import path extraction
|
|
235
300
|
- CLI npm packaging
|
|
236
301
|
|
|
302
|
+
[1.2.0]: https://github.com/asta-nguyen/openez-graph/compare/v1.1.0...v1.2.0
|
|
303
|
+
[1.3.0]: https://github.com/asta-nguyen/openez-graph/compare/v1.2.0...v1.3.0
|
|
304
|
+
[1.1.0]: https://github.com/asta-nguyen/openez-graph/compare/v1.0.3...v1.1.0
|
|
237
305
|
[1.0.3]: https://github.com/asta-nguyen/openez-graph/compare/v1.0.2...v1.0.3
|
|
238
306
|
[1.0.2]: https://github.com/asta-nguyen/openez-graph/compare/v1.0.1...v1.0.2
|
|
239
307
|
[1.0.1]: https://github.com/asta-nguyen/openez-graph/compare/v1.0.0...v1.0.1
|