codegraph-cli 2.1.0__py3-none-any.whl → 2.1.1__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/cli_chat.py CHANGED
@@ -13,7 +13,6 @@ import typer
13
13
  from . import config
14
14
  from .chat_agent import ChatAgent
15
15
  from .chat_session import SessionManager
16
- from .crew_chat import CrewChatAgent
17
16
  from .llm import LocalLLM
18
17
  from .orchestrator import MCPOrchestrator
19
18
  from .rag import RAGRetriever
@@ -299,7 +298,13 @@ def start_chat(
299
298
  rag_retriever = RAGRetriever(context.store, embedding_model)
300
299
 
301
300
  if use_crew:
302
- print(f"\n {C_MAGENTA}🤖 Initializing CrewAI multi-agent system...{C_RESET}")
301
+ try:
302
+ from .crew_chat import CrewChatAgent
303
+ except ImportError:
304
+ print(f"\n {C_RED}CrewAI is not installed.{C_RESET}")
305
+ print(f" {C_DIM}Install with: pip install codegraph-cli[crew]{C_RESET}\n")
306
+ raise typer.Exit(1)
307
+ print(f"\n {C_MAGENTA}Initializing CrewAI multi-agent system...{C_RESET}")
303
308
  agent = CrewChatAgent(context, llm, rag_retriever)
304
309
  else:
305
310
  orchestrator = MCPOrchestrator(
@@ -4,7 +4,12 @@ from __future__ import annotations
4
4
 
5
5
  from typing import TYPE_CHECKING, List
6
6
 
7
- from crewai import Agent
7
+ try:
8
+ from crewai import Agent
9
+ CREWAI_AVAILABLE = True
10
+ except ImportError:
11
+ Agent = None # type: ignore
12
+ CREWAI_AVAILABLE = False
8
13
 
9
14
  if TYPE_CHECKING:
10
15
  from .crew_tools import create_tools
@@ -8,7 +8,11 @@ from typing import TYPE_CHECKING, Dict, List
8
8
 
9
9
  from datetime import datetime
10
10
 
11
- from crewai import Agent, Crew, Task
11
+ try:
12
+ from crewai import Agent, Crew, Task
13
+ CREWAI_AVAILABLE = True
14
+ except ImportError:
15
+ CREWAI_AVAILABLE = False
12
16
 
13
17
  from .crew_agents import (
14
18
  create_code_analysis_agent,
@@ -9,7 +9,15 @@ from datetime import datetime
9
9
  from pathlib import Path
10
10
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type
11
11
 
12
- from crewai.tools import BaseTool
12
+ try:
13
+ from crewai.tools import BaseTool
14
+ CREWAI_AVAILABLE = True
15
+ except ImportError:
16
+ # Provide a dummy base class so the module can still be imported
17
+ class BaseTool: # type: ignore
18
+ def __init_subclass__(cls, **kwargs): pass
19
+ def __init__(self, **kwargs): pass
20
+ CREWAI_AVAILABLE = False
13
21
  from pydantic import BaseModel, Field, PrivateAttr
14
22
 
15
23
  if TYPE_CHECKING:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraph-cli
3
- Version: 2.1.0
3
+ Version: 2.1.1
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
@@ -59,7 +59,7 @@ Dynamic: license-file
59
59
 
60
60
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
61
61
  [![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org)
62
- [![Version](https://img.shields.io/badge/version-2.0.0-blue.svg)](https://github.com/al1-nasir/codegraph-cli)
62
+ [![Version](https://img.shields.io/badge/version-2.1.0-blue.svg)](https://github.com/al1-nasir/codegraph-cli)
63
63
 
64
64
  ---
65
65
 
@@ -84,12 +84,24 @@ Core capabilities:
84
84
  pip install codegraph-cli
85
85
  ```
86
86
 
87
+ With neural embedding models (semantic code search):
88
+
89
+ ```bash
90
+ pip install codegraph-cli[embeddings]
91
+ ```
92
+
87
93
  With CrewAI multi-agent support:
88
94
 
89
95
  ```bash
90
96
  pip install codegraph-cli[crew]
91
97
  ```
92
98
 
99
+ Everything:
100
+
101
+ ```bash
102
+ pip install codegraph-cli[all]
103
+ ```
104
+
93
105
  For development:
94
106
 
95
107
  ```bash
@@ -156,6 +168,34 @@ cg unset-llm # reset to defaults
156
168
 
157
169
  ---
158
170
 
171
+ ## Embedding Models
172
+
173
+ CodeGraph supports configurable embedding models for semantic code search. Choose based on your hardware and quality needs:
174
+
175
+ | Model | Download | Dim | Quality | Command |
176
+ |-------|----------|-----|---------|---------|
177
+ | hash | 0 bytes | 256 | Keyword-only | `cg set-embedding hash` |
178
+ | minilm | ~80 MB | 384 | Decent | `cg set-embedding minilm` |
179
+ | bge-base | ~440 MB | 768 | Good | `cg set-embedding bge-base` |
180
+ | jina-code | ~550 MB | 768 | Code-aware | `cg set-embedding jina-code` |
181
+ | qodo-1.5b | ~6.2 GB | 1536 | Best | `cg set-embedding qodo-1.5b` |
182
+
183
+ The default is `hash` (zero-dependency, no download). Neural models require the `[embeddings]` extra and are downloaded on first use from HuggingFace.
184
+
185
+ ```bash
186
+ cg set-embedding jina-code # switch to a neural model
187
+ cg show-embedding # view current model and all options
188
+ cg unset-embedding # reset to hash default
189
+ ```
190
+
191
+ After changing the embedding model, re-index your project:
192
+
193
+ ```bash
194
+ cg index /path/to/project
195
+ ```
196
+
197
+ ---
198
+
159
199
  ## Commands
160
200
 
161
201
  ### Project Management
@@ -252,8 +292,9 @@ CLI Layer (Typer)
252
292
  | | |
253
293
  | +-- Parser (tree-sitter) +-- VectorStore (LanceDB)
254
294
  | +-- RAGRetriever |
255
- | +-- LLM Adapter +-- Embeddings
256
- |
295
+ | +-- LLM Adapter +-- Embeddings (configurable)
296
+ | hash | minilm | bge-base
297
+ | jina-code | qodo-1.5b
257
298
  +-- ChatAgent (standard mode)
258
299
  |
259
300
  +-- CrewChatAgent (--crew mode)
@@ -264,6 +305,8 @@ CLI Layer (Typer)
264
305
  +-- Code Analysis Agent ---> 3 search/analysis tools
265
306
  ```
266
307
 
308
+ **Embeddings**: Five models available via `cg 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/`.
309
+
267
310
  **Parser**: tree-sitter grammars for Python, JavaScript, and TypeScript. Extracts modules, classes, functions, imports, and call relationships into a directed graph.
268
311
 
269
312
  **Storage**: SQLite for the code graph (nodes + edges), LanceDB for vector embeddings. All data stored under `~/.codegraph/`.
@@ -278,14 +321,14 @@ CLI Layer (Typer)
278
321
  codegraph_cli/
279
322
  cli.py # main Typer application, all top-level commands
280
323
  cli_chat.py # interactive chat REPL with styled output
281
- cli_setup.py # setup wizard, set-llm, unset-llm, show-llm
324
+ cli_setup.py # setup wizard, set-llm, unset-llm, set-embedding
282
325
  cli_v2.py # v2 code generation commands
283
326
  config.py # loads config from TOML
284
- config_manager.py # TOML read/write, provider validation
327
+ config_manager.py # TOML read/write, provider and embedding config
285
328
  llm.py # multi-provider LLM adapter
286
329
  parser.py # tree-sitter AST parsing
287
330
  storage.py # SQLite graph store
288
- embeddings.py # hash-based embedding model
331
+ embeddings.py # configurable embedding engine (5 models)
289
332
  rag.py # RAG retriever
290
333
  vector_store.py # LanceDB vector store
291
334
  orchestrator.py # coordinates parsing, search, impact
@@ -310,7 +353,7 @@ codegraph_cli/
310
353
  git clone https://github.com/al1-nasir/codegraph-cli.git
311
354
  cd codegraph-cli
312
355
  python -m venv .venv && source .venv/bin/activate
313
- pip install -e ".[dev,crew]"
356
+ pip install -e ".[dev,crew,embeddings]"
314
357
  pytest
315
358
  ```
316
359
 
@@ -4,7 +4,7 @@ codegraph_cli/bug_detector.py,sha256=soT4luB5eQx6qrU5rgFCsG44rdo9jRpV0hn-b0f3LPo
4
4
  codegraph_cli/chat_agent.py,sha256=dbkEY3zaPJh0ztYaVkCwkTw5zSLGArHkChC_6JWOneg,13685
5
5
  codegraph_cli/chat_session.py,sha256=GVey-hnfsa9fa6k2PY1sgy1wtrYSUHKE5cJDV2hG-tg,7038
6
6
  codegraph_cli/cli.py,sha256=eEzH4TOgyMAFJpVhh2hU0MD2oh61s1hBomeSFx3I3qE,11199
7
- codegraph_cli/cli_chat.py,sha256=8vk0zrhFQ6MGUa4KomZfnlBXN-Tw-D6aWjqeQPVFxL8,14172
7
+ codegraph_cli/cli_chat.py,sha256=6BV6UADrInATgeywmzr0R7u0Ju4WuyRXgoWHq7lDbUA,14407
8
8
  codegraph_cli/cli_diagnose.py,sha256=gT4qHayC_uWRMsr1Tf92BCFJfRcXAMq8XdEImatrSkU,4260
9
9
  codegraph_cli/cli_refactor.py,sha256=_u5RvsF3-KV5C_QnErA4sowlkIAmlxSeLeWKBmSusCI,8176
10
10
  codegraph_cli/cli_setup.py,sha256=f8KdcE0Tf9HQ_ewQm1R_4OZ91bOmi0kuM8eQ05Vs7is,24749
@@ -14,9 +14,9 @@ codegraph_cli/codegen_agent.py,sha256=F73YZIIVgE5pOvJsKBl0cv22VW3rP_SGj2viwZS-rq
14
14
  codegraph_cli/config.py,sha256=rOq4lDvqmoly1pfEukzPeCUb76BMqK7cUbzDSFHhsC8,1291
15
15
  codegraph_cli/config_manager.py,sha256=K81Ca7jHzHlwxoJsSeRezl8V-iGGJD_IEGE7ZWo3eG0,11422
16
16
  codegraph_cli/context_manager.py,sha256=qEKjI7llcLX9y8NFTDs3aiHDm7nDF9jTbhu3tHHOk6w,16824
17
- codegraph_cli/crew_agents.py,sha256=PKb0skEmxBy2_Ryq67XccmPizLFLgPNs43xOqjSHcGM,6006
18
- codegraph_cli/crew_chat.py,sha256=tdo8Zf9lOp5-XMdvNntLxo5hKrDcEOe3165cH22-nvQ,6149
19
- codegraph_cli/crew_tools.py,sha256=wg39mkPDHeE2Wuy3q54xl5d243MHQZBcXCWR2rHrd3M,19339
17
+ codegraph_cli/crew_agents.py,sha256=RWdx0H8G5UwIGGCOr6Z7WH04P7V0zedtEiD1236BD3U,6125
18
+ codegraph_cli/crew_chat.py,sha256=ZppRIp4D3RtcZItFPw6mFJxTJGGacbN_f_a1KmMMg-o,6235
19
+ codegraph_cli/crew_tools.py,sha256=wvYJn1w6nZIXPXyPMpiyqsl3kJ9kpR-sK6QOXcny6oM,19624
20
20
  codegraph_cli/diff_engine.py,sha256=VGwPG_pZFVz8lGuVHZz_0nhrDocglugw6TumMmnHdTY,8968
21
21
  codegraph_cli/embeddings.py,sha256=YoR6OjiIFC628EnLhNWbw2-_YWqtxSlL--tNWHGsKRk,14611
22
22
  codegraph_cli/graph_export.py,sha256=gPyRrOc4_gnW-JaHmmp2pAD60PiZIj_uYA6b0xfU5O0,4562
@@ -35,9 +35,9 @@ codegraph_cli/testgen_agent.py,sha256=rqlKbLeEnjfzAZhQUXqLPwFKwRIpiHriTPxVgPCuR_
35
35
  codegraph_cli/validation_engine.py,sha256=pzoRH_b06gWfiDZ5Yiecf0SWDWs4oJ66JokggGZZbaw,9029
36
36
  codegraph_cli/vector_store.py,sha256=qbIBVDoNOha8JgZwrk7_Jdb7RMYUnBLphJfmqQdrVN4,9912
37
37
  codegraph_cli/templates/graph_interactive.html,sha256=PFpU69DbY-Vkcu5UTiqOva_LrZjN2erdz7VXPgNSt6Q,7813
38
- codegraph_cli-2.1.0.dist-info/licenses/LICENSE,sha256=3PiQTjpJW4DDJz8k5pk-WqX9TrVQD3fNrVNzbTEyW-A,1066
39
- codegraph_cli-2.1.0.dist-info/METADATA,sha256=p1GW3UN_gchcHGMyx7_mMT9zZpGkTNbHEcR2DBst6xg,11183
40
- codegraph_cli-2.1.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
41
- codegraph_cli-2.1.0.dist-info/entry_points.txt,sha256=_p5CutxbiWjGVTx9GPeYJ30XOblccdf7SCCNtCkPnaA,45
42
- codegraph_cli-2.1.0.dist-info/top_level.txt,sha256=XKmdlLsrhdgVW-pN4vzdo-ZTl-9_Rk94SXcM2YRAmHk,14
43
- codegraph_cli-2.1.0.dist-info/RECORD,,
38
+ codegraph_cli-2.1.1.dist-info/licenses/LICENSE,sha256=3PiQTjpJW4DDJz8k5pk-WqX9TrVQD3fNrVNzbTEyW-A,1066
39
+ codegraph_cli-2.1.1.dist-info/METADATA,sha256=tooj5BPm3FdTkHR7en9n9Gp-zxqOEMpkEGt4yJWugMw,12829
40
+ codegraph_cli-2.1.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
41
+ codegraph_cli-2.1.1.dist-info/entry_points.txt,sha256=_p5CutxbiWjGVTx9GPeYJ30XOblccdf7SCCNtCkPnaA,45
42
+ codegraph_cli-2.1.1.dist-info/top_level.txt,sha256=XKmdlLsrhdgVW-pN4vzdo-ZTl-9_Rk94SXcM2YRAmHk,14
43
+ codegraph_cli-2.1.1.dist-info/RECORD,,