codegraphcontext 0.1.32__tar.gz → 0.1.34__tar.gz
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.
- {codegraphcontext-0.1.32/src/codegraphcontext.egg-info → codegraphcontext-0.1.34}/PKG-INFO +33 -19
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/README.md +32 -18
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/pyproject.toml +1 -1
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/cli_helpers.py +79 -17
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/config_manager.py +21 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/main.py +414 -32
- codegraphcontext-0.1.34/src/codegraphcontext/cli/registry_commands.py +304 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/setup_wizard.py +4 -4
- codegraphcontext-0.1.34/src/codegraphcontext/cli/visualizer.py +1082 -0
- codegraphcontext-0.1.34/src/codegraphcontext/core/cgc_bundle.py +691 -0
- codegraphcontext-0.1.34/src/codegraphcontext/server.py +286 -0
- codegraphcontext-0.1.34/src/codegraphcontext/tool_definitions.py +160 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/code_finder.py +2 -7
- codegraphcontext-0.1.34/src/codegraphcontext/tools/handlers/analysis_handlers.py +108 -0
- codegraphcontext-0.1.34/src/codegraphcontext/tools/handlers/indexing_handlers.py +115 -0
- codegraphcontext-0.1.34/src/codegraphcontext/tools/handlers/management_handlers.py +113 -0
- codegraphcontext-0.1.34/src/codegraphcontext/tools/handlers/query_handlers.py +180 -0
- codegraphcontext-0.1.34/src/codegraphcontext/tools/handlers/watcher_handlers.py +84 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/python.py +97 -1
- codegraphcontext-0.1.34/src/codegraphcontext/utils/visualize_graph.py +150 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34/src/codegraphcontext.egg-info}/PKG-INFO +33 -19
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext.egg-info/SOURCES.txt +12 -1
- codegraphcontext-0.1.34/tests/test_visualization.py +548 -0
- codegraphcontext-0.1.32/src/codegraphcontext/server.py +0 -949
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/LICENSE +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/MANIFEST.in +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/setup.cfg +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext.egg-info/requires.txt +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_cpp_parser.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_database_validation.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_end_to_end.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_graph_indexing.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_graph_indexing_js.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_kotlin_parser.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_swift_parser.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_tree_sitter_manager.py +0 -0
- {codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/tests/test_typescript_parser.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.34
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -63,20 +63,20 @@ Dynamic: license-file
|
|
|
63
63
|
# CodeGraphContext
|
|
64
64
|
|
|
65
65
|
<!-- ====== Project stats ====== -->
|
|
66
|
-
[](https://github.com/CodeGraphContext/CodeGraphContext/stargazers)
|
|
67
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/network/members)
|
|
68
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/issues)
|
|
69
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/pulls)
|
|
70
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/pulls?q=is%3Apr+is%3Aclosed)
|
|
71
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/graphs/contributors)
|
|
72
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext)
|
|
73
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/test.yml)
|
|
74
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/e2e-tests.yml)
|
|
75
75
|
[](https://pypi.org/project/codegraphcontext/)
|
|
76
76
|
[](https://pypi.org/project/codegraphcontext/)
|
|
77
|
-
[](LICENSE)
|
|
78
78
|
[](http://codegraphcontext.vercel.app/)
|
|
79
|
-
[](https://
|
|
79
|
+
[](https://CodeGraphContext.github.io/CodeGraphContext/)
|
|
80
80
|
[](https://youtu.be/KYYSdxhg1xU)
|
|
81
81
|
[](https://discord.gg/dR4QY32uYQ)
|
|
82
82
|
|
|
@@ -85,24 +85,37 @@ Dynamic: license-file
|
|
|
85
85
|
A powerful **MCP server** and **CLI toolkit** that indexes local code into a graph database to provide context to AI assistants and developers. Use it as a standalone CLI for comprehensive code analysis or connect it to your favorite AI IDE via MCP for AI-powered code understanding.
|
|
86
86
|
|
|
87
87
|
### Indexing a codebase
|
|
88
|
-

|
|
89
89
|
|
|
90
90
|
### Using the MCP server
|
|
91
|
-

|
|
92
92
|
|
|
93
93
|
## Project Details
|
|
94
|
-
- **Version:** 0.1.
|
|
94
|
+
- **Version:** 0.1.34
|
|
95
95
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
96
96
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
97
97
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
98
98
|
|
|
99
|
+
## 👨💻 Maintainer
|
|
100
|
+
|
|
101
|
+
**CodeGraphContext** is created and actively maintained by:
|
|
102
|
+
|
|
103
|
+
**Shashank Shekhar Singh**
|
|
104
|
+
- 📧 Email: [shashankshekharsingh1205@gmail.com](mailto:shashankshekharsingh1205@gmail.com)
|
|
105
|
+
- 🐙 GitHub: [@Shashankss1205](https://github.com/Shashankss1205)
|
|
106
|
+
- 🔗 LinkedIn: [Shashank Shekhar Singh](https://www.linkedin.com/in/shashank-shekhar-singh-a67282228/)
|
|
107
|
+
- 🌐 Website: [codegraphcontext.vercel.app](http://codegraphcontext.vercel.app/)
|
|
108
|
+
|
|
109
|
+
*Contributions and feedback are always welcome! Feel free to reach out for questions, suggestions, or collaboration opportunities.*
|
|
110
|
+
|
|
99
111
|
## Star History
|
|
100
|
-
[](https://www.star-history.com/#CodeGraphContext/CodeGraphContext&Date)
|
|
101
113
|
|
|
102
114
|
## Features
|
|
103
115
|
|
|
104
116
|
- **Code Indexing:** Analyzes code and builds a knowledge graph of its components.
|
|
105
117
|
- **Relationship Analysis:** Query for callers, callees, class hierarchies, call chains and more.
|
|
118
|
+
- **Pre-indexed Bundles:** Load famous repositories instantly with `.cgc` bundles - no indexing required! ([Learn more](docs/BUNDLES.md))
|
|
106
119
|
- **Live File Watching:** Watch directories for changes and automatically update the graph in real-time (`cgc watch`).
|
|
107
120
|
- **Interactive Setup:** A user-friendly command-line wizard for easy setup.
|
|
108
121
|
- **Dual Mode:** Works as a standalone **CLI toolkit** for developers and as an **MCP server** for AI agents.
|
|
@@ -110,6 +123,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
110
123
|
- **Flexible Database Backend:** FalkorDB Lite (default, inbuilt for Unix and through WSL for Windows) or Neo4j (all platforms via Docker/native).
|
|
111
124
|
|
|
112
125
|
|
|
126
|
+
|
|
113
127
|
## Supported Programming Languages
|
|
114
128
|
|
|
115
129
|
CodeGraphContext provides comprehensive parsing and analysis for the following languages:
|
|
@@ -227,7 +241,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
227
241
|
**Linux/Mac:**
|
|
228
242
|
```bash
|
|
229
243
|
# Download the fix script
|
|
230
|
-
curl -O https://raw.githubusercontent.com/
|
|
244
|
+
curl -O https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/scripts/post_install_fix.sh
|
|
231
245
|
|
|
232
246
|
# Make it executable
|
|
233
247
|
chmod +x post_install_fix.sh
|
|
@@ -242,7 +256,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
242
256
|
**Windows (PowerShell):**
|
|
243
257
|
```powershell
|
|
244
258
|
# Download the fix script
|
|
245
|
-
curl -O https://raw.githubusercontent.com/
|
|
259
|
+
curl -O https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/scripts/post_install_fix.sh
|
|
246
260
|
|
|
247
261
|
# Run with bash (requires Git Bash or WSL)
|
|
248
262
|
bash post_install_fix.sh
|
|
@@ -455,6 +469,6 @@ Once the server is running, you can interact with it through your AI assistant u
|
|
|
455
469
|
|
|
456
470
|
Contributions are welcome! 🎉
|
|
457
471
|
Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
458
|
-
If you have ideas for new features, integrations, or improvements, open an [issue](https://github.com/
|
|
472
|
+
If you have ideas for new features, integrations, or improvements, open an [issue](https://github.com/CodeGraphContext/CodeGraphContext/issues) or submit a Pull Request.
|
|
459
473
|
|
|
460
474
|
Join discussions and help shape the future of CodeGraphContext.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# CodeGraphContext
|
|
2
2
|
|
|
3
3
|
<!-- ====== Project stats ====== -->
|
|
4
|
-
[](https://github.com/CodeGraphContext/CodeGraphContext/stargazers)
|
|
5
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/network/members)
|
|
6
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/issues)
|
|
7
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/pulls)
|
|
8
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/pulls?q=is%3Apr+is%3Aclosed)
|
|
9
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/graphs/contributors)
|
|
10
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext)
|
|
11
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/test.yml)
|
|
12
|
+
[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/e2e-tests.yml)
|
|
13
13
|
[](https://pypi.org/project/codegraphcontext/)
|
|
14
14
|
[](https://pypi.org/project/codegraphcontext/)
|
|
15
|
-
[](LICENSE)
|
|
16
16
|
[](http://codegraphcontext.vercel.app/)
|
|
17
|
-
[](https://
|
|
17
|
+
[](https://CodeGraphContext.github.io/CodeGraphContext/)
|
|
18
18
|
[](https://youtu.be/KYYSdxhg1xU)
|
|
19
19
|
[](https://discord.gg/dR4QY32uYQ)
|
|
20
20
|
|
|
@@ -23,24 +23,37 @@
|
|
|
23
23
|
A powerful **MCP server** and **CLI toolkit** that indexes local code into a graph database to provide context to AI assistants and developers. Use it as a standalone CLI for comprehensive code analysis or connect it to your favorite AI IDE via MCP for AI-powered code understanding.
|
|
24
24
|
|
|
25
25
|
### Indexing a codebase
|
|
26
|
-

|
|
27
27
|
|
|
28
28
|
### Using the MCP server
|
|
29
|
-

|
|
30
30
|
|
|
31
31
|
## Project Details
|
|
32
|
-
- **Version:** 0.1.
|
|
32
|
+
- **Version:** 0.1.34
|
|
33
33
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
34
34
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
35
35
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
36
36
|
|
|
37
|
+
## 👨💻 Maintainer
|
|
38
|
+
|
|
39
|
+
**CodeGraphContext** is created and actively maintained by:
|
|
40
|
+
|
|
41
|
+
**Shashank Shekhar Singh**
|
|
42
|
+
- 📧 Email: [shashankshekharsingh1205@gmail.com](mailto:shashankshekharsingh1205@gmail.com)
|
|
43
|
+
- 🐙 GitHub: [@Shashankss1205](https://github.com/Shashankss1205)
|
|
44
|
+
- 🔗 LinkedIn: [Shashank Shekhar Singh](https://www.linkedin.com/in/shashank-shekhar-singh-a67282228/)
|
|
45
|
+
- 🌐 Website: [codegraphcontext.vercel.app](http://codegraphcontext.vercel.app/)
|
|
46
|
+
|
|
47
|
+
*Contributions and feedback are always welcome! Feel free to reach out for questions, suggestions, or collaboration opportunities.*
|
|
48
|
+
|
|
37
49
|
## Star History
|
|
38
|
-
[](https://www.star-history.com/#CodeGraphContext/CodeGraphContext&Date)
|
|
39
51
|
|
|
40
52
|
## Features
|
|
41
53
|
|
|
42
54
|
- **Code Indexing:** Analyzes code and builds a knowledge graph of its components.
|
|
43
55
|
- **Relationship Analysis:** Query for callers, callees, class hierarchies, call chains and more.
|
|
56
|
+
- **Pre-indexed Bundles:** Load famous repositories instantly with `.cgc` bundles - no indexing required! ([Learn more](docs/BUNDLES.md))
|
|
44
57
|
- **Live File Watching:** Watch directories for changes and automatically update the graph in real-time (`cgc watch`).
|
|
45
58
|
- **Interactive Setup:** A user-friendly command-line wizard for easy setup.
|
|
46
59
|
- **Dual Mode:** Works as a standalone **CLI toolkit** for developers and as an **MCP server** for AI agents.
|
|
@@ -48,6 +61,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
48
61
|
- **Flexible Database Backend:** FalkorDB Lite (default, inbuilt for Unix and through WSL for Windows) or Neo4j (all platforms via Docker/native).
|
|
49
62
|
|
|
50
63
|
|
|
64
|
+
|
|
51
65
|
## Supported Programming Languages
|
|
52
66
|
|
|
53
67
|
CodeGraphContext provides comprehensive parsing and analysis for the following languages:
|
|
@@ -165,7 +179,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
165
179
|
**Linux/Mac:**
|
|
166
180
|
```bash
|
|
167
181
|
# Download the fix script
|
|
168
|
-
curl -O https://raw.githubusercontent.com/
|
|
182
|
+
curl -O https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/scripts/post_install_fix.sh
|
|
169
183
|
|
|
170
184
|
# Make it executable
|
|
171
185
|
chmod +x post_install_fix.sh
|
|
@@ -180,7 +194,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
180
194
|
**Windows (PowerShell):**
|
|
181
195
|
```powershell
|
|
182
196
|
# Download the fix script
|
|
183
|
-
curl -O https://raw.githubusercontent.com/
|
|
197
|
+
curl -O https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/scripts/post_install_fix.sh
|
|
184
198
|
|
|
185
199
|
# Run with bash (requires Git Bash or WSL)
|
|
186
200
|
bash post_install_fix.sh
|
|
@@ -393,6 +407,6 @@ Once the server is running, you can interact with it through your AI assistant u
|
|
|
393
407
|
|
|
394
408
|
Contributions are welcome! 🎉
|
|
395
409
|
Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
396
|
-
If you have ideas for new features, integrations, or improvements, open an [issue](https://github.com/
|
|
410
|
+
If you have ideas for new features, integrations, or improvements, open an [issue](https://github.com/CodeGraphContext/CodeGraphContext/issues) or submit a Pull Request.
|
|
397
411
|
|
|
398
412
|
Join discussions and help shape the future of CodeGraphContext.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.34"
|
|
4
4
|
description = "An MCP server that indexes local code into a graph database to provide context to AI assistants."
|
|
5
5
|
authors = [{ name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" }]
|
|
6
6
|
readme = "README.md"
|
|
@@ -227,6 +227,39 @@ def cypher_helper(query: str):
|
|
|
227
227
|
db_manager.close_driver()
|
|
228
228
|
|
|
229
229
|
|
|
230
|
+
def cypher_helper_visual(query: str):
|
|
231
|
+
"""Executes a read-only Cypher query and visualizes the results."""
|
|
232
|
+
from .visualizer import visualize_cypher_results
|
|
233
|
+
|
|
234
|
+
services = _initialize_services()
|
|
235
|
+
if not all(services):
|
|
236
|
+
return
|
|
237
|
+
|
|
238
|
+
db_manager, _, _ = services
|
|
239
|
+
|
|
240
|
+
# Replicating safety checks from MCPServer
|
|
241
|
+
forbidden_keywords = ['CREATE', 'MERGE', 'DELETE', 'SET', 'REMOVE', 'DROP', 'CALL apoc']
|
|
242
|
+
if any(keyword in query.upper() for keyword in forbidden_keywords):
|
|
243
|
+
console.print("[bold red]Error: This command only supports read-only queries.[/bold red]")
|
|
244
|
+
db_manager.close_driver()
|
|
245
|
+
return
|
|
246
|
+
|
|
247
|
+
try:
|
|
248
|
+
with db_manager.get_driver().session() as session:
|
|
249
|
+
result = session.run(query)
|
|
250
|
+
records = [record.data() for record in result]
|
|
251
|
+
|
|
252
|
+
if not records:
|
|
253
|
+
console.print("[yellow]No results to visualize.[/yellow]")
|
|
254
|
+
return # finally block will close driver
|
|
255
|
+
|
|
256
|
+
visualize_cypher_results(records, query)
|
|
257
|
+
except Exception as e:
|
|
258
|
+
console.print(f"[bold red]An error occurred while executing query:[/bold red] {e}")
|
|
259
|
+
finally:
|
|
260
|
+
db_manager.close_driver()
|
|
261
|
+
|
|
262
|
+
|
|
230
263
|
import webbrowser
|
|
231
264
|
|
|
232
265
|
def visualize_helper(query: str):
|
|
@@ -421,25 +454,54 @@ def clean_helper():
|
|
|
421
454
|
console.print("[cyan]🧹 Cleaning database (removing orphaned nodes)...[/cyan]")
|
|
422
455
|
|
|
423
456
|
try:
|
|
457
|
+
# Determine if we're using FalkorDB or Neo4j for query optimization
|
|
458
|
+
db_type = db_manager.__class__.__name__
|
|
459
|
+
is_falkordb = "Falkor" in db_type
|
|
460
|
+
|
|
461
|
+
total_deleted = 0
|
|
462
|
+
batch_size = 1000
|
|
463
|
+
|
|
424
464
|
with db_manager.get_driver().session() as session:
|
|
425
|
-
#
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
465
|
+
# Keep deleting orphaned nodes in batches until none are found
|
|
466
|
+
while True:
|
|
467
|
+
if is_falkordb:
|
|
468
|
+
# FalkorDB-compatible query using OPTIONAL MATCH
|
|
469
|
+
query = """
|
|
470
|
+
MATCH (n)
|
|
471
|
+
WHERE NOT (n:Repository)
|
|
472
|
+
OPTIONAL MATCH path = (n)-[*..10]-(r:Repository)
|
|
473
|
+
WITH n, path
|
|
474
|
+
WHERE path IS NULL
|
|
475
|
+
WITH n LIMIT $batch_size
|
|
476
|
+
DETACH DELETE n
|
|
477
|
+
RETURN count(n) as deleted
|
|
478
|
+
"""
|
|
479
|
+
else:
|
|
480
|
+
# Neo4j optimized query using NOT EXISTS with bounded path
|
|
481
|
+
# This is much faster than OPTIONAL MATCH with variable-length paths
|
|
482
|
+
query = """
|
|
483
|
+
MATCH (n)
|
|
484
|
+
WHERE NOT (n:Repository)
|
|
485
|
+
AND NOT EXISTS {
|
|
486
|
+
MATCH (n)-[*..10]-(r:Repository)
|
|
487
|
+
}
|
|
488
|
+
WITH n LIMIT $batch_size
|
|
489
|
+
DETACH DELETE n
|
|
490
|
+
RETURN count(n) as deleted
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
result = session.run(query, batch_size=batch_size)
|
|
494
|
+
record = result.single()
|
|
495
|
+
deleted_count = record["deleted"] if record else 0
|
|
496
|
+
total_deleted += deleted_count
|
|
497
|
+
|
|
498
|
+
if deleted_count == 0:
|
|
499
|
+
break
|
|
500
|
+
|
|
501
|
+
console.print(f"[dim]Deleted {deleted_count} orphaned nodes (batch)...[/dim]")
|
|
440
502
|
|
|
441
|
-
if
|
|
442
|
-
console.print(f"[green]✓[/green] Deleted {
|
|
503
|
+
if total_deleted > 0:
|
|
504
|
+
console.print(f"[green]✓[/green] Deleted {total_deleted} orphaned nodes total")
|
|
443
505
|
else:
|
|
444
506
|
console.print("[green]✓[/green] No orphaned nodes found")
|
|
445
507
|
|
{codegraphcontext-0.1.32 → codegraphcontext-0.1.34}/src/codegraphcontext/cli/config_manager.py
RENAMED
|
@@ -315,8 +315,29 @@ def reset_config():
|
|
|
315
315
|
console.print("[cyan]Note: Database credentials were preserved[/cyan]")
|
|
316
316
|
|
|
317
317
|
|
|
318
|
+
|
|
319
|
+
def ensure_config_file():
|
|
320
|
+
"""
|
|
321
|
+
Create default .env config file on first run if it does not exist.
|
|
322
|
+
"""
|
|
323
|
+
ensure_config_dir()
|
|
324
|
+
|
|
325
|
+
if CONFIG_FILE.exists():
|
|
326
|
+
return False # file already exists
|
|
327
|
+
|
|
328
|
+
save_config(DEFAULT_CONFIG.copy(), preserve_db_credentials=False)
|
|
329
|
+
return True # file was created
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
318
334
|
def show_config():
|
|
319
335
|
"""Display current configuration in a nice table."""
|
|
336
|
+
created = ensure_config_file()
|
|
337
|
+
if created:
|
|
338
|
+
console.print(
|
|
339
|
+
f"[green]🆕 Created default configuration at {CONFIG_FILE}[/green]\n"
|
|
340
|
+
)
|
|
320
341
|
config = load_config()
|
|
321
342
|
|
|
322
343
|
# Separate database credentials from configuration
|