@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 CHANGED
@@ -1,13 +1,14 @@
1
1
  # @leanlabsinnov/codegraph
2
2
 
3
- Live, queryable knowledge graph for your codebase. Indexes JS/TS into an embedded graph
4
- DB with vector embeddings, then exposes a local MCP server that Claude Code, Cursor, and
5
- Windsurf can call to answer questions like "what calls `useAuth`?", "what's the blast
6
- radius of changing `formatPrice`?", or "find symbols semantically similar to a JWT auth
7
- helper".
3
+ [![npm version](https://img.shields.io/npm/v/@leanlabsinnov/codegraph)](https://www.npmjs.com/package/@leanlabsinnov/codegraph)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE)
5
+ [![Node.js >=20](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org)
8
6
 
9
- Zero infrastructure. The graph lives in a folder under `~/.codegraph/`. No Docker, no
10
- external services.
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
- codegraph config llm set byo-openai
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
- Then point Claude Code / Cursor / Windsurf at `http://127.0.0.1:3748/mcp` with the bearer
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 the full [README on GitHub](https://github.com/leanlabsinnov/codegraph) for client setup, all
33
- 10 MCP tools, and troubleshooting.
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 | What it does |
49
+ | Command | Description |
38
50
  |---|---|
39
- | `codegraph index <path>` | Walk the repo, parse JS/TS, embed every symbol, write to the graph |
40
- | `codegraph index <path> --no-embed` | Skip embeddings (faster, semantic search disabled) |
41
- | `codegraph status <path>` | Node + edge counts and embedding coverage |
42
- | `codegraph serve` | Boot the MCP server on `:3748` |
43
- | `codegraph doctor` | Verify Node version, config, LLM credentials, Kuzu writeable |
44
- | `codegraph config show` | Print the resolved config |
45
- | `codegraph config llm set [preset]` | Switch LLM preset (interactive when omitted) |
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-36AWRLQ6.js";
6
- import "./chunk-B2TIVKUB.js";
7
- import "./chunk-2TORJYBO.js";
8
- import "./chunk-XGPZDCQ4.js";
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";