cortexcode 0.6.0__tar.gz → 0.8.0__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.
Files changed (182) hide show
  1. {cortexcode-0.6.0 → cortexcode-0.8.0}/PKG-INFO +632 -555
  2. {cortexcode-0.6.0 → cortexcode-0.8.0}/README.md +107 -30
  3. cortexcode-0.8.0/cortexcode/cli/cli_bundle.py +143 -0
  4. cortexcode-0.8.0/cortexcode/cli/cli_githook.py +106 -0
  5. cortexcode-0.8.0/cortexcode/cli/cli_jobs.py +145 -0
  6. cortexcode-0.8.0/cortexcode/cli/cli_package.py +201 -0
  7. cortexcode-0.8.0/cortexcode/cli/cli_servers.py +159 -0
  8. cortexcode-0.8.0/cortexcode/cli/cli_shell.py +144 -0
  9. cortexcode-0.8.0/cortexcode/cli/cli_trace.py +232 -0
  10. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/javascript_sections.py +5 -5
  11. cortexcode-0.8.0/cortexcode/docs/templates.py +199 -0
  12. cortexcode-0.8.0/cortexcode/main.py +1194 -0
  13. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/html/dashboard.py +4 -1
  14. cortexcode-0.8.0/cortexcode/reports/site/viz.py +853 -0
  15. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/vuln_scan.py +75 -0
  16. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/PKG-INFO +632 -555
  17. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/SOURCES.txt +7 -0
  18. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/entry_points.txt +1 -0
  19. cortexcode-0.8.0/pyproject.toml +47 -0
  20. {cortexcode-0.6.0 → cortexcode-0.8.0}/setup.cfg +4 -4
  21. cortexcode-0.6.0/cortexcode/cli/cli_servers.py +0 -10
  22. cortexcode-0.6.0/cortexcode/docs/templates.py +0 -174
  23. cortexcode-0.6.0/cortexcode/main.py +0 -486
  24. cortexcode-0.6.0/pyproject.toml +0 -80
  25. {cortexcode-0.6.0 → cortexcode-0.8.0}/LICENSE +0 -0
  26. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/__init__.py +0 -0
  27. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/__init__.py +0 -0
  28. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis.py +0 -0
  29. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_cycles.py +0 -0
  30. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_docs.py +0 -0
  31. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_duplicates.py +0 -0
  32. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_endpoints.py +0 -0
  33. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_search.py +0 -0
  34. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis/advanced_analysis_security.py +0 -0
  35. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/advanced_analysis.py +0 -0
  36. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/__init__.py +0 -0
  37. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/config.py +0 -0
  38. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/doc_cache.py +0 -0
  39. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/doc_generator.py +0 -0
  40. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/doc_lookup.py +0 -0
  41. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/doc_models.py +0 -0
  42. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/explainer.py +0 -0
  43. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/llm_client.py +0 -0
  44. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/page_generator.py +0 -0
  45. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/prompts.py +0 -0
  46. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/ai_docs/report_runner.py +0 -0
  47. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/analysis/__init__.py +0 -0
  48. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/analysis/analysis_complexity.py +0 -0
  49. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/analysis/analysis_dead_code.py +0 -0
  50. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/analysis/analysis_impact.py +0 -0
  51. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/analysis.py +0 -0
  52. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/__init__.py +0 -0
  53. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_ai_docs.py +0 -0
  54. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_complexity.py +0 -0
  55. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_config.py +0 -0
  56. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_context.py +0 -0
  57. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_dashboard.py +0 -0
  58. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_dead_code.py +0 -0
  59. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_diagrams.py +0 -0
  60. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_diff.py +0 -0
  61. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_docs.py +0 -0
  62. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_explain.py +0 -0
  63. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_find.py +0 -0
  64. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_impact.py +0 -0
  65. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_index.py +0 -0
  66. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_report.py +0 -0
  67. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_scan.py +0 -0
  68. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_search.py +0 -0
  69. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_stats.py +0 -0
  70. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_support.py +0 -0
  71. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_watch.py +0 -0
  72. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_wiki.py +0 -0
  73. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/cli/cli_workspace.py +0 -0
  74. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/config.py +0 -0
  75. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/context/__init__.py +0 -0
  76. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/context/context_format.py +0 -0
  77. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/context/context_query.py +0 -0
  78. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/context/context_tokens.py +0 -0
  79. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/context.py +0 -0
  80. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/dashboard.py +0 -0
  81. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/__init__.py +0 -0
  82. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/architecture.py +0 -0
  83. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/call_graph.py +0 -0
  84. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/class_diagram.py +0 -0
  85. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/dependencies.py +0 -0
  86. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/directory_tree.py +0 -0
  87. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/entities.py +0 -0
  88. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/file_tree.py +0 -0
  89. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/imports.py +0 -0
  90. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/save.py +0 -0
  91. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/sequence.py +0 -0
  92. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/state.py +0 -0
  93. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/diagrams/utils.py +0 -0
  94. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/__init__.py +0 -0
  95. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/diagrams.py +0 -0
  96. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/generator.py +0 -0
  97. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/html_generators.py +0 -0
  98. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs/javascript.py +0 -0
  99. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/docs.py +0 -0
  100. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/git_diff.py +0 -0
  101. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexer.py +0 -0
  102. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/__init__.py +0 -0
  103. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/build.py +0 -0
  104. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/calls.py +0 -0
  105. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/config.py +0 -0
  106. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/defaults.py +0 -0
  107. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/dispatch.py +0 -0
  108. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/entities.py +0 -0
  109. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extensions.py +0 -0
  110. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractor_mixin.py +0 -0
  111. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/__init__.py +0 -0
  112. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/csharp.py +0 -0
  113. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/dart.py +0 -0
  114. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/generic.py +0 -0
  115. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/java.py +0 -0
  116. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/javascript.py +0 -0
  117. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/kotlin.py +0 -0
  118. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/extractors/swift.py +0 -0
  119. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/filtering.py +0 -0
  120. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/frameworks.py +0 -0
  121. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/gitignore.py +0 -0
  122. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/imports_exports.py +0 -0
  123. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/incremental.py +0 -0
  124. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/languages.py +0 -0
  125. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/metadata.py +0 -0
  126. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/nodes.py +0 -0
  127. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/output.py +0 -0
  128. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/params.py +0 -0
  129. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/parsers.py +0 -0
  130. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/pipeline.py +0 -0
  131. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/profile.py +0 -0
  132. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/resolution.py +0 -0
  133. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/routes.py +0 -0
  134. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/session.py +0 -0
  135. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/storage.py +0 -0
  136. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/indexing/walk.py +0 -0
  137. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/__init__.py +0 -0
  138. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/build.py +0 -0
  139. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/citations.py +0 -0
  140. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/concepts.py +0 -0
  141. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/models.py +0 -0
  142. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/snippets.py +0 -0
  143. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/knowledge/usage.py +0 -0
  144. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/lsp_server.py +0 -0
  145. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/__init__.py +0 -0
  146. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/mcp_protocol.py +0 -0
  147. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/mcp_registry.py +0 -0
  148. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/mcp_server.py +0 -0
  149. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/mcp_tool_handlers.py +0 -0
  150. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/mcp/mcp_transport.py +0 -0
  151. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/performance/__init__.py +0 -0
  152. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/performance/performance_config.py +0 -0
  153. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/performance/performance_index_storage.py +0 -0
  154. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/performance/performance_preview.py +0 -0
  155. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/performance.py +0 -0
  156. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/plugins.py +0 -0
  157. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/__init__.py +0 -0
  158. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/html/__init__.py +0 -0
  159. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/html/dashboard_fragments.py +0 -0
  160. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/html/view_model.py +0 -0
  161. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/__init__.py +0 -0
  162. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/api.py +0 -0
  163. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/flows.py +0 -0
  164. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/insights.py +0 -0
  165. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/readme.py +0 -0
  166. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/structure.py +0 -0
  167. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/markdown/tech.py +0 -0
  168. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/site/__init__.py +0 -0
  169. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/reports/site/generator.py +0 -0
  170. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/semantic_search.py +0 -0
  171. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/__init__.py +0 -0
  172. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/analysis.py +0 -0
  173. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/completion.py +0 -0
  174. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/headers.py +0 -0
  175. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/prompts.py +0 -0
  176. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/reports.py +0 -0
  177. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/terminal/stats.py +0 -0
  178. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/watcher.py +0 -0
  179. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode/workspace.py +0 -0
  180. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/dependency_links.txt +0 -0
  181. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/requires.txt +0 -0
  182. {cortexcode-0.6.0 → cortexcode-0.8.0}/cortexcode.egg-info/top_level.txt +0 -0
@@ -1,555 +1,632 @@
1
- Metadata-Version: 2.4
2
- Name: cortexcode
3
- Version: 0.6.0
4
- Summary: Lightweight code indexing for AI assistants — save 90%+ tokens with structured context
5
- Author-email: Naveen <naveen_joshi07@outlook.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/naveen-joshi/cortexcode
8
- Project-URL: Repository, https://github.com/naveen-joshi/cortexcode
9
- Project-URL: Documentation, https://github.com/naveen-joshi/cortexcode#readme
10
- Project-URL: Issues, https://github.com/naveen-joshi/cortexcode/issues
11
- Project-URL: Changelog, https://github.com/naveen-joshi/cortexcode/blob/main/CHANGELOG.md
12
- Project-URL: VSCodeMarketplace, https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode
13
- Keywords: code-index,ast,copilot,cursor,rag,ai-assistant,tree-sitter,code-analysis,token-savings,context-provider
14
- Classifier: Development Status :: 3 - Alpha
15
- Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: MIT License
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Topic :: Software Development :: Documentation
21
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Classifier: Topic :: Text Processing :: Indexing
23
- Requires-Python: >=3.10
24
- Description-Content-Type: text/markdown
25
- License-File: LICENSE
26
- Requires-Dist: tree-sitter>=0.21.0
27
- Requires-Dist: tree-sitter-python>=0.23.0
28
- Requires-Dist: tree-sitter-javascript>=0.23.0
29
- Requires-Dist: tree-sitter-typescript>=0.23.0
30
- Requires-Dist: tree-sitter-go>=0.23.0
31
- Requires-Dist: tree-sitter-rust>=0.23.0
32
- Requires-Dist: tree-sitter-java>=0.23.0
33
- Requires-Dist: tree-sitter-c-sharp>=0.23.0
34
- Requires-Dist: click>=8.1.0
35
- Requires-Dist: watchdog>=4.0.0
36
- Requires-Dist: rich>=13.0.0
37
- Requires-Dist: pyyaml>=6.0.0
38
- Provides-Extra: dev
39
- Requires-Dist: pytest>=8.0.0; extra == "dev"
40
- Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
41
- Requires-Dist: ruff>=0.3.0; extra == "dev"
42
- Provides-Extra: ai
43
- Requires-Dist: tiktoken>=0.7.0; extra == "ai"
44
- Requires-Dist: openai>=1.0.0; extra == "ai"
45
- Requires-Dist: anthropic>=0.18.0; extra == "ai"
46
- Requires-Dist: google-generativeai>=0.4.0; extra == "ai"
47
- Requires-Dist: requests>=2.31.0; extra == "ai"
48
- Provides-Extra: mobile
49
- Requires-Dist: tree-sitter-kotlin>=0.1.0; extra == "mobile"
50
- Requires-Dist: tree-sitter-swift>=0.6.0; extra == "mobile"
51
- Dynamic: license-file
52
-
53
- <p align="center">
54
- <h1 align="center">CortexCode</h1>
55
- <p align="center">
56
- <strong>Lightweight code indexing for AI assistants</strong><br>
57
- Save 90%+ tokens by giving AI agents structured context instead of raw source files.
58
- </p>
59
- </p>
60
-
61
- <p align="center">
62
- <a href="https://pypi.org/project/cortexcode/"><img src="https://img.shields.io/pypi/v/cortexcode?style=flat-square&color=blue" alt="PyPI"></a>
63
- <a href="https://pypi.org/project/cortexcode/"><img src="https://img.shields.io/pypi/pyversions/cortexcode?style=flat-square" alt="Python"></a>
64
- <a href="https://github.com/naveen-joshi/cortexcode/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
65
- <a href="https://github.com/naveen-joshi/cortexcode"><img src="https://img.shields.io/github/stars/naveen-joshi/cortexcode?style=flat-square" alt="Stars"></a>
66
- <a href="https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode"><img src="https://img.shields.io/visual-studio-marketplace/v/cortexcode.cortexcode-vscode?style=flat-square" alt="VS Code"></a>
67
- </p>
68
-
69
- ---
70
-
71
- ## The Problem
72
-
73
- AI coding assistants (Copilot, Cursor, Windsurf, etc.) need to understand your codebase. The current approach: **dump entire source files into the context window**. This is:
74
-
75
- - **Expensive** — A 150-file project can cost 200K+ tokens per query
76
- - **Slow** — More tokens = slower responses
77
- - **Wasteful** — Most of those tokens are irrelevant to the question
78
-
79
- ## The Solution
80
-
81
- CortexCode indexes your codebase using **AST parsing** (tree-sitter) and provides a structured, searchable index. Instead of feeding 200K tokens of raw code, you feed **~500 tokens of relevant context**.
82
-
83
- ```
84
- ┌─────────────────────────────────────────────────┐
85
- │ Without CortexCode With CortexCode │
86
- │ │
87
- │ 200,000 tokens → 500 tokens │
88
- │ $0.006/query → $0.00002/query │
89
- │ All files dumped → Only relevant syms │
90
- │ No structure → Call graph + types │
91
- └─────────────────────────────────────────────────┘
92
- ```
93
-
94
- Run `cortexcode stats` on your project to see your actual savings.
95
-
96
- ## Quick Start
97
-
98
- ```bash
99
- # Install from PyPI
100
- pip install cortexcode
101
-
102
- # Or install from source
103
- git clone https://github.com/cortexcode/cortexcode.git
104
- cd cortexcode && pip install -e .
105
-
106
- # Index your project
107
- cd your-project
108
- cortexcode index
109
-
110
- # See token savings
111
- cortexcode stats
112
-
113
- # Get context for AI
114
- cortexcode context "handleAuth"
115
-
116
- # Generate interactive docs
117
- cortexcode docs --open
118
- ```
119
-
120
- ## Features
121
-
122
- ### Multi-Language AST Indexing
123
-
124
- Parses source code into structured symbols using tree-sitter grammars.
125
-
126
- | Language | Extensions | Frameworks Detected |
127
- |----------|-----------|-------------------|
128
- | Python | `.py` | FastAPI, Django |
129
- | JavaScript | `.js`, `.jsx` | React, Express, Angular |
130
- | TypeScript | `.ts`, `.tsx` | Next.js, NestJS, Angular |
131
- | Go | `.go` | — |
132
- | Rust | `.rs` | — |
133
- | Java | `.java` | Spring Boot |
134
- | C# | `.cs` | ASP.NET |
135
-
136
- ### What Gets Indexed
137
-
138
- - **Symbols** — Functions, classes, methods with parameters and return types
139
- - **Call Graph** — Which functions call which (and who calls them)
140
- - **Imports/Exports** — Module dependencies
141
- - **API Routes** — Express, FastAPI, NestJS, Spring Boot endpoints
142
- - **Entities** — Database models and ORM definitions
143
- - **Framework Detection** — React components, Angular services, etc.
144
-
145
- ### Token Savings
146
-
147
- CortexCode dramatically reduces the tokens needed to give AI assistants useful context:
148
-
149
- ```bash
150
- $ cortexcode stats
151
-
152
- ╭──────── Token Savings Analysis ────────╮
153
- │ Source files 154 files │
154
- │ Raw project tokens 203,847 │
155
- │ Full index tokens 45,291 │
156
- │ Context query tokens 487 │
157
- │ │
158
- │ Tokens saved 203,360 │
159
- │ Savings 99.8% │
160
- │ Compression ratio 418.6x │
161
- ╰─────────────────────────────────────────╯
162
- ```
163
-
164
- ### Interactive HTML Documentation
165
-
166
- Generate a full interactive documentation site with:
167
-
168
- - **File tree** browser
169
- - **Symbol list** with filtering
170
- - **D3.js call graph** visualization (draggable nodes)
171
- - **Global search** across all symbols
172
- - **Import/Export** browser
173
- - **API route** listing
174
- - **Framework** detection summary
175
-
176
- ```bash
177
- cortexcode docs --open
178
- ```
179
-
180
- ### CodeWiki — AI-Powered Documentation Site
181
-
182
- Generate a multi-page **CodeWiki** documentation site powered by AI (Gemini, OpenAI, Anthropic, or Ollama):
183
-
184
- ```bash
185
- cortexcode wiki # Generate with default AI provider
186
- cortexcode wiki --provider google # Use Gemini
187
- cortexcode wiki --open # Generate and open in browser
188
- cortexcode wiki --no-modules # Skip per-module pages (faster)
189
- ```
190
-
191
- **Features:**
192
- - **AI-generated pages** — Overview, Architecture, Code Flows, API Reference, Concepts Guide
193
- - **Per-module docs** — Each Python/JS file gets AI-generated documentation
194
- - **Mermaid diagrams** — Auto-generated flow diagrams
195
- - **Concept mapping** — Maps technical concepts to symbols and files
196
- - **Concept search** — Ask "how does authentication work?" and get grounded answers
197
- - **Token tracking** — See exactly how many tokens each page used
198
-
199
- **Output:** `.cortexcode/wiki/index.html` — Open directly or serve locally.
200
-
201
- ### Incremental Indexing
202
-
203
- Only re-index files that changed since last run:
204
-
205
- ```bash
206
- cortexcode index -i # Skip unchanged files
207
- ```
208
-
209
- ### VS Code Extension
210
-
211
- Install from: [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode)
212
-
213
- The bundled VS Code extension provides:
214
-
215
- - **Hover tooltips** — Hover any symbol to see type, params, callers
216
- - **Go to definition** — Ctrl+Click using indexed data
217
- - **Context panel** — View symbol details in a side panel
218
- - **Status bar** — Shows indexed symbol count
219
-
220
- ```bash
221
- cd cortexcode-vscode
222
- npm install && npm run compile
223
- # Press F5 to launch in VS Code
224
- ```
225
-
226
- ## Commands
227
-
228
- | Command | Description |
229
- |---------|-------------|
230
- | `cortexcode index [path]` | Index a directory |
231
- | `cortexcode index -i` | Incremental index (changed files only) |
232
- | `cortexcode context [query]` | Get relevant context for AI |
233
- | `cortexcode context [query] --tokens` | Show token savings for query |
234
- | `cortexcode search [query]` | Grep-like symbol search with type/file filters |
235
- | `cortexcode find [query]` | Semantic search by meaning ("auth handler") |
236
- | `cortexcode diff` | Show changed symbols since last commit |
237
- | `cortexcode diff --ref HEAD~3` | Compare against any git ref |
238
- | `cortexcode stats` | Show project stats and token savings |
239
- | `cortexcode scan` | Scan dependencies for security warnings |
240
- | `cortexcode docs --open` | Generate and open interactive docs |
241
- | `cortexcode dead-code` | Detect potentially unused symbols |
242
- | `cortexcode complexity` | Analyze code complexity (cyclomatic, nesting, line count) |
243
- | `cortexcode complexity --min-score 50` | Show only high-complexity functions |
244
- | `cortexcode impact <symbol>` | Change impact analysis — what breaks if you modify a symbol |
245
- | `cortexcode dashboard` | Launch live dashboard with auto-refresh on index changes |
246
- | `cortexcode workspace init` | Initialize a multi-repo workspace |
247
- | `cortexcode workspace add <path>` | Add a repo to the workspace |
248
- | `cortexcode workspace list` | List repos in workspace |
249
- | `cortexcode workspace index` | Index all workspace repos |
250
- | `cortexcode workspace search <q>` | Search symbols across all repos |
251
- | `cortexcode watch` | Auto-reindex on file changes |
252
- | `cortexcode mcp` | Start MCP server for AI agent integration |
253
- | `cortexcode lsp` | Start Language Server Protocol server |
254
- | `cortexcode wiki` | Generate CodeWiki documentation site with AI |
255
- | `cortexcode ask` | Ask a natural language question about the codebase |
256
-
257
- ## How AI Agents Use This
258
-
259
- ### Windsurf / Cursor Configuration
260
-
261
- To make AI agents in Windsurf or Cursor automatically use CortexCode:
262
-
263
- **Option 1: Auto-detect prompt file**
264
-
265
- Create `.cortexcode/prompt.md` in your project root. AI agents will automatically read this file and use the CortexCode index for code understanding.
266
-
267
- **Option 2: Add to agent rules**
268
-
269
- Add to your project's `.windsurf/rules.md` or Cursor rules:
270
-
271
- ```
272
- Always use CortexCode index (.cortexcode/index.json) to understand the codebase before making changes. Use:
273
- - cortexcode search <symbol> to find symbols
274
- - cortexcode impact <symbol> to see what uses a function
275
- - cortexcode context <query> to get relevant code context
276
-
277
- Run 'cortexcode index' first if the index doesn't exist.
278
- ```
279
-
280
- **Option 3: Configure MCP in Windsurf**
281
-
282
- Add to `~/.windsurf/config.json`:
283
-
284
- ```json
285
- {
286
- "mcpServers": {
287
- "cortexcode": {
288
- "command": "cortexcode",
289
- "args": ["mcp"]
290
- }
291
- }
292
- }
293
- ```
294
-
295
- ### 1. Context Command (simplest)
296
-
297
- ```bash
298
- # Paste this output into your AI chat
299
- cortexcode context "useAuth" --tokens
300
- ```
301
-
302
- ### 2. JSON Index (programmatic)
303
-
304
- ```python
305
- import json
306
-
307
- index = json.load(open('.cortexcode/index.json'))
308
-
309
- # Get all functions
310
- for path, data in index['files'].items():
311
- for sym in data['symbols']:
312
- print(f"{sym['type']}: {sym['name']} in {path}:{sym['line']}")
313
-
314
- # Trace call graph
315
- for caller, callees in index['call_graph'].items():
316
- for callee in callees:
317
- print(f"{caller} -> {callee}")
318
- ```
319
-
320
- ### 3. MCP Server
321
-
322
- AI agents can query the index directly via the Model Context Protocol:
323
-
324
- ```bash
325
- # Start the MCP server (stdin/stdout)
326
- cortexcode mcp
327
- ```
328
-
329
- **Configuration Examples:**
330
-
331
- ```json
332
- // Claude Desktop (claude_desktop_config.json)
333
- {
334
- "mcpServers": {
335
- "cortexcode": {
336
- "command": "cortexcode",
337
- "args": ["mcp"]
338
- }
339
- }
340
- }
341
-
342
- // Cursor / Windsurf
343
- {
344
- "mcpServers": {
345
- "cortexcode": {
346
- "command": "cortexcode",
347
- "args": ["mcp"]
348
- }
349
- }
350
- }
351
-
352
- // Open WebUI / AnythingLLM
353
- {
354
- "mcpServers": {
355
- "cortexcode": {
356
- "command": "cortexcode",
357
- "args": ["mcp"]
358
- }
359
- }
360
- }
361
- ```
362
-
363
- Available MCP tools (17 tools):
364
-
365
- **Search & Navigation:**
366
- - **`cortexcode_search`** — Search symbols by name
367
- - **`cortexcode_fuzzy_search`** — Fuzzy/approximate search (handles typos)
368
- - **`cortexcode_regex_search`** Regex pattern search (e.g. `^get.*`)
369
- - **`cortexcode_context`** Get rich context with callers/callees
370
- - **`cortexcode_file_symbols`** List all symbols in a file
371
- - **`cortexcode_call_graph`** Trace call graph for a symbol
372
-
373
- **Analysis:**
374
- - **`cortexcode_deadcode`** Find potentially unused symbols
375
- - **`cortexcode_complexity`** Find most complex functions
376
- - **`cortexcode_impact`** — Analyze change impact of a symbol
377
- - **`cortexcode_duplicates`** — Detect duplicate/copy-paste code
378
- - **`cortexcode_circular_deps`** — Find circular dependencies
379
-
380
- **Security & Quality:**
381
- - **`cortexcode_security_scan`** Scan for hardcoded secrets, SQL injection, XSS
382
- - **`cortexcode_endpoints`** — Extract API endpoints (Express, Flask, Django, Next.js, etc.)
383
- - **`cortexcode_api_docs`** — Auto-generate API docs from signatures
384
-
385
- **Project Info:**
386
- - **`cortexcode_stats`** — Get project statistics
387
- - **`cortexcode_diff`** — Get changed symbols since last commit
388
- - **`cortexcode_file_deps`** — Get file dependency graph
389
-
390
- ### 4. LSP Server
391
-
392
- Any LSP-compatible editor can use CortexCode for hover, go-to-definition, and document symbols:
393
-
394
- ```bash
395
- cortexcode lsp
396
- ```
397
-
398
- ### 5. Git Diff Context
399
-
400
- See only what changed — perfect for code review:
401
-
402
- ```bash
403
- # What symbols changed since last commit?
404
- cortexcode diff
405
-
406
- # Compare against a branch
407
- cortexcode diff --ref main
408
- ```
409
-
410
- ### 6. Copilot Chat (`@cortexcode`)
411
-
412
- In VS Code with the CortexCode extension, use `@cortexcode` in Copilot Chat:
413
-
414
- ```
415
- @cortexcode search handleAuth
416
- @cortexcode /context authentication
417
- @cortexcode /impact createUser
418
- @cortexcode /deadcode
419
- @cortexcode /complexity
420
- ```
421
-
422
- Commands:
423
- - **`/search`** — Find symbols by name
424
- - **`/context`** — Get ranked context for a query (relevance + call graph connectivity)
425
- - **`/impact`** — Change impact analysis (direct/indirect callers, affected files/tests)
426
- - **`/deadcode`** — List potentially unused symbols
427
- - **`/complexity`** — Show most complex functions by params + outgoing calls
428
-
429
- ### 7. Semantic Search
430
-
431
- Find symbols by meaning, not just name:
432
-
433
- ```bash
434
- cortexcode find "authentication handler"
435
- cortexcode find "database models"
436
- cortexcode find "user login flow"
437
- ```
438
-
439
- ### 8. Code Analysis
440
-
441
- ```bash
442
- # Find unused symbols
443
- cortexcode dead-code
444
-
445
- # Show top 10 most complex functions
446
- cortexcode complexity --top 10
447
-
448
- # What breaks if I change createUser?
449
- cortexcode impact createUser
450
- ```
451
-
452
- ## Index Format
453
-
454
- The index is stored at `.cortexcode/index.json`:
455
-
456
- ```json
457
- {
458
- "project_root": "/path/to/project",
459
- "last_indexed": "2024-03-01T12:00:00",
460
- "languages": ["javascript", "typescript", "python"],
461
- "files": {
462
- "src/auth.ts": {
463
- "symbols": [
464
- {
465
- "name": "AuthService",
466
- "type": "class",
467
- "line": 10,
468
- "params": [],
469
- "calls": ["validateToken", "hashPassword"]
470
- }
471
- ],
472
- "imports": [{ "module": "bcrypt", "imported": ["hash", "compare"] }],
473
- "exports": [{ "name": "AuthService", "type": "class" }],
474
- "api_routes": [{ "method": "POST", "path": "/auth/login" }]
475
- }
476
- },
477
- "call_graph": {
478
- "AuthService": ["validateToken", "hashPassword"],
479
- "validateToken": ["jwt.verify"]
480
- }
481
- }
482
- ```
483
-
484
- ## Configuration
485
-
486
- CortexCode respects `.gitignore` files (including nested ones) and has built-in ignore patterns for:
487
-
488
- - `node_modules/`, `__pycache__/`, `.git/`
489
- - Build directories (`dist/`, `build/`, `.next/`)
490
- - IDE files (`.idea/`, `.vscode/`)
491
- - Package manager files (`vendor/`, `.venv/`)
492
-
493
- ## Roadmap
494
-
495
- - [x] MCP server for direct AI agent integration
496
- - [x] Tiktoken-based accurate token counting
497
- - [x] Semantic search over symbols (TF-IDF + synonym expansion)
498
- - [x] Cross-file type inference
499
- - [x] Git diff-aware context (show only changed symbols)
500
- - [x] Language server protocol (LSP) support
501
- - [x] Dependency vulnerability scanning
502
- - [x] CI/CD integration (GitHub Action)
503
- - [x] Multi-repo workspace support
504
- - [x] Custom plugin system for framework-specific extractors
505
- - [x] Web dashboard for index visualization
506
- - [x] Flutter/Dart language support (regex-based)
507
- - [x] React Native / Expo framework detection
508
- - [x] Native Android (Kotlin/Java) framework detection
509
- - [x] Native iOS (Swift/SwiftUI/UIKit) framework detection
510
- - [x] Django / Flask framework detection
511
- - [x] VS Code Marketplace publishing
512
-
513
- ### Future Improvements
514
-
515
- #### Features
516
- - [ ] More language support (Ruby, PHP, C++)
517
- - [ ] Cloud index for team sharing
518
- - [ ] Graph visualization for call chains
519
- - [ ] Auto-indexing on git push
520
- - [ ] Index versioning (compare across commits)
521
- - [ ] Config file (`.cortexcode.yaml`) for project settings
522
-
523
- #### Integrations
524
- - [ ] JetBrains IDEs plugin (IntelliJ, PyCharm)
525
- - [ ] GitHub Copilot native integration
526
- - [ ] Claude Code integration
527
-
528
- #### AI/Search
529
- - [ ] Semantic embeddings for meaning-based search
530
- - [ ] AI-powered code review
531
- - [ ] Bug detection (pattern matching)
532
-
533
- #### Performance
534
- - [ ] Compressed index format
535
- - [ ] Faster search with caching
536
- - [ ] Parallel multi-threaded indexing
537
-
538
- ## Contributing
539
-
540
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
541
-
542
- ```bash
543
- # Development install
544
- pip install -e ".[dev]"
545
-
546
- # Run tests
547
- pytest
548
-
549
- # Lint
550
- ruff check cortexcode/
551
- ```
552
-
553
- ## License
554
-
555
- MIT See [LICENSE](LICENSE)
1
+ Metadata-Version: 2.4
2
+ Name: cortexcode
3
+ Version: 0.8.0
4
+ Summary: Lightweight code indexing for AI assistants — save 90%+ tokens with structured context
5
+ Author-email: Naveen <naveen_joshi07@outlook.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/naveen-joshi/cortexcode
8
+ Project-URL: Repository, https://github.com/naveen-joshi/cortexcode
9
+ Project-URL: Documentation, https://github.com/naveen-joshi/cortexcode#readme
10
+ Project-URL: Issues, https://github.com/naveen-joshi/cortexcode/issues
11
+ Project-URL: Changelog, https://github.com/naveen-joshi/cortexcode/blob/main/CHANGELOG.md
12
+ Project-URL: VSCodeMarketplace, https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode
13
+ Keywords: code-index,ast,copilot,cursor,rag,ai-assistant,tree-sitter,code-analysis,token-savings,context-provider
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Documentation
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Text Processing :: Indexing
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: tree-sitter>=0.21.0
27
+ Requires-Dist: tree-sitter-python>=0.23.0
28
+ Requires-Dist: tree-sitter-javascript>=0.23.0
29
+ Requires-Dist: tree-sitter-typescript>=0.23.0
30
+ Requires-Dist: tree-sitter-go>=0.23.0
31
+ Requires-Dist: tree-sitter-rust>=0.23.0
32
+ Requires-Dist: tree-sitter-java>=0.23.0
33
+ Requires-Dist: tree-sitter-c-sharp>=0.23.0
34
+ Requires-Dist: click>=8.1.0
35
+ Requires-Dist: watchdog>=4.0.0
36
+ Requires-Dist: rich>=13.0.0
37
+ Requires-Dist: pyyaml>=6.0.0
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
40
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
41
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
42
+ Provides-Extra: ai
43
+ Requires-Dist: tiktoken>=0.7.0; extra == "ai"
44
+ Requires-Dist: openai>=1.0.0; extra == "ai"
45
+ Requires-Dist: anthropic>=0.18.0; extra == "ai"
46
+ Requires-Dist: google-generativeai>=0.4.0; extra == "ai"
47
+ Requires-Dist: requests>=2.31.0; extra == "ai"
48
+ Provides-Extra: mobile
49
+ Requires-Dist: tree-sitter-kotlin>=0.1.0; extra == "mobile"
50
+ Requires-Dist: tree-sitter-swift>=0.6.0; extra == "mobile"
51
+ Dynamic: license-file
52
+
53
+ <p align="center">
54
+ <h1 align="center">CortexCode</h1>
55
+ <p align="center">
56
+ <strong>Lightweight code indexing for AI assistants</strong><br>
57
+ Save 90%+ tokens by giving AI agents structured context instead of raw source files.
58
+ </p>
59
+ </p>
60
+
61
+ <p align="center">
62
+ <a href="https://pypi.org/project/cortexcode/"><img src="https://img.shields.io/pypi/v/cortexcode?style=flat-square&color=blue" alt="PyPI"></a>
63
+ <a href="https://pypi.org/project/cortexcode/"><img src="https://img.shields.io/pypi/pyversions/cortexcode?style=flat-square" alt="Python"></a>
64
+ <a href="https://github.com/naveen-joshi/cortexcode/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
65
+ <a href="https://github.com/naveen-joshi/cortexcode"><img src="https://img.shields.io/github/stars/naveen-joshi/cortexcode?style=flat-square" alt="Stars"></a>
66
+ <a href="https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode"><img src="https://img.shields.io/visual-studio-marketplace/v/cortexcode.cortexcode-vscode?style=flat-square" alt="VS Code"></a>
67
+ </p>
68
+
69
+ ---
70
+
71
+ ## The Problem
72
+
73
+ AI coding assistants (Copilot, Cursor, Windsurf, etc.) need to understand your codebase. The current approach: **dump entire source files into the context window**. This is:
74
+
75
+ - **Expensive** — A 150-file project can cost 200K+ tokens per query
76
+ - **Slow** — More tokens = slower responses
77
+ - **Wasteful** — Most of those tokens are irrelevant to the question
78
+
79
+ ## The Solution
80
+
81
+ CortexCode indexes your codebase using **AST parsing** (tree-sitter) and provides a structured, searchable index. Instead of feeding 200K tokens of raw code, you feed **~500 tokens of relevant context**.
82
+
83
+ ```
84
+ ┌─────────────────────────────────────────────────┐
85
+ │ Without CortexCode With CortexCode │
86
+ │ │
87
+ │ 200,000 tokens → 500 tokens │
88
+ │ $0.006/query → $0.00002/query │
89
+ │ All files dumped → Only relevant syms │
90
+ │ No structure → Call graph + types │
91
+ └─────────────────────────────────────────────────┘
92
+ ```
93
+
94
+ Run `cortexcode stats` on your project to see your actual savings.
95
+
96
+ ## Quick Start
97
+
98
+ ```bash
99
+ # Install from PyPI
100
+ pip install cortexcode
101
+
102
+ # Or install from source
103
+ git clone https://github.com/cortexcode/cortexcode.git
104
+ cd cortexcode && pip install -e .
105
+
106
+ # Index your project
107
+ cd your-project
108
+ cortexcode index
109
+
110
+ # See token savings
111
+ cortexcode stats
112
+
113
+ # Get context for AI
114
+ cortexcode context "handleAuth"
115
+
116
+ # Generate interactive docs
117
+ cortexcode docs --open
118
+ ```
119
+
120
+ ## Features
121
+
122
+ ### Multi-Language AST Indexing
123
+
124
+ Parses source code into structured symbols using tree-sitter grammars.
125
+
126
+ | Language | Extensions | Frameworks Detected |
127
+ |----------|-----------|-------------------|
128
+ | Python | `.py` | FastAPI, Django |
129
+ | JavaScript | `.js`, `.jsx` | React, Express, Angular |
130
+ | TypeScript | `.ts`, `.tsx` | Next.js, NestJS, Angular |
131
+ | Go | `.go` | — |
132
+ | Rust | `.rs` | — |
133
+ | Java | `.java` | Spring Boot |
134
+ | C# | `.cs` | ASP.NET |
135
+
136
+ ### What Gets Indexed
137
+
138
+ - **Symbols** — Functions, classes, methods with parameters and return types
139
+ - **Call Graph** — Which functions call which (and who calls them)
140
+ - **Imports/Exports** — Module dependencies
141
+ - **API Routes** — Express, FastAPI, NestJS, Spring Boot endpoints
142
+ - **Entities** — Database models and ORM definitions
143
+ - **Framework Detection** — React components, Angular services, etc.
144
+
145
+ ### Token Savings
146
+
147
+ CortexCode dramatically reduces the tokens needed to give AI assistants useful context:
148
+
149
+ ```bash
150
+ $ cortexcode stats
151
+
152
+ ╭──────── Token Savings Analysis ────────╮
153
+ │ Source files 154 files │
154
+ │ Raw project tokens 203,847 │
155
+ │ Full index tokens 45,291 │
156
+ │ Context query tokens 487 │
157
+ │ │
158
+ │ Tokens saved 203,360 │
159
+ │ Savings 99.8% │
160
+ │ Compression ratio 418.6x │
161
+ ╰─────────────────────────────────────────╯
162
+ ```
163
+
164
+ ### Interactive HTML Documentation
165
+
166
+ Generate a full interactive documentation site with:
167
+
168
+ - **File tree** browser
169
+ - **Symbol list** with filtering
170
+ - **D3.js call graph** visualization (draggable nodes)
171
+ - **Global search** across all symbols
172
+ - **Import/Export** browser
173
+ - **API route** listing
174
+ - **Framework** detection summary
175
+
176
+ ```bash
177
+ cortexcode docs --open
178
+ ```
179
+
180
+ ### CodeWiki — AI-Powered Documentation Site
181
+
182
+ Generate a multi-page **CodeWiki** documentation site powered by AI (Gemini, OpenAI, Anthropic, or Ollama):
183
+
184
+ ```bash
185
+ cortexcode wiki # Generate with default AI provider
186
+ cortexcode wiki --provider google # Use Gemini
187
+ cortexcode wiki --open # Generate and open in browser
188
+ cortexcode wiki --no-modules # Skip per-module pages (faster)
189
+ ```
190
+
191
+ **Features:**
192
+ - **AI-generated pages** — Overview, Architecture, Code Flows, API Reference, Concepts Guide
193
+ - **Per-module docs** — Each Python/JS file gets AI-generated documentation
194
+ - **Mermaid diagrams** — Auto-generated flow diagrams
195
+ - **Concept mapping** — Maps technical concepts to symbols and files
196
+ - **Concept search** — Ask "how does authentication work?" and get grounded answers
197
+ - **Token tracking** — See exactly how many tokens each page used
198
+
199
+ **Output:** `.cortexcode/wiki/index.html` — Open directly or serve locally.
200
+
201
+ ### Incremental Indexing
202
+
203
+ Only re-index files that changed since last run:
204
+
205
+ ```bash
206
+ cortexcode index -i # Skip unchanged files
207
+ ```
208
+
209
+ ### VS Code Extension
210
+
211
+ Install from: [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=cortexcode.cortexcode-vscode)
212
+
213
+ The bundled VS Code extension provides:
214
+
215
+ - **Hover tooltips** — Hover any symbol to see type, params, callers
216
+ - **Go to definition** — Ctrl+Click using indexed data
217
+ - **Context panel** — View symbol details in a side panel
218
+ - **Status bar** — Shows indexed symbol count
219
+
220
+ ```bash
221
+ cd cortexcode-vscode
222
+ npm install && npm run compile
223
+ # Press F5 to launch in VS Code
224
+ ```
225
+
226
+ ## Commands
227
+
228
+ CortexCode supports both a short form (`cc`) and full form (`cortexcode`). Commands are organized into logical groups.
229
+
230
+ ### Core Commands
231
+
232
+ | Command | Description |
233
+ |---------|-------------|
234
+ | `cc index [path]` | Index a directory |
235
+ | `cc index -i` | Incremental index (changed files only) |
236
+ | `cc config` | Manage CortexCode configuration |
237
+ | `cc workspace init` | Initialize a multi-repo workspace |
238
+ | `cc workspace add <path>` | Add a repo to the workspace |
239
+ | `cc workspace list` | List repos in workspace |
240
+ | `cc workspace index` | Index all workspace repos |
241
+ | `cc workspace search <q>` | Search symbols across all repos |
242
+
243
+ ### Analyze Code Exploration & Analysis
244
+
245
+ | Command | Description |
246
+ |---------|-------------|
247
+ | `cc analyze context [query]` | Get relevant context for AI |
248
+ | `cc analyze context [query] --tokens` | Show token savings for query |
249
+ | `cc analyze search [query]` | Grep-like symbol search with type/file filters |
250
+ | `cc analyze find [query]` | Semantic search by meaning ("auth handler") |
251
+ | `cc analyze diff` | Show changed symbols since last commit |
252
+ | `cc analyze diff --ref HEAD~3` | Compare against any git ref |
253
+ | `cc analyze stats` | Show project stats and token savings |
254
+ | `cc analyze scan` | Scan dependencies for security warnings |
255
+ | `cc analyze trace <symbol>` | Trace code flow through call graph |
256
+ | `cc analyze flow <concept>` | Analyze code flow grouped by file |
257
+ | `cc analyze dead-code` | Detect potentially unused symbols |
258
+ | `cc analyze complexity` | Analyze code complexity (cyclomatic, nesting, line count) |
259
+ | `cc analyze complexity --min-score 50` | Show only high-complexity functions |
260
+ | `cc analyze impact <symbol>` | Change impact analysis — what breaks if you modify a symbol |
261
+ | `cc analyze explain <symbol>` | Explain a symbol using AI |
262
+
263
+ ### Generate Documentation & Visualization
264
+
265
+ | Command | Description |
266
+ |---------|-------------|
267
+ | `cc generate docs --open` | Generate and open interactive docs |
268
+ | `cc generate diagrams` | Generate Mermaid diagrams |
269
+ | `cc generate diagrams --viz` | Interactive D3.js visualization |
270
+ | `cc generate report` | Show interactive project report in terminal |
271
+ | `cc generate ai-docs` | Generate AI-powered documentation |
272
+ | `cc generate wiki` | Generate CodeWiki documentation site with AI |
273
+
274
+ ### AI Natural Language Code Understanding
275
+
276
+ | Command | Description |
277
+ |---------|-------------|
278
+ | `cc ai ask "question"` | Ask a natural language question about the codebase |
279
+ | `cc ai explain <symbol>` | Explain a symbol using AI |
280
+ | `cc ai docs` | Generate AI-powered documentation |
281
+ | `cc ai wiki` | Generate CodeWiki documentation site with AI |
282
+
283
+ ### Serve — Long-Running Services
284
+
285
+ | Command | Description |
286
+ |---------|-------------|
287
+ | `cc serve watch` | Auto-reindex on file changes |
288
+ | `cc serve dashboard` | Launch live dashboard with auto-refresh |
289
+ | `cc serve lsp` | Start Language Server Protocol server |
290
+
291
+ ### Integration & Automation
292
+
293
+ | Command | Description |
294
+ |---------|-------------|
295
+ | `cc mcp start` | Start MCP server for AI agent integration |
296
+ | `cc mcp setup` | Configure MCP for IDEs (auto-detect) |
297
+ | `cc githook install` | Install git hook for auto-indexing |
298
+ | `cc githook precommit` | Install pre-commit hook for security scanning |
299
+ | `cc bundle export` | Export index as shareable `.ccb` bundle |
300
+ | `cc bundle import <file>` | Import a `.ccb` bundle |
301
+ | `cc bundle info <file>` | Show bundle info without importing |
302
+ | `cc package index <name>` | Index an external package (pip, npm) |
303
+ | `cc jobs list` | List background jobs |
304
+ | `cc completion install` | Install shell completion |
305
+
306
+ ### Shortcuts (Legacy)
307
+
308
+ These commands still work but show a tip to use the grouped form:
309
+
310
+ ```bash
311
+ cc trace <symbol> # Tip: use cc analyze trace
312
+ cc wiki # Tip: use cc ai wiki
313
+ cc ask "question" # Tip: use cc ai ask
314
+ ```
315
+
316
+ ## How AI Agents Use This
317
+
318
+ ### Windsurf / Cursor Configuration
319
+
320
+ To make AI agents in Windsurf or Cursor automatically use CortexCode:
321
+
322
+ **Option 1: Auto-detect prompt file**
323
+
324
+ Create `.cortexcode/prompt.md` in your project root. AI agents will automatically read this file and use the CortexCode index for code understanding.
325
+
326
+ **Option 2: Add to agent rules**
327
+
328
+ Add to your project's `.windsurf/rules.md` or Cursor rules:
329
+
330
+ ```
331
+ Always use CortexCode index (.cortexcode/index.json) to understand the codebase before making changes. Use:
332
+ - cortexcode search <symbol> to find symbols
333
+ - cortexcode impact <symbol> to see what uses a function
334
+ - cortexcode context <query> to get relevant code context
335
+
336
+ Run 'cortexcode index' first if the index doesn't exist.
337
+ ```
338
+
339
+ **Option 3: Configure MCP in Windsurf**
340
+
341
+ Add to `~/.windsurf/config.json`:
342
+
343
+ ```json
344
+ {
345
+ "mcpServers": {
346
+ "cortexcode": {
347
+ "command": "cortexcode",
348
+ "args": ["mcp"]
349
+ }
350
+ }
351
+ }
352
+ ```
353
+
354
+ ### 1. Context Command (simplest)
355
+
356
+ ```bash
357
+ # Paste this output into your AI chat
358
+ cortexcode context "useAuth" --tokens
359
+ ```
360
+
361
+ ### 2. JSON Index (programmatic)
362
+
363
+ ```python
364
+ import json
365
+
366
+ index = json.load(open('.cortexcode/index.json'))
367
+
368
+ # Get all functions
369
+ for path, data in index['files'].items():
370
+ for sym in data['symbols']:
371
+ print(f"{sym['type']}: {sym['name']} in {path}:{sym['line']}")
372
+
373
+ # Trace call graph
374
+ for caller, callees in index['call_graph'].items():
375
+ for callee in callees:
376
+ print(f"{caller} -> {callee}")
377
+ ```
378
+
379
+ ### 3. MCP Server
380
+
381
+ AI agents can query the index directly via the Model Context Protocol:
382
+
383
+ ```bash
384
+ # Start the MCP server (stdin/stdout)
385
+ cortexcode mcp
386
+ ```
387
+
388
+ **Configuration Examples:**
389
+
390
+ ```json
391
+ // Claude Desktop (claude_desktop_config.json)
392
+ {
393
+ "mcpServers": {
394
+ "cortexcode": {
395
+ "command": "cortexcode",
396
+ "args": ["mcp"]
397
+ }
398
+ }
399
+ }
400
+
401
+ // Cursor / Windsurf
402
+ {
403
+ "mcpServers": {
404
+ "cortexcode": {
405
+ "command": "cortexcode",
406
+ "args": ["mcp"]
407
+ }
408
+ }
409
+ }
410
+
411
+ // Open WebUI / AnythingLLM
412
+ {
413
+ "mcpServers": {
414
+ "cortexcode": {
415
+ "command": "cortexcode",
416
+ "args": ["mcp"]
417
+ }
418
+ }
419
+ }
420
+ ```
421
+
422
+ Available MCP tools (17 tools):
423
+
424
+ **Search & Navigation:**
425
+ - **`cortexcode_search`** — Search symbols by name
426
+ - **`cortexcode_fuzzy_search`** — Fuzzy/approximate search (handles typos)
427
+ - **`cortexcode_regex_search`** — Regex pattern search (e.g. `^get.*`)
428
+ - **`cortexcode_context`** — Get rich context with callers/callees
429
+ - **`cortexcode_file_symbols`** List all symbols in a file
430
+ - **`cortexcode_call_graph`** — Trace call graph for a symbol
431
+
432
+ **Analysis:**
433
+ - **`cortexcode_deadcode`** — Find potentially unused symbols
434
+ - **`cortexcode_complexity`** Find most complex functions
435
+ - **`cortexcode_impact`** Analyze change impact of a symbol
436
+ - **`cortexcode_duplicates`** Detect duplicate/copy-paste code
437
+ - **`cortexcode_circular_deps`** — Find circular dependencies
438
+
439
+ **Security & Quality:**
440
+ - **`cortexcode_security_scan`** — Scan for hardcoded secrets, SQL injection, XSS
441
+ - **`cortexcode_endpoints`** — Extract API endpoints (Express, Flask, Django, Next.js, etc.)
442
+ - **`cortexcode_api_docs`** Auto-generate API docs from signatures
443
+
444
+ **Project Info:**
445
+ - **`cortexcode_stats`** Get project statistics
446
+ - **`cortexcode_diff`** Get changed symbols since last commit
447
+ - **`cortexcode_file_deps`** — Get file dependency graph
448
+
449
+ ### 4. LSP Server
450
+
451
+ Any LSP-compatible editor can use CortexCode for hover, go-to-definition, and document symbols:
452
+
453
+ ```bash
454
+ cortexcode lsp
455
+ ```
456
+
457
+ ### 5. Git Diff Context
458
+
459
+ See only what changed — perfect for code review:
460
+
461
+ ```bash
462
+ # What symbols changed since last commit?
463
+ cortexcode diff
464
+
465
+ # Compare against a branch
466
+ cortexcode diff --ref main
467
+ ```
468
+
469
+ ### 6. Copilot Chat (`@cortexcode`)
470
+
471
+ In VS Code with the CortexCode extension, use `@cortexcode` in Copilot Chat:
472
+
473
+ ```
474
+ @cortexcode search handleAuth
475
+ @cortexcode /context authentication
476
+ @cortexcode /impact createUser
477
+ @cortexcode /deadcode
478
+ @cortexcode /complexity
479
+ ```
480
+
481
+ Commands:
482
+ - **`/search`** — Find symbols by name
483
+ - **`/context`** — Get ranked context for a query (relevance + call graph connectivity)
484
+ - **`/impact`** — Change impact analysis (direct/indirect callers, affected files/tests)
485
+ - **`/deadcode`** — List potentially unused symbols
486
+ - **`/complexity`** Show most complex functions by params + outgoing calls
487
+
488
+ ### 7. Semantic Search
489
+
490
+ Find symbols by meaning, not just name:
491
+
492
+ ```bash
493
+ cortexcode find "authentication handler"
494
+ cortexcode find "database models"
495
+ cortexcode find "user login flow"
496
+ ```
497
+
498
+ ### 8. Code Analysis
499
+
500
+ ```bash
501
+ # Find unused symbols
502
+ cortexcode dead-code
503
+
504
+ # Show top 10 most complex functions
505
+ cortexcode complexity --top 10
506
+
507
+ # What breaks if I change createUser?
508
+ cortexcode impact createUser
509
+ ```
510
+
511
+ ## Index Format
512
+
513
+ The index is stored at `.cortexcode/index.json`:
514
+
515
+ ```json
516
+ {
517
+ "project_root": "/path/to/project",
518
+ "last_indexed": "2024-03-01T12:00:00",
519
+ "languages": ["javascript", "typescript", "python"],
520
+ "files": {
521
+ "src/auth.ts": {
522
+ "symbols": [
523
+ {
524
+ "name": "AuthService",
525
+ "type": "class",
526
+ "line": 10,
527
+ "params": [],
528
+ "calls": ["validateToken", "hashPassword"]
529
+ }
530
+ ],
531
+ "imports": [{ "module": "bcrypt", "imported": ["hash", "compare"] }],
532
+ "exports": [{ "name": "AuthService", "type": "class" }],
533
+ "api_routes": [{ "method": "POST", "path": "/auth/login" }]
534
+ }
535
+ },
536
+ "call_graph": {
537
+ "AuthService": ["validateToken", "hashPassword"],
538
+ "validateToken": ["jwt.verify"]
539
+ }
540
+ }
541
+ ```
542
+
543
+ ## Configuration
544
+
545
+ CortexCode respects `.gitignore` files (including nested ones) and has built-in ignore patterns for:
546
+
547
+ - `node_modules/`, `__pycache__/`, `.git/`
548
+ - Build directories (`dist/`, `build/`, `.next/`)
549
+ - IDE files (`.idea/`, `.vscode/`)
550
+ - Package manager files (`vendor/`, `.venv/`)
551
+
552
+ ## Roadmap
553
+
554
+ - [x] MCP server for direct AI agent integration
555
+ - [x] Tiktoken-based accurate token counting
556
+ - [x] Semantic search over symbols (TF-IDF + synonym expansion)
557
+ - [x] Cross-file type inference
558
+ - [x] Git diff-aware context (show only changed symbols)
559
+ - [x] Language server protocol (LSP) support
560
+ - [x] Dependency vulnerability scanning
561
+ - [x] CI/CD integration (GitHub Action)
562
+ - [x] Multi-repo workspace support
563
+ - [x] Custom plugin system for framework-specific extractors
564
+ - [x] Web dashboard for index visualization
565
+ - [x] Flutter/Dart language support (regex-based)
566
+ - [x] React Native / Expo framework detection
567
+ - [x] Native Android (Kotlin/Java) framework detection
568
+ - [x] Native iOS (Swift/SwiftUI/UIKit) framework detection
569
+ - [x] Django / Flask framework detection
570
+ - [x] VS Code Marketplace publishing
571
+ - [x] Interactive graph visualization (`cc generate diagrams --viz`)
572
+ - [x] MCP setup wizard (`cc mcp setup`)
573
+ - [x] Pre-indexed bundles (`.ccb` files)
574
+ - [x] Package indexing (`cc package index`)
575
+ - [x] Background job tracking (`cc jobs`)
576
+ - [x] AI-powered CodeWiki documentation site
577
+ - [x] Natural language code Q&A (`cc ai ask`)
578
+ - [x] Flow tracing & concept analysis (`cc analyze trace`, `cc analyze flow`)
579
+ - [x] Git hook integration (auto-index, pre-commit security scan)
580
+ - [x] Shell completion (bash, zsh, fish, PowerShell)
581
+ - [x] Short CLI alias (`cc`)
582
+ - [x] Grouped CLI commands (`analyze`, `generate`, `serve`, `ai`)
583
+ - [x] Config file (`.cortexcode.yaml`) for project settings
584
+ - [x] Bug detection (pattern matching for security, quality, performance)
585
+ - [x] Project website (Astro + Tailwind, Vercel)
586
+ - [x] Cookbook with practical recipes
587
+
588
+ ### Future Improvements
589
+
590
+ #### Features
591
+ - [ ] More language support (Ruby, PHP, C++)
592
+ - [ ] Cloud index for team sharing
593
+ - [ ] Index versioning (compare across commits)
594
+ - [ ] Codebase chatbot (conversational Q&A over index)
595
+
596
+ #### Integrations
597
+ - [ ] JetBrains IDEs plugin (IntelliJ, PyCharm)
598
+ - [ ] GitHub Copilot native integration
599
+ - [ ] Claude Code integration
600
+
601
+ #### AI/Search
602
+ - [ ] Semantic embeddings for meaning-based search
603
+ - [ ] AI-powered code review
604
+ - [ ] AI-suggested refactoring
605
+
606
+ #### Performance
607
+ - [ ] Compressed index format
608
+ - [ ] Faster search with caching
609
+ - [ ] Parallel multi-threaded indexing
610
+
611
+ ## Cookbook
612
+
613
+ See [COOKBOOK.md](COOKBOOK.md) for practical recipes — from first-time setup to CI/CD integration, team collaboration, and advanced workflows.
614
+
615
+ ## Contributing
616
+
617
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
618
+
619
+ ```bash
620
+ # Development install
621
+ pip install -e ".[dev]"
622
+
623
+ # Run tests
624
+ pytest
625
+
626
+ # Lint
627
+ ruff check cortexcode/
628
+ ```
629
+
630
+ ## License
631
+
632
+ MIT — See [LICENSE](LICENSE)