codegraph-cli 2.1.2__py3-none-any.whl → 2.1.3__py3-none-any.whl
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.
- codegraph_cli/__init__.py +1 -1
- codegraph_cli/crew_agents.py +4 -4
- codegraph_cli/crew_chat.py +14 -4
- codegraph_cli/crew_tools.py +10 -3
- codegraph_cli/security_scanner.py +39 -1
- codegraph_cli/vector_store.py +17 -15
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/METADATA +119 -63
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/RECORD +12 -12
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/WHEEL +0 -0
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/entry_points.txt +0 -0
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/licenses/LICENSE +0 -0
- {codegraph_cli-2.1.2.dist-info → codegraph_cli-2.1.3.dist-info}/top_level.txt +0 -0
codegraph_cli/__init__.py
CHANGED
codegraph_cli/crew_agents.py
CHANGED
|
@@ -36,7 +36,7 @@ def create_file_ops_agent(tools: list, llm, project_context: str = "") -> Agent:
|
|
|
36
36
|
llm=llm,
|
|
37
37
|
verbose=False,
|
|
38
38
|
allow_delegation=False,
|
|
39
|
-
max_iter=
|
|
39
|
+
max_iter=10,
|
|
40
40
|
max_tokens=4096,
|
|
41
41
|
)
|
|
42
42
|
|
|
@@ -69,7 +69,7 @@ def create_code_gen_agent(tools: list, llm, project_context: str = "") -> Agent:
|
|
|
69
69
|
llm=llm,
|
|
70
70
|
verbose=False,
|
|
71
71
|
allow_delegation=False,
|
|
72
|
-
max_iter=
|
|
72
|
+
max_iter=12,
|
|
73
73
|
max_tokens=4096,
|
|
74
74
|
)
|
|
75
75
|
|
|
@@ -98,7 +98,7 @@ def create_code_analysis_agent(tools: list, llm, project_context: str = "") -> A
|
|
|
98
98
|
llm=llm,
|
|
99
99
|
verbose=False,
|
|
100
100
|
allow_delegation=False,
|
|
101
|
-
max_iter=
|
|
101
|
+
max_iter=10,
|
|
102
102
|
max_tokens=4096,
|
|
103
103
|
)
|
|
104
104
|
|
|
@@ -142,6 +142,6 @@ def create_coordinator_agent(llm, project_context: str = "", tools: list = None)
|
|
|
142
142
|
llm=llm,
|
|
143
143
|
verbose=False,
|
|
144
144
|
allow_delegation=True,
|
|
145
|
-
max_iter=
|
|
145
|
+
max_iter=15,
|
|
146
146
|
max_tokens=4096,
|
|
147
147
|
)
|
codegraph_cli/crew_chat.py
CHANGED
|
@@ -45,10 +45,20 @@ class CrewChatAgent:
|
|
|
45
45
|
# ── Silence CrewAI / LiteLLM noise ────────────────
|
|
46
46
|
for logger_name in (
|
|
47
47
|
"crewai", "crewai.agents", "crewai.crews",
|
|
48
|
-
"crewai.tasks", "litellm", "
|
|
48
|
+
"crewai.tasks", "litellm", "litellm.proxy",
|
|
49
|
+
"litellm.litellm_core_utils", "litellm.utils",
|
|
50
|
+
"litellm.proxy.proxy_server", "httpx", "httpcore",
|
|
49
51
|
):
|
|
50
52
|
logging.getLogger(logger_name).setLevel(logging.CRITICAL)
|
|
51
53
|
os.environ.setdefault("CREWAI_TELEMETRY_OPT_OUT", "true")
|
|
54
|
+
# Suppress LiteLLM's fastapi proxy import spam
|
|
55
|
+
os.environ.setdefault("LITELLM_LOG", "ERROR")
|
|
56
|
+
try:
|
|
57
|
+
import litellm
|
|
58
|
+
litellm.suppress_debug_info = True
|
|
59
|
+
litellm.set_verbose = False
|
|
60
|
+
except ImportError:
|
|
61
|
+
pass
|
|
52
62
|
|
|
53
63
|
# ── Provider env vars for LiteLLM compatibility ───
|
|
54
64
|
if llm.api_key:
|
|
@@ -210,8 +220,8 @@ class CrewChatAgent:
|
|
|
210
220
|
"""Format conversation history for injection into task context.
|
|
211
221
|
|
|
212
222
|
Keeps the last 4 exchanges (8 messages). The most recent 2
|
|
213
|
-
exchanges are preserved in full; older ones are
|
|
214
|
-
~
|
|
223
|
+
exchanges are preserved in full (up to a cap); older ones are
|
|
224
|
+
compressed to ~400 chars each to stay within LLM context limits.
|
|
215
225
|
"""
|
|
216
226
|
if not self._history:
|
|
217
227
|
return ""
|
|
@@ -226,7 +236,7 @@ class CrewChatAgent:
|
|
|
226
236
|
content = msg["content"]
|
|
227
237
|
# Last 2 exchanges (4 msgs) get generous space; older ones compressed
|
|
228
238
|
is_recent = i >= total - 4
|
|
229
|
-
max_len =
|
|
239
|
+
max_len = 1500 if is_recent else 400
|
|
230
240
|
if len(content) > max_len:
|
|
231
241
|
content = content[:max_len] + "\n... (truncated)"
|
|
232
242
|
lines.append(f"[{role}]:\n{content}")
|
codegraph_cli/crew_tools.py
CHANGED
|
@@ -208,7 +208,12 @@ class ReadFileTool(ContextTool):
|
|
|
208
208
|
numbered = []
|
|
209
209
|
for i, line in enumerate(content.split("\n"), 1):
|
|
210
210
|
numbered.append(f"{i:4d} │ {line}")
|
|
211
|
-
|
|
211
|
+
result = f"── {path} ──\n" + "\n".join(numbered)
|
|
212
|
+
# Truncate to avoid blowing up LLM context window
|
|
213
|
+
max_chars = 12_000
|
|
214
|
+
if len(result) > max_chars:
|
|
215
|
+
result = result[:max_chars] + f"\n... (truncated — file has {len(content)} chars total, use grep_in_project to find specific sections)"
|
|
216
|
+
return result
|
|
212
217
|
except Exception as e:
|
|
213
218
|
return f"Error reading file: {e}"
|
|
214
219
|
|
|
@@ -354,16 +359,18 @@ class SearchCodeTool(BaseTool):
|
|
|
354
359
|
|
|
355
360
|
def _run(self, query: str) -> str:
|
|
356
361
|
try:
|
|
357
|
-
results = self._rag.search(query, top_k=
|
|
362
|
+
results = self._rag.search(query, top_k=5)
|
|
358
363
|
if not results:
|
|
359
364
|
return f"No results found for: {query}"
|
|
360
365
|
lines = [f"Found {len(results)} results for '{query}':\n"]
|
|
361
366
|
for i, r in enumerate(results, 1):
|
|
367
|
+
# Truncate preview to keep context compact
|
|
368
|
+
preview = r.snippet[:200].replace("\n", " ")
|
|
362
369
|
lines.append(
|
|
363
370
|
f"{i}. [{r.node_type}] {r.qualname}\n"
|
|
364
371
|
f" File: {r.file_path}:{r.start_line}-{r.end_line}\n"
|
|
365
372
|
f" Score: {r.score:.2f}\n"
|
|
366
|
-
f" Preview: {
|
|
373
|
+
f" Preview: {preview}…\n"
|
|
367
374
|
)
|
|
368
375
|
return "\n".join(lines)
|
|
369
376
|
except Exception as e:
|
|
@@ -152,9 +152,34 @@ data = json.loads(file_content) # Safer alternative"""
|
|
|
152
152
|
return issue
|
|
153
153
|
|
|
154
154
|
def _detect_sql_injection(self, tree: ast.AST, node: Dict) -> List[Dict]:
|
|
155
|
-
"""Detect SQL injection vulnerabilities.
|
|
155
|
+
"""Detect SQL injection vulnerabilities.
|
|
156
|
+
|
|
157
|
+
Catches both direct concatenation in execute() args **and** indirect
|
|
158
|
+
patterns where a variable is assigned a concatenated/formatted string
|
|
159
|
+
and then passed to execute().
|
|
160
|
+
"""
|
|
156
161
|
issues = []
|
|
157
162
|
|
|
163
|
+
# ── Phase 1: collect tainted variable names ───────────────────
|
|
164
|
+
# A variable is "tainted" when its value comes from string
|
|
165
|
+
# concatenation, f-string interpolation, or .format().
|
|
166
|
+
tainted_vars: set[str] = set()
|
|
167
|
+
for ast_node in ast.walk(tree):
|
|
168
|
+
if isinstance(ast_node, ast.Assign):
|
|
169
|
+
val = ast_node.value
|
|
170
|
+
is_tainted = (
|
|
171
|
+
(isinstance(val, ast.BinOp) and isinstance(val.op, ast.Add))
|
|
172
|
+
or isinstance(val, ast.JoinedStr)
|
|
173
|
+
or (isinstance(val, ast.Call)
|
|
174
|
+
and isinstance(val.func, ast.Attribute)
|
|
175
|
+
and val.func.attr == "format")
|
|
176
|
+
)
|
|
177
|
+
if is_tainted:
|
|
178
|
+
for target in ast_node.targets:
|
|
179
|
+
if isinstance(target, ast.Name):
|
|
180
|
+
tainted_vars.add(target.id)
|
|
181
|
+
|
|
182
|
+
# ── Phase 2: inspect .execute() / .executemany() / .raw() ────
|
|
158
183
|
for ast_node in ast.walk(tree):
|
|
159
184
|
# Look for string formatting in SQL-like strings
|
|
160
185
|
if isinstance(ast_node, ast.Call):
|
|
@@ -198,6 +223,19 @@ data = json.loads(file_content) # Safer alternative"""
|
|
|
198
223
|
"code_snippet": ast.unparse(ast_node)[:100]
|
|
199
224
|
})
|
|
200
225
|
|
|
226
|
+
# Check for indirect: variable previously assigned
|
|
227
|
+
# from concatenation / f-string / .format()
|
|
228
|
+
elif (isinstance(arg, ast.Name)
|
|
229
|
+
and arg.id in tainted_vars):
|
|
230
|
+
issues.append({
|
|
231
|
+
"type": "sql_injection",
|
|
232
|
+
"severity": "critical",
|
|
233
|
+
"line": node["start_line"] + ast_node.lineno - 1,
|
|
234
|
+
"message": "Potential SQL injection via tainted variable",
|
|
235
|
+
"suggestion": "Use parameterized queries with placeholders (?)",
|
|
236
|
+
"code_snippet": ast.unparse(ast_node)[:100]
|
|
237
|
+
})
|
|
238
|
+
|
|
201
239
|
return issues
|
|
202
240
|
|
|
203
241
|
def _detect_command_injection(self, tree: ast.AST, node: Dict) -> List[Dict]:
|
codegraph_cli/vector_store.py
CHANGED
|
@@ -94,8 +94,9 @@ class VectorStore:
|
|
|
94
94
|
if not node_ids:
|
|
95
95
|
return
|
|
96
96
|
|
|
97
|
-
rows = [
|
|
98
|
-
|
|
97
|
+
rows = []
|
|
98
|
+
for nid, emb, meta, doc in zip(node_ids, embeddings, metadatas, documents):
|
|
99
|
+
row = {
|
|
99
100
|
"id": nid,
|
|
100
101
|
"vector": emb,
|
|
101
102
|
"document": doc,
|
|
@@ -104,8 +105,11 @@ class VectorStore:
|
|
|
104
105
|
"qualname": meta.get("qualname", ""),
|
|
105
106
|
"name": meta.get("name", ""),
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
# Store any extra metadata keys beyond the standard four
|
|
109
|
+
for k, v in meta.items():
|
|
110
|
+
if k not in ("node_type", "file_path", "qualname", "name"):
|
|
111
|
+
row[k] = str(v)
|
|
112
|
+
rows.append(row)
|
|
109
113
|
|
|
110
114
|
if self._table is None:
|
|
111
115
|
# First insert – create the table (schema inferred from data)
|
|
@@ -243,21 +247,19 @@ class VectorStore:
|
|
|
243
247
|
if self._table is None:
|
|
244
248
|
return None
|
|
245
249
|
try:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
match = df[df["id"] == node_id]
|
|
249
|
-
if match.empty:
|
|
250
|
+
results = self._table.search().where(f'id = "{node_id}"').limit(1).to_list()
|
|
251
|
+
if not results:
|
|
250
252
|
return None
|
|
251
|
-
row =
|
|
253
|
+
row = results[0]
|
|
254
|
+
# Build metadata from all columns except internal/reserved ones
|
|
255
|
+
reserved = {"id", "vector", "document", "_distance", "_rowid"}
|
|
256
|
+
metadata = {
|
|
257
|
+
k: v for k, v in row.items() if k not in reserved and v is not None
|
|
258
|
+
}
|
|
252
259
|
return {
|
|
253
260
|
"id": row["id"],
|
|
254
261
|
"embedding": row.get("vector"),
|
|
255
|
-
"metadata":
|
|
256
|
-
"node_type": row.get("node_type", ""),
|
|
257
|
-
"file_path": row.get("file_path", ""),
|
|
258
|
-
"qualname": row.get("qualname", ""),
|
|
259
|
-
"name": row.get("name", ""),
|
|
260
|
-
},
|
|
262
|
+
"metadata": metadata,
|
|
261
263
|
"document": row.get("document", ""),
|
|
262
264
|
}
|
|
263
265
|
except Exception:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraph-cli
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.3
|
|
4
4
|
Summary: AI-powered code intelligence CLI with multi-agent analysis, impact graphs, and conversational coding.
|
|
5
5
|
Author-email: Ali Nasir <muhammadalinasir00786@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -69,7 +69,7 @@ Dynamic: license-file
|
|
|
69
69
|
|
|
70
70
|
[](LICENSE)
|
|
71
71
|
[](https://www.python.org)
|
|
72
|
-
[](https://github.com/al1-nasir/codegraph-cli)
|
|
73
73
|
[](https://github.com/al1-nasir/codegraph-cli/actions/workflows/ci.yml)
|
|
74
74
|
|
|
75
75
|
---
|
|
@@ -83,8 +83,11 @@ Core capabilities:
|
|
|
83
83
|
- **Semantic Search** — find code by meaning, not string matching
|
|
84
84
|
- **Impact Analysis** — trace multi-hop dependencies before making changes
|
|
85
85
|
- **Graph Visualization** — interactive HTML and Graphviz DOT exports
|
|
86
|
+
- **Browser-Based Explorer** — visual code navigation with Mermaid diagrams and AI explanations
|
|
86
87
|
- **Conversational Chat** — natural language coding sessions with RAG context
|
|
87
88
|
- **Multi-Agent System** — CrewAI-powered agents for code generation, refactoring, and analysis
|
|
89
|
+
- **DOCX Export** — generate professional project documentation with architecture diagrams
|
|
90
|
+
- **Auto Onboarding** — AI-generated README from your code graph
|
|
88
91
|
- **File Rollback** — automatic backups before every file modification
|
|
89
92
|
|
|
90
93
|
---
|
|
@@ -142,7 +145,7 @@ cg config set-llm ollama
|
|
|
142
145
|
### 2. Index a project
|
|
143
146
|
|
|
144
147
|
```bash
|
|
145
|
-
cg index /path/to/project --name myproject
|
|
148
|
+
cg project index /path/to/project --name myproject
|
|
146
149
|
```
|
|
147
150
|
|
|
148
151
|
This parses the source tree using tree-sitter, builds a dependency graph in SQLite, and generates embeddings for semantic search.
|
|
@@ -150,11 +153,14 @@ This parses the source tree using tree-sitter, builds a dependency graph in SQLi
|
|
|
150
153
|
### 3. Use it
|
|
151
154
|
|
|
152
155
|
```bash
|
|
153
|
-
cg search "authentication logic"
|
|
154
|
-
cg impact UserService --hops 3
|
|
155
|
-
cg graph process_payment --depth 2
|
|
156
|
+
cg analyze search "authentication logic"
|
|
157
|
+
cg analyze impact UserService --hops 3
|
|
158
|
+
cg analyze graph process_payment --depth 2
|
|
156
159
|
cg chat start
|
|
157
|
-
cg chat start --crew
|
|
160
|
+
cg chat start --crew # multi-agent mode
|
|
161
|
+
cg explore open # browser-based code explorer
|
|
162
|
+
cg onboard # auto-generate project README
|
|
163
|
+
cg export docx # export documentation to DOCX
|
|
158
164
|
```
|
|
159
165
|
|
|
160
166
|
---
|
|
@@ -209,44 +215,68 @@ cg index /path/to/project
|
|
|
209
215
|
|
|
210
216
|
## Commands
|
|
211
217
|
|
|
212
|
-
|
|
218
|
+
CodeGraph CLI organizes commands into logical groups:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
cg config — LLM, embedding, and setup configuration
|
|
222
|
+
cg project — Index, load, and manage project memories
|
|
223
|
+
cg analyze — Search, impact, graph, and RAG context
|
|
224
|
+
cg chat — Interactive chat with AI agents
|
|
225
|
+
cg explore — Visual code explorer in browser
|
|
226
|
+
cg export — Export project documentation
|
|
227
|
+
cg onboard — Auto-generate project README
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Configuration (`cg config`)
|
|
213
231
|
|
|
214
232
|
```bash
|
|
215
|
-
cg
|
|
216
|
-
cg
|
|
217
|
-
cg
|
|
218
|
-
cg
|
|
219
|
-
cg
|
|
220
|
-
cg
|
|
221
|
-
cg
|
|
233
|
+
cg config setup # interactive LLM setup wizard
|
|
234
|
+
cg config set-llm openrouter # switch LLM provider
|
|
235
|
+
cg config unset-llm # reset LLM config to defaults
|
|
236
|
+
cg config show-llm # show current LLM settings
|
|
237
|
+
cg config set-embedding jina-code # switch embedding model
|
|
238
|
+
cg config unset-embedding # reset to hash default
|
|
239
|
+
cg config show-embedding # show current embedding model
|
|
222
240
|
```
|
|
223
241
|
|
|
224
|
-
###
|
|
242
|
+
### Project Management (`cg project`)
|
|
225
243
|
|
|
226
244
|
```bash
|
|
227
|
-
cg
|
|
228
|
-
cg
|
|
229
|
-
cg
|
|
230
|
-
cg
|
|
245
|
+
cg project index <path> [--name NAME] # parse and index a codebase
|
|
246
|
+
cg project list # list all indexed projects
|
|
247
|
+
cg project load <name> # switch active project
|
|
248
|
+
cg project current # print active project name
|
|
249
|
+
cg project delete <name> # remove a project index
|
|
250
|
+
cg project merge <src> <dst> # merge two project graphs
|
|
251
|
+
cg project unload # unload without deleting
|
|
252
|
+
cg project init # quickstart wizard
|
|
253
|
+
cg project watch # auto-reindex on file changes
|
|
231
254
|
```
|
|
232
255
|
|
|
233
|
-
###
|
|
256
|
+
### Code Analysis (`cg analyze`)
|
|
234
257
|
|
|
235
258
|
```bash
|
|
236
|
-
cg
|
|
237
|
-
cg
|
|
238
|
-
cg
|
|
259
|
+
cg analyze search <query> [--top-k N] # semantic search across the graph
|
|
260
|
+
cg analyze impact <symbol> [--hops N] # multi-hop dependency impact analysis
|
|
261
|
+
cg analyze graph <symbol> [--depth N] # ASCII dependency graph
|
|
262
|
+
cg analyze export-graph --format html # interactive vis.js visualization
|
|
263
|
+
cg analyze export-graph --format dot # Graphviz DOT format
|
|
264
|
+
cg analyze rag-context <query> # raw RAG retrieval for debugging
|
|
265
|
+
cg analyze tree [--full] # directory tree of indexed project
|
|
266
|
+
cg analyze sync [--dry-run] # incremental index sync
|
|
267
|
+
cg analyze health # project health dashboard
|
|
239
268
|
```
|
|
240
269
|
|
|
241
|
-
### Interactive Chat
|
|
270
|
+
### Interactive Chat (`cg chat`)
|
|
242
271
|
|
|
243
272
|
```bash
|
|
244
|
-
cg chat start
|
|
245
|
-
cg chat start --new
|
|
246
|
-
cg chat start --crew
|
|
247
|
-
cg chat start -s <id>
|
|
248
|
-
cg chat list
|
|
249
|
-
cg chat delete <id>
|
|
273
|
+
cg chat start # start or resume a session
|
|
274
|
+
cg chat start --new # force a new session
|
|
275
|
+
cg chat start --crew # multi-agent mode (CrewAI)
|
|
276
|
+
cg chat start -s <id> # resume a specific session
|
|
277
|
+
cg chat list # list all sessions
|
|
278
|
+
cg chat delete <id> # delete a session
|
|
279
|
+
cg chat export <id> --format markdown # export session to file
|
|
250
280
|
```
|
|
251
281
|
|
|
252
282
|
In-chat commands:
|
|
@@ -263,18 +293,31 @@ In-chat commands:
|
|
|
263
293
|
| `/rollback <file>` | Crew | Restore a file from backup |
|
|
264
294
|
| `/undo <file>` | Crew | Alias for rollback |
|
|
265
295
|
|
|
266
|
-
###
|
|
296
|
+
### Visual Explorer (`cg explore`)
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
cg explore open # launch browser-based code explorer
|
|
300
|
+
cg explore open --port 9000 # use custom port
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Opens a local web UI with directory tree navigation, syntax-highlighted code, AI explanations, dependency graphs, and Mermaid diagrams.
|
|
304
|
+
|
|
305
|
+
### Documentation Export (`cg export`)
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
cg export docx # basic DOCX with structure + diagrams
|
|
309
|
+
cg export docx --enhanced # add AI-powered explanations
|
|
310
|
+
cg export docx --include-code # include source code listings
|
|
311
|
+
cg export docx --enhanced --depth files --include-code # full export
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Auto Onboarding
|
|
267
315
|
|
|
268
316
|
```bash
|
|
269
|
-
cg
|
|
270
|
-
cg
|
|
271
|
-
cg
|
|
272
|
-
cg
|
|
273
|
-
cg v2 test unit process_payment
|
|
274
|
-
cg v2 diagnose check src/
|
|
275
|
-
cg v2 diagnose fix src/auth.py
|
|
276
|
-
cg v2 rollback <file>
|
|
277
|
-
cg v2 list-backups
|
|
317
|
+
cg onboard # print AI-generated README to stdout
|
|
318
|
+
cg onboard --save # save as ONBOARD.md in project dir
|
|
319
|
+
cg onboard -o README.md # save to specific file
|
|
320
|
+
cg onboard --no-llm # template-only, no LLM call
|
|
278
321
|
```
|
|
279
322
|
|
|
280
323
|
---
|
|
@@ -297,23 +340,31 @@ Every file modification automatically creates a timestamped backup in `~/.codegr
|
|
|
297
340
|
## Architecture
|
|
298
341
|
|
|
299
342
|
```
|
|
300
|
-
CLI Layer (Typer)
|
|
343
|
+
CLI Layer (Typer + Rich)
|
|
344
|
+
|
|
|
345
|
+
+-- config ─────────> ConfigManager (TOML)
|
|
346
|
+
|
|
|
347
|
+
+-- project ────────> MCPOrchestrator ──> GraphStore (SQLite)
|
|
348
|
+
| | |
|
|
349
|
+
| +-- Parser +-- VectorStore (LanceDB)
|
|
350
|
+
| | (tree-sitter) |
|
|
351
|
+
| +-- RAGRetriever +-- Embeddings (configurable)
|
|
352
|
+
| +-- LLM Adapter hash | minilm | bge-base
|
|
353
|
+
| jina-code | qodo-1.5b
|
|
354
|
+
+-- analyze ────────> Search, Impact, Graph, Tree, Sync, Health
|
|
355
|
+
|
|
|
356
|
+
+-- chat ───────────> ChatAgent (standard mode)
|
|
357
|
+
| CrewChatAgent (--crew mode)
|
|
358
|
+
| +-- Coordinator Agent
|
|
359
|
+
| +-- File System Agent ──> 8 file operation tools
|
|
360
|
+
| +-- Code Gen Agent ─────> all 11 tools
|
|
361
|
+
| +-- Code Analysis Agent > 3 search/analysis tools
|
|
362
|
+
|
|
|
363
|
+
+-- explore ────────> Starlette + Uvicorn (browser UI)
|
|
301
364
|
|
|
|
302
|
-
+--
|
|
303
|
-
| | |
|
|
304
|
-
| +-- Parser (tree-sitter) +-- VectorStore (LanceDB)
|
|
305
|
-
| +-- RAGRetriever |
|
|
306
|
-
| +-- LLM Adapter +-- Embeddings (configurable)
|
|
307
|
-
| hash | minilm | bge-base
|
|
308
|
-
| jina-code | qodo-1.5b
|
|
309
|
-
+-- ChatAgent (standard mode)
|
|
365
|
+
+-- export ─────────> DOCX generator + Mermaid diagrams
|
|
310
366
|
|
|
|
311
|
-
+--
|
|
312
|
-
|
|
|
313
|
-
+-- Coordinator Agent
|
|
314
|
-
+-- File System Agent -----> 8 file operation tools
|
|
315
|
-
+-- Code Gen Agent --------> all 11 tools
|
|
316
|
-
+-- Code Analysis Agent ---> 3 search/analysis tools
|
|
367
|
+
+-- onboard ────────> AI README generation from code graph
|
|
317
368
|
```
|
|
318
369
|
|
|
319
370
|
**Embeddings**: Five models available via `cg config set-embedding`. Hash (default, zero-dependency) through Qodo-Embed-1-1.5B (best quality, 6 GB). Neural models use raw `transformers` + `torch` — no sentence-transformers overhead. Models are cached in `~/.codegraph/models/`.
|
|
@@ -330,20 +381,26 @@ CLI Layer (Typer)
|
|
|
330
381
|
|
|
331
382
|
```
|
|
332
383
|
codegraph_cli/
|
|
333
|
-
cli.py # main Typer application,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
384
|
+
cli.py # main Typer application, command wiring
|
|
385
|
+
cli_groups.py # command group definitions (config, project, analyze)
|
|
386
|
+
cli_chat.py # interactive chat REPL with Rich output
|
|
387
|
+
cli_setup.py # setup wizard, set-llm, set-embedding
|
|
388
|
+
cli_explore.py # browser-based visual code explorer (Starlette)
|
|
389
|
+
cli_export.py # DOCX export with Mermaid diagrams
|
|
390
|
+
cli_onboard.py # AI-generated project README
|
|
391
|
+
cli_health.py # project health dashboard
|
|
392
|
+
cli_quickstart.py # quickstart / init wizard
|
|
393
|
+
cli_watch.py # auto-reindex on file changes
|
|
337
394
|
config.py # loads config from TOML
|
|
338
395
|
config_manager.py # TOML read/write, provider and embedding config
|
|
339
396
|
llm.py # multi-provider LLM adapter
|
|
340
|
-
parser.py # tree-sitter AST parsing
|
|
397
|
+
parser.py # tree-sitter AST parsing (Python, JS, TS)
|
|
341
398
|
storage.py # SQLite graph store
|
|
342
399
|
embeddings.py # configurable embedding engine (5 models)
|
|
343
400
|
rag.py # RAG retriever
|
|
344
401
|
vector_store.py # LanceDB vector store
|
|
345
402
|
orchestrator.py # coordinates parsing, search, impact
|
|
346
|
-
graph_export.py # DOT and HTML export
|
|
403
|
+
graph_export.py # DOT and HTML graph export
|
|
347
404
|
project_context.py # unified file access layer
|
|
348
405
|
crew_tools.py # 11 CrewAI tools (file ops + analysis)
|
|
349
406
|
crew_agents.py # 4 specialized CrewAI agents
|
|
@@ -351,7 +408,6 @@ codegraph_cli/
|
|
|
351
408
|
chat_agent.py # standard chat agent
|
|
352
409
|
chat_session.py # session persistence
|
|
353
410
|
models.py # core data models
|
|
354
|
-
models_v2.py # v2 models (ChatSession, CodeProposal)
|
|
355
411
|
templates/
|
|
356
412
|
graph_interactive.html # vis.js graph template
|
|
357
413
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
codegraph_cli/__init__.py,sha256=
|
|
1
|
+
codegraph_cli/__init__.py,sha256=K_NC1z7GuzsqKxPHIg9PRu_GRuSCrlUr4VOdgtDx4u4,78
|
|
2
2
|
codegraph_cli/agents.py,sha256=AQb2PKwnEETphvkqgs3vlYDO0J2IVUH5tMEujwK_KZg,8938
|
|
3
3
|
codegraph_cli/bug_detector.py,sha256=soT4luB5eQx6qrU5rgFCsG44rdo9jRpV0hn-b0f3LPo,16419
|
|
4
4
|
codegraph_cli/chat_agent.py,sha256=aFV51Oxhz_158-k_GIPDplejm442jNYhJd7Qjf1hu-U,15658
|
|
@@ -26,9 +26,9 @@ codegraph_cli/codegen_agent.py,sha256=QU6uowy_I5ezzjGy3HqXpYWbUnB7JvjC1STfHKZXcU
|
|
|
26
26
|
codegraph_cli/config.py,sha256=oluY1A8L6V3vzJ4aotwGyx6NqFNht1_iK64oNvwt_hw,1710
|
|
27
27
|
codegraph_cli/config_manager.py,sha256=K81Ca7jHzHlwxoJsSeRezl8V-iGGJD_IEGE7ZWo3eG0,11422
|
|
28
28
|
codegraph_cli/context_manager.py,sha256=5rHw6x2aq4jeiWTaJfdFBJnezbuqoLM_NLJ7jb7_Exo,21173
|
|
29
|
-
codegraph_cli/crew_agents.py,sha256=
|
|
30
|
-
codegraph_cli/crew_chat.py,sha256=
|
|
31
|
-
codegraph_cli/crew_tools.py,sha256=
|
|
29
|
+
codegraph_cli/crew_agents.py,sha256=eaVJl9A-DZepGJdMXV4G-Eg-m1JyfWePrH-7jgRZyqk,7524
|
|
30
|
+
codegraph_cli/crew_chat.py,sha256=c2uCT_MW5d7CZk1Qr_Ro_PYqPr7dyPzm-yTY-DDxu4A,12433
|
|
31
|
+
codegraph_cli/crew_tools.py,sha256=M_Lds5o0VOJRo4J1V-cwZZla_RktLPdjP0J4qHjvbws,20624
|
|
32
32
|
codegraph_cli/diff_engine.py,sha256=VGwPG_pZFVz8lGuVHZz_0nhrDocglugw6TumMmnHdTY,8968
|
|
33
33
|
codegraph_cli/embeddings.py,sha256=18Dv5cbg0ZgUrTUVr3AXD8uWDdEePBsrXw2plARGIxQ,17405
|
|
34
34
|
codegraph_cli/graph_export.py,sha256=gPyRrOc4_gnW-JaHmmp2pAD60PiZIj_uYA6b0xfU5O0,4562
|
|
@@ -41,15 +41,15 @@ codegraph_cli/performance_analyzer.py,sha256=f9PNMZQ_8jWvzs4osPYgTW2eOsvDytIRmfW
|
|
|
41
41
|
codegraph_cli/project_context.py,sha256=O9VcLj21RN8i_f_yNesX6s42fjENxWp333bBRQ6zLLc,9790
|
|
42
42
|
codegraph_cli/rag.py,sha256=xioQvKhuLddwJ0wgciNJXik9Qc9y5YfHL1FiLqRjZmo,17725
|
|
43
43
|
codegraph_cli/refactor_agent.py,sha256=ktQyhUn5YjhbXt7IVgKV7JgSZaT4AivWLLpMlZ7NLXw,16657
|
|
44
|
-
codegraph_cli/security_scanner.py,sha256=
|
|
44
|
+
codegraph_cli/security_scanner.py,sha256=SSCQ_M01WgPFLjhxLEOFYpvK_cMeylCwFmWHXQdtc4Y,17769
|
|
45
45
|
codegraph_cli/storage.py,sha256=vUSxS2KSKmnCmnDpwcAV8M6pbZ3aJmfzM1tBH-zBDUI,24457
|
|
46
46
|
codegraph_cli/testgen_agent.py,sha256=rqlKbLeEnjfzAZhQUXqLPwFKwRIpiHriTPxVgPCuR_g,10233
|
|
47
47
|
codegraph_cli/validation_engine.py,sha256=pzoRH_b06gWfiDZ5Yiecf0SWDWs4oJ66JokggGZZbaw,9029
|
|
48
|
-
codegraph_cli/vector_store.py,sha256=
|
|
48
|
+
codegraph_cli/vector_store.py,sha256=GHWiJZiiWPKjsPc3bvhDHHNbXksf1G-dM189bhNQcJM,13700
|
|
49
49
|
codegraph_cli/templates/graph_interactive.html,sha256=PFpU69DbY-Vkcu5UTiqOva_LrZjN2erdz7VXPgNSt6Q,7813
|
|
50
|
-
codegraph_cli-2.1.
|
|
51
|
-
codegraph_cli-2.1.
|
|
52
|
-
codegraph_cli-2.1.
|
|
53
|
-
codegraph_cli-2.1.
|
|
54
|
-
codegraph_cli-2.1.
|
|
55
|
-
codegraph_cli-2.1.
|
|
50
|
+
codegraph_cli-2.1.3.dist-info/licenses/LICENSE,sha256=3PiQTjpJW4DDJz8k5pk-WqX9TrVQD3fNrVNzbTEyW-A,1066
|
|
51
|
+
codegraph_cli-2.1.3.dist-info/METADATA,sha256=vuDg7iKU-mq9N7OJiUNLgKq0ITiCNqY6JWUnFM5LZdw,16869
|
|
52
|
+
codegraph_cli-2.1.3.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
53
|
+
codegraph_cli-2.1.3.dist-info/entry_points.txt,sha256=X9M9UdR-uY2BmaTvb4GnHFbLzjLisOtXh6T72yl89_Y,50
|
|
54
|
+
codegraph_cli-2.1.3.dist-info/top_level.txt,sha256=XKmdlLsrhdgVW-pN4vzdo-ZTl-9_Rk94SXcM2YRAmHk,14
|
|
55
|
+
codegraph_cli-2.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|