@muvon/octocode 0.22.0 → 0.23.1
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 +18 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
### **Structural Code Intelligence for AI Agents — MCP Server + Knowledge Graph + Semantic Search**
|
|
6
6
|
|
|
7
|
+
[](https://github.com/Muvon/octocode/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/Muvon/octocode/actions/workflows/ci.yml)
|
|
9
|
+
[](https://crates.io/crates/octocode)
|
|
7
10
|
[](https://github.com/Muvon/octocode/stargazers)
|
|
8
11
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
9
12
|
[](https://www.rust-lang.org)
|
|
@@ -33,17 +36,6 @@
|
|
|
33
36
|
|
|
34
37
|
**Works with:** Claude Desktop • Cursor • Windsurf • Any MCP-compatible AI
|
|
35
38
|
|
|
36
|
-
```json
|
|
37
|
-
// Add to your AI assistant config
|
|
38
|
-
{
|
|
39
|
-
"mcpServers": {
|
|
40
|
-
"octocode": {
|
|
41
|
-
"command": "octocode",
|
|
42
|
-
"args": ["mcp", "--path", "/your/project"]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
39
|
|
|
48
40
|
Now your AI assistant can:
|
|
49
41
|
```
|
|
@@ -67,7 +59,7 @@ AI: *uses LSP find-references* "process_payment() is called from 4 places:
|
|
|
67
59
|
```
|
|
68
60
|
# Semantic search finds the right code
|
|
69
61
|
octocode search "authentication middleware"
|
|
70
|
-
→ src/middleware/auth.rs
|
|
62
|
+
→ src/middleware/auth.rs — Similarity: 0.9234
|
|
71
63
|
|
|
72
64
|
# The GraphRAG CLI queries the optional persisted graph
|
|
73
65
|
octocode config --graphrag-enabled true
|
|
@@ -125,8 +117,9 @@ Tilting RRF fusion toward the BM25/keyword signal — which carries disproportio
|
|
|
125
117
|
The benchmark also flags what _doesn't_ help here (full 6-variant matrix in [`benchmark/RESULTS.md`](benchmark/RESULTS.md)): a **generic** local cross-encoder reranker (`bge-reranker-base`) actually **regressed** results (Hit@5 0.732 → 0.598) — code retrieval needs a _code-aware_ reranker (e.g. `voyage:rerank-2.5`), not an off-the-shelf one.
|
|
126
118
|
|
|
127
119
|
```bash
|
|
128
|
-
git
|
|
129
|
-
|
|
120
|
+
git clone https://github.com/Muvon/octocode && cd octocode
|
|
121
|
+
git worktree add /tmp/corpus b1771ba # pin the corpus to the ground-truth commit
|
|
122
|
+
CORPUS=/tmp/corpus python3 benchmark/run_matrix.py # set OCTO_BIN to use a custom binary
|
|
130
123
|
```
|
|
131
124
|
|
|
132
125
|
See [benchmark/README.md](benchmark/README.md) for methodology and metric definitions.
|
|
@@ -147,7 +140,10 @@ brew install muvon/tap/octocode
|
|
|
147
140
|
<summary><strong>Other installation methods</strong></summary>
|
|
148
141
|
|
|
149
142
|
```bash
|
|
150
|
-
#
|
|
143
|
+
# From crates.io
|
|
144
|
+
cargo install octocode
|
|
145
|
+
|
|
146
|
+
# Or from source (latest)
|
|
151
147
|
cargo install --git https://github.com/Muvon/octocode
|
|
152
148
|
|
|
153
149
|
# Download binary from releases
|
|
@@ -160,7 +156,7 @@ See [Installation Guide](INSTALL.md) for platform-specific instructions.
|
|
|
160
156
|
### 2. Set Up API Keys
|
|
161
157
|
|
|
162
158
|
```bash
|
|
163
|
-
# Required: Embedding provider (Voyage AI has
|
|
159
|
+
# Required: Embedding provider (Voyage AI has a free tier)
|
|
164
160
|
export VOYAGE_API_KEY="your-voyage-api-key"
|
|
165
161
|
|
|
166
162
|
# Optional: LLM for commit messages, code review
|
|
@@ -196,7 +192,7 @@ See [API Keys guide](doc/API_KEYS.md) for all supported providers.
|
|
|
196
192
|
```bash
|
|
197
193
|
cd /your/project
|
|
198
194
|
octocode index
|
|
199
|
-
# →
|
|
195
|
+
# → ✓ Indexing complete! 342 of 342 files processed (342 new, 0 unchanged)
|
|
200
196
|
```
|
|
201
197
|
|
|
202
198
|
### 4. Search Your Code
|
|
@@ -309,44 +305,6 @@ claude mcp add octocode -- octocode mcp --path /path/to/your/project
|
|
|
309
305
|
|
|
310
306
|
📖 **[Complete MCP Client Setup Guide](doc/MCP_CLIENTS.md)** — Detailed instructions for 15+ clients including VS Code (Cline/Continue), Zed, Replit, and more.
|
|
311
307
|
|
|
312
|
-
## 🎯 What Can You Do With It?
|
|
313
|
-
|
|
314
|
-
**New developer onboarding:**
|
|
315
|
-
```
|
|
316
|
-
You: "How does the authentication system work?"
|
|
317
|
-
AI: *searches and navigates* "Authentication starts in src/middleware/auth.rs which
|
|
318
|
-
validates JWT tokens. It calls src/auth/jwt.rs for token verification, which uses
|
|
319
|
-
the public key from config. Failed auth returns 401 via src/errors/auth_error.rs.
|
|
320
|
-
Sessions are stored in Redis via src/cache/session.rs."
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
**Code archaeology:**
|
|
324
|
-
```
|
|
325
|
-
You: "Find all places we handle database errors"
|
|
326
|
-
AI: *structural search* "Found 47 error handling patterns:
|
|
327
|
-
- 32 use Result<T, DbError> with proper error types
|
|
328
|
-
- 15 use .unwrap() (potential issues in src/db/user.rs:23, src/db/order.rs:156)
|
|
329
|
-
- Recommend adding proper error handling to those locations"
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
**Refactoring with confidence:**
|
|
333
|
-
```
|
|
334
|
-
You: "What depends on the PaymentProcessor trait?"
|
|
335
|
-
AI: *queries graph* "src/api/handlers/checkout.rs, src/workers/refund_worker.rs,
|
|
336
|
-
and src/cron/billing.rs all depend on PaymentProcessor. The trait is defined
|
|
337
|
-
in src/domain/payment.rs and implemented by src/infrastructure/stripe.rs
|
|
338
|
-
and src/infrastructure/paypal.rs."
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
**Code review assistance:**
|
|
342
|
-
```
|
|
343
|
-
You: "Review this PR for security issues"
|
|
344
|
-
AI: *analyzes changes* "The PR adds password hashing in src/auth/hash.rs. However,
|
|
345
|
-
it uses SHA256 which is fast and vulnerable to brute force. Recommend using
|
|
346
|
-
bcrypt or argon2 instead. Also found 3 instances of .unwrap() that could panic
|
|
347
|
-
in production."
|
|
348
|
-
```
|
|
349
|
-
|
|
350
308
|
## 🌐 Supported Languages
|
|
351
309
|
|
|
352
310
|
16 languages with full tree-sitter AST parsing:
|
|
@@ -360,6 +318,7 @@ AI: *analyzes changes* "The PR adds password hashing in src/auth/hash.rs. Howeve
|
|
|
360
318
|
| **PHP** | `.php` | Class/function extraction, namespace support |
|
|
361
319
|
| **C++** | `.cpp`, `.cc`, `.cxx`, `.c++`, `.c`, `.h`, `.hpp`, `.hxx`, `.cppm`, `.ixx`, `.mxx`, `.ccm`, `.cxxm` | Include analysis, class/function extraction, C++20 module support |
|
|
362
320
|
| **Ruby** | `.rb` | Class/module extraction, method definitions |
|
|
321
|
+
| **Elixir** | `.ex`, `.exs` | Module/protocol extraction, function and macro definitions |
|
|
363
322
|
| **Java** | `.java` | Import analysis, class/method extraction |
|
|
364
323
|
| **Swift** | `.swift` | Class/struct/protocol extraction, import analysis |
|
|
365
324
|
| **Svelte** | `.svelte` | Component structure, script/style block extraction |
|
|
@@ -383,18 +342,18 @@ AI: *analyzes changes* "The PR adds password hashing in src/auth/hash.rs. Howeve
|
|
|
383
342
|
|
|
384
343
|
## 🔒 Privacy & Security
|
|
385
344
|
|
|
386
|
-
- **🏠 Local-first** — local embedding
|
|
345
|
+
- **🏠 Local-first** — fully local embedding via fastembed (no API key required); cloud providers optional
|
|
387
346
|
- **🔐 Secure** — API keys stored locally, env vars supported
|
|
388
347
|
- **🚫 Respects .gitignore** — Never indexes sensitive files
|
|
389
348
|
- **🛡️ MCP security** — Local-only server, no external network for search
|
|
390
|
-
- **📤 Cloud-safe** —
|
|
349
|
+
- **📤 Cloud-safe** — cloud providers receive only the code chunks being embedded; use local models for fully offline indexing
|
|
391
350
|
|
|
392
351
|
<details>
|
|
393
352
|
<summary><strong>📊 Retrieval Quality Benchmark</strong></summary>
|
|
394
353
|
|
|
395
354
|
We measure semantic search quality using a hand-annotated ground truth dataset of 254 queries (127 code + 127 docs) with precise line-range annotations. Each query has 1–3 expected results scored by relevance.
|
|
396
355
|
|
|
397
|
-
|
|
356
|
+
These numbers use the **full cloud stack** — contextual retrieval, Voyage reranker, RaBitQ quantization — on commit [`b1771ba`](https://github.com/Muvon/octocode/commit/b1771ba) with [benchmark config](benchmark/config.toml). For the fully local baseline and the complete variant matrix, see [Retrieval Quality](#-retrieval-quality) above and [`benchmark/RESULTS.md`](benchmark/RESULTS.md).
|
|
398
357
|
|
|
399
358
|
<details>
|
|
400
359
|
<summary><strong>Documentation search</strong> (<code>--mode docs</code>) — Hit@10: 0.953, MRR: 0.776</summary>
|
|
@@ -467,4 +426,4 @@ Apache License 2.0 — See [LICENSE](LICENSE) for details.
|
|
|
467
426
|
|
|
468
427
|
</div>
|
|
469
428
|
|
|
470
|
-
mcp-name: io.github.Muvon/octocode
|
|
429
|
+
<!-- mcp-name: io.github.Muvon/octocode -->
|