@leanlabsinnov/codegraph 0.1.2 → 0.1.4
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 +87 -21
- package/dist/bin.js +4 -4
- package/dist/{chunk-36AWRLQ6.js → chunk-64OLVRK3.js} +1682 -211
- package/dist/chunk-64OLVRK3.js.map +1 -0
- package/dist/{chunk-2TORJYBO.js → chunk-AVQNLB4I.js} +22 -4
- package/dist/chunk-AVQNLB4I.js.map +1 -0
- package/dist/{chunk-XGPZDCQ4.js → chunk-POGEFB23.js} +17 -2
- package/dist/chunk-POGEFB23.js.map +1 -0
- package/dist/{chunk-B2TIVKUB.js → chunk-WXBYICTK.js} +10 -7
- package/dist/chunk-WXBYICTK.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/{src-PDNTANJD.js → src-BTVJBGZ5.js} +3 -3
- package/dist/src-DBJQ22XR.js +10 -0
- package/package.json +2 -1
- package/viewer/index.html +1466 -0
- package/dist/chunk-2TORJYBO.js.map +0 -1
- package/dist/chunk-36AWRLQ6.js.map +0 -1
- package/dist/chunk-B2TIVKUB.js.map +0 -1
- package/dist/chunk-XGPZDCQ4.js.map +0 -1
- package/dist/src-UVET6JHH.js +0 -10
- /package/dist/{src-PDNTANJD.js.map → src-BTVJBGZ5.js.map} +0 -0
- /package/dist/{src-UVET6JHH.js.map → src-DBJQ22XR.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# @leanlabsinnov/codegraph
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
radius of changing `formatPrice`?", or "find symbols semantically similar to a JWT auth
|
|
7
|
-
helper".
|
|
3
|
+
[](https://www.npmjs.com/package/@leanlabsinnov/codegraph)
|
|
4
|
+
[](../../LICENSE)
|
|
5
|
+
[](https://nodejs.org)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
**Live, queryable knowledge graph for your codebase.** Indexes JS/TS/Python into an embedded graph database with vector embeddings, then exposes a local MCP server that Claude Code, Cursor, and Windsurf can call to answer structural questions about your code.
|
|
8
|
+
|
|
9
|
+
Zero infrastructure. The graph lives at `~/.codegraph/`. No Docker, no external services.
|
|
10
|
+
|
|
11
|
+
---
|
|
11
12
|
|
|
12
13
|
## Install
|
|
13
14
|
|
|
@@ -15,36 +16,101 @@ external services.
|
|
|
15
16
|
npm i -g @leanlabsinnov/codegraph
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
Requires Node 20
|
|
19
|
+
Requires **Node.js 20+**.
|
|
20
|
+
|
|
21
|
+
---
|
|
19
22
|
|
|
20
23
|
## Quickstart
|
|
21
24
|
|
|
22
25
|
```bash
|
|
23
|
-
|
|
26
|
+
# 1. Pick an LLM provider
|
|
27
|
+
codegraph config llm set byo-openai # also: byo-anthropic, byo-google, local-ollama
|
|
24
28
|
export OPENAI_API_KEY=sk-...
|
|
29
|
+
|
|
30
|
+
# 2. Verify the wire-up (5-token gen + 1 embedding round-trip)
|
|
31
|
+
codegraph config llm test
|
|
32
|
+
|
|
33
|
+
# 3. Index a repo
|
|
25
34
|
codegraph index ~/my-project
|
|
35
|
+
|
|
36
|
+
# 4. Boot the MCP server
|
|
26
37
|
codegraph serve
|
|
38
|
+
# → http://127.0.0.1:3748/mcp
|
|
27
39
|
```
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
token from `~/.codegraph/config.json`.
|
|
41
|
+
Point Claude Code / Cursor / Windsurf at `http://127.0.0.1:3748/mcp` with the bearer token from `~/.codegraph/config.json`.
|
|
31
42
|
|
|
32
|
-
See
|
|
33
|
-
|
|
43
|
+
See [client setup docs](https://github.com/Cirilcetra/codegraph/blob/main/docs/clients.md) for copy-paste config snippets.
|
|
44
|
+
|
|
45
|
+
---
|
|
34
46
|
|
|
35
47
|
## Commands
|
|
36
48
|
|
|
37
|
-
| Command |
|
|
49
|
+
| Command | Description |
|
|
38
50
|
|---|---|
|
|
39
|
-
| `codegraph index <path>` | Walk
|
|
40
|
-
| `codegraph index <path> --no-embed` |
|
|
41
|
-
| `codegraph status <path>` | Node
|
|
42
|
-
| `codegraph
|
|
43
|
-
| `codegraph
|
|
44
|
-
| `codegraph
|
|
45
|
-
| `codegraph config
|
|
51
|
+
| `codegraph index <path>` | Walk, parse, embed every symbol, write to graph |
|
|
52
|
+
| `codegraph index <path> --no-embed` | Parse only — faster, semantic search disabled |
|
|
53
|
+
| `codegraph status <path>` | Node/edge counts and embedding coverage |
|
|
54
|
+
| `codegraph wipe [path]` | Delete a repo's graph rows (`--yes` skips prompt) |
|
|
55
|
+
| `codegraph serve [--port N] [--host H]` | Boot the MCP server (default `:3748`) |
|
|
56
|
+
| `codegraph doctor` | Health check: Node, config, API keys, Kuzu, LLM |
|
|
57
|
+
| `codegraph config show` | Print resolved `~/.codegraph/config.json` |
|
|
58
|
+
| `codegraph config llm set [preset]` | Switch LLM preset (interactive picker if no arg) |
|
|
46
59
|
| `codegraph config llm test` | Round-trip the configured provider |
|
|
47
60
|
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## LLM Providers
|
|
64
|
+
|
|
65
|
+
| Preset | Generation | Embeddings | Required env var |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| `byo-openai` | gpt-4o-mini | text-embedding-3-small | `OPENAI_API_KEY` |
|
|
68
|
+
| `byo-anthropic` | claude-3-5-haiku-latest | text-embedding-3-small | `ANTHROPIC_API_KEY` + `OPENAI_API_KEY` |
|
|
69
|
+
| `byo-google` | gemini-1.5-flash-latest | text-embedding-004 | `GOOGLE_GENERATIVE_AI_API_KEY` |
|
|
70
|
+
| `local-ollama` | qwen2.5-coder:14b | nomic-embed-text | Ollama running locally |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## What you can ask
|
|
75
|
+
|
|
76
|
+
Once connected, ask your AI assistant:
|
|
77
|
+
|
|
78
|
+
- *"What calls `useAuth`?"*
|
|
79
|
+
- *"Show the component tree rooted at `App`."*
|
|
80
|
+
- *"What's the blast radius of renaming `formatPrice`?"*
|
|
81
|
+
- *"Find symbols semantically similar to 'JWT auth helper'."*
|
|
82
|
+
- *"What are the transitive imports of `src/lib/db.ts`?"*
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Configuration
|
|
87
|
+
|
|
88
|
+
Config is stored at `~/.codegraph/config.json` (auto-generated on first `serve`):
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"llm": {
|
|
93
|
+
"mode": "byo",
|
|
94
|
+
"generation": { "provider": "openai", "model": "gpt-4o-mini" },
|
|
95
|
+
"embeddings": { "provider": "openai", "model": "text-embedding-3-small", "dimension": 1536 }
|
|
96
|
+
},
|
|
97
|
+
"server": {
|
|
98
|
+
"port": 3748,
|
|
99
|
+
"bearerToken": "<32-hex-chars>"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
You can also override via environment variables — see `.env.example` in the repo root.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Troubleshooting
|
|
109
|
+
|
|
110
|
+
Run `codegraph doctor` first. For client-specific config issues, see the [full docs](https://github.com/Cirilcetra/codegraph/blob/main/docs/clients.md#troubleshooting).
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
48
114
|
## License
|
|
49
115
|
|
|
50
116
|
MIT
|
package/dist/bin.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
buildProgram,
|
|
4
4
|
renderError
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-64OLVRK3.js";
|
|
6
|
+
import "./chunk-WXBYICTK.js";
|
|
7
|
+
import "./chunk-AVQNLB4I.js";
|
|
8
|
+
import "./chunk-POGEFB23.js";
|
|
9
9
|
|
|
10
10
|
// src/bin.ts
|
|
11
11
|
import { CommanderError } from "commander";
|