codebrain 0.3.1__tar.gz → 0.3.2__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 (168) hide show
  1. {codebrain-0.3.1 → codebrain-0.3.2}/PKG-INFO +300 -300
  2. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/__init__.py +1 -1
  3. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/analyzer.py +953 -953
  4. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/architecture.py +824 -824
  5. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/frontend.py +443 -443
  6. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/kt.py +401 -401
  7. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/mcp_lifecycle.py +58 -8
  8. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/mcp_server.py +2992 -2992
  9. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/migration.py +729 -729
  10. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/modernize.py +962 -962
  11. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/frontend_parser.py +1047 -1047
  12. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/tour.py +475 -475
  13. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/PKG-INFO +300 -300
  14. {codebrain-0.3.1 → codebrain-0.3.2}/pyproject.toml +1 -1
  15. {codebrain-0.3.1 → codebrain-0.3.2}/setup.cfg +4 -4
  16. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_llm.py +2 -4
  17. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_mcp_lifecycle.py +71 -0
  18. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_mcp_server.py +615 -623
  19. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_memory.py +462 -470
  20. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_real_repos.py +878 -878
  21. {codebrain-0.3.1 → codebrain-0.3.2}/LICENSE +0 -0
  22. {codebrain-0.3.1 → codebrain-0.3.2}/README.md +0 -0
  23. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/__main__.py +0 -0
  24. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/actions/__init__.py +0 -0
  25. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/actions/base.py +0 -0
  26. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/actions/refactor.py +0 -0
  27. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/actions/reviewer.py +0 -0
  28. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/actions/test_gen.py +0 -0
  29. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/agent_bridge.py +0 -0
  30. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/api.py +0 -0
  31. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/api_models.py +0 -0
  32. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/cli.py +0 -0
  33. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/comprehension.py +0 -0
  34. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/config.py +0 -0
  35. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/context.py +0 -0
  36. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/cross_query.py +0 -0
  37. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/cross_registry.py +0 -0
  38. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/diff_impact.py +0 -0
  39. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/env_migration.py +0 -0
  40. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/equivalence.py +0 -0
  41. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/export.py +0 -0
  42. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/graph/__init__.py +0 -0
  43. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/graph/query.py +0 -0
  44. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/graph/schema.py +0 -0
  45. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/graph/store.py +0 -0
  46. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/hook_runner.py +0 -0
  47. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/hooks.py +0 -0
  48. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/indexer.py +0 -0
  49. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/kt_video.py +0 -0
  50. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/llm.py +0 -0
  51. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/logging.py +0 -0
  52. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/memory/__init__.py +0 -0
  53. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/memory/store.py +0 -0
  54. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/onboard.py +0 -0
  55. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/__init__.py +0 -0
  56. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/base.py +0 -0
  57. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/cobol_parser.py +0 -0
  58. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/config_parser.py +0 -0
  59. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/csharp_parser.py +0 -0
  60. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/dart_parser.py +0 -0
  61. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/fortran_parser.py +0 -0
  62. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/go_parser.py +0 -0
  63. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/java_parser.py +0 -0
  64. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/kotlin_parser.py +0 -0
  65. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/models.py +0 -0
  66. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/mumps_parser.py +0 -0
  67. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/plsql_parser.py +0 -0
  68. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/python_parser.py +0 -0
  69. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/registry.py +0 -0
  70. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/rust_parser.py +0 -0
  71. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/schema_parser.py +0 -0
  72. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/typescript_parser.py +0 -0
  73. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/typescript_treesitter.py +0 -0
  74. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/parser/vue_parser.py +0 -0
  75. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/py.typed +0 -0
  76. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/resolver.py +0 -0
  77. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/rewriter.py +0 -0
  78. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/schema_migration.py +0 -0
  79. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/settings.py +0 -0
  80. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/susa_auth.py +0 -0
  81. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/test_gaps.py +0 -0
  82. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/test_runner.py +0 -0
  83. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/ui_migration.py +0 -0
  84. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/utils.py +0 -0
  85. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/validator.py +0 -0
  86. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/watcher/__init__.py +0 -0
  87. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain/watcher/file_watcher.py +0 -0
  88. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/SOURCES.txt +0 -0
  89. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/dependency_links.txt +0 -0
  90. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/entry_points.txt +0 -0
  91. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/requires.txt +0 -0
  92. {codebrain-0.3.1 → codebrain-0.3.2}/codebrain.egg-info/top_level.txt +0 -0
  93. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_actions.py +0 -0
  94. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_agent_bridge.py +0 -0
  95. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_analyzer.py +0 -0
  96. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_api.py +0 -0
  97. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_architecture.py +0 -0
  98. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_ci.py +0 -0
  99. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_cli.py +0 -0
  100. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_comprehension.py +0 -0
  101. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_context.py +0 -0
  102. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_contracts_real.py +0 -0
  103. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_coverage_gaps.py +0 -0
  104. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_cross_repo.py +0 -0
  105. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_csharp_parser.py +0 -0
  106. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_dart_parser.py +0 -0
  107. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_dataflow.py +0 -0
  108. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_dead_code_confidence.py +0 -0
  109. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_diff_impact.py +0 -0
  110. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_env_migration.py +0 -0
  111. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_equivalence.py +0 -0
  112. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_error_recovery.py +0 -0
  113. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_export.py +0 -0
  114. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_fingerprints.py +0 -0
  115. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_frontend.py +0 -0
  116. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_gate_battle.py +0 -0
  117. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_go_parser.py +0 -0
  118. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_hooks.py +0 -0
  119. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_indexer.py +0 -0
  120. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_infra_parser.py +0 -0
  121. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_install.py +0 -0
  122. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_integration.py +0 -0
  123. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_java_parser.py +0 -0
  124. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_jyotishyamitra.py +0 -0
  125. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_kotlin_parser.py +0 -0
  126. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_kt.py +0 -0
  127. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_legacy_parsers.py +0 -0
  128. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_migration.py +0 -0
  129. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_modernize.py +0 -0
  130. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_multi_project_cli.py +0 -0
  131. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_narratives.py +0 -0
  132. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_onboard.py +0 -0
  133. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_orm_detection.py +0 -0
  134. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_output_quality.py +0 -0
  135. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_parser.py +0 -0
  136. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_plugin_system.py +0 -0
  137. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_production_hardening.py +0 -0
  138. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_query.py +0 -0
  139. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_real_codebase.py +0 -0
  140. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_real_features.py +0 -0
  141. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_real_frontend.py +0 -0
  142. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_real_world.py +0 -0
  143. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_resolver.py +0 -0
  144. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_rewriter.py +0 -0
  145. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_rust_parser.py +0 -0
  146. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_scale.py +0 -0
  147. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_scale_optimizations.py +0 -0
  148. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_scale_real.py +0 -0
  149. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_schema.py +0 -0
  150. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_schema_migration.py +0 -0
  151. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_schema_parser.py +0 -0
  152. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_settings.py +0 -0
  153. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_store.py +0 -0
  154. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_test_runner.py +0 -0
  155. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_tour.py +0 -0
  156. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_translate.py +0 -0
  157. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_ts_ast_parser.py +0 -0
  158. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_ts_parser_enhanced.py +0 -0
  159. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_typescript_parser.py +0 -0
  160. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_ui_migration.py +0 -0
  161. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_utils.py +0 -0
  162. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_validation_narratives.py +0 -0
  163. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_validator.py +0 -0
  164. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_validator_scenarios.py +0 -0
  165. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_vscode_extension.py +0 -0
  166. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_watch_validate.py +0 -0
  167. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_watcher.py +0 -0
  168. {codebrain-0.3.1 → codebrain-0.3.2}/tests/test_zoom.py +0 -0
@@ -1,300 +1,300 @@
1
- Metadata-Version: 2.4
2
- Name: codebrain
3
- Version: 0.3.1
4
- Summary: Know what breaks before you break it. Structural knowledge graph for codebases — impact analysis, dead code detection, health scores. No LLM required.
5
- Author: CodeBrain Contributors
6
- License: MIT License
7
-
8
- Copyright (c) 2026 CodeBrain Contributors
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/monk0062006/CodeBrain
29
- Project-URL: Repository, https://github.com/monk0062006/CodeBrain
30
- Project-URL: Issues, https://github.com/monk0062006/CodeBrain/issues
31
- Keywords: code-analysis,static-analysis,knowledge-graph,impact-analysis,dead-code,codebase-health,mcp,ai-coding,structural-analysis,refactoring
32
- Classifier: Development Status :: 4 - Beta
33
- Classifier: Intended Audience :: Developers
34
- Classifier: License :: OSI Approved :: MIT License
35
- Classifier: Programming Language :: Python :: 3
36
- Classifier: Programming Language :: Python :: 3.11
37
- Classifier: Programming Language :: Python :: 3.12
38
- Classifier: Programming Language :: Python :: 3.13
39
- Classifier: Topic :: Software Development :: Quality Assurance
40
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
- Classifier: Topic :: Software Development :: Testing
42
- Classifier: Environment :: Console
43
- Classifier: Operating System :: OS Independent
44
- Classifier: Typing :: Typed
45
- Requires-Python: >=3.11
46
- Description-Content-Type: text/markdown
47
- License-File: LICENSE
48
- Requires-Dist: click>=8.1
49
- Requires-Dist: watchdog>=3.0
50
- Requires-Dist: mcp<1.20,>=1.0
51
- Requires-Dist: jinja2>=3.1
52
- Requires-Dist: psutil>=5.9
53
- Provides-Extra: api
54
- Requires-Dist: fastapi>=0.110; extra == "api"
55
- Requires-Dist: uvicorn>=0.27; extra == "api"
56
- Provides-Extra: llm
57
- Requires-Dist: httpx>=0.27; extra == "llm"
58
- Provides-Extra: ts
59
- Requires-Dist: tree-sitter>=0.21; extra == "ts"
60
- Requires-Dist: tree-sitter-languages>=1.10; extra == "ts"
61
- Provides-Extra: dev
62
- Requires-Dist: pytest>=7.0; extra == "dev"
63
- Requires-Dist: pytest-tmp-files>=0.0.2; extra == "dev"
64
- Requires-Dist: pytest-cov>=4.0; extra == "dev"
65
- Requires-Dist: mypy>=1.8; extra == "dev"
66
- Requires-Dist: ruff>=0.3; extra == "dev"
67
- Requires-Dist: httpx>=0.27; extra == "dev"
68
- Provides-Extra: all
69
- Requires-Dist: codebrain[api,llm,ts]; extra == "all"
70
- Dynamic: license-file
71
-
72
- # CodeBrain
73
-
74
- **Know what breaks before you break it.**
75
-
76
- CodeBrain builds a structural knowledge graph of your codebase — every
77
- function, class, import, and call chain — and stores it locally in
78
- SQLite. Wire it into Claude Code, Cursor, or any MCP-compatible agent
79
- and your AI suddenly knows the structure of your code instead of
80
- guessing.
81
-
82
- ```bash
83
- pip install codebrain
84
- cd your-project
85
- brain init
86
- ```
87
-
88
- ```
89
- Indexing your-project (1,328 files) ...
90
- Done in 135s — 17,756 nodes, 111,793 edges
91
- Health: 93/100 (A)
92
- ```
93
-
94
- Free. MIT-licensed. No cloud. No LLM required for the core features.
95
-
96
- ---
97
-
98
- ## Why
99
-
100
- AI coding agents (Claude Code, Cursor, Copilot) generate code faster
101
- than you can review it. They read fragments of code, lack persistent
102
- structural memory, and apply local fixes. When an agent removes a
103
- function, it doesn't know 3 other files call it. When it changes a
104
- signature, it doesn't know what depends on the old shape.
105
-
106
- CodeBrain knows. It maintains a persistent graph of every symbol and
107
- relationship and gives agents tools (via MCP) to query it.
108
-
109
- ---
110
-
111
- ## Wire it into Claude Code
112
-
113
- The killer feature. One command:
114
-
115
- ```bash
116
- brain setup
117
- ```
118
-
119
- Indexes the repo, drops a `CLAUDE.md` with project context, writes the
120
- MCP config. Restart Claude Code and it has tools like
121
- `mcp__codebrain__impact_analysis`, `mcp__codebrain__find_dead_code`,
122
- `mcp__codebrain__call_chain`, `mcp__codebrain__zoom`,
123
- `mcp__codebrain__ask_codebase`, plus a few dozen more. It uses them on
124
- its own.
125
-
126
- Manual config (any MCP-compatible client):
127
-
128
- ```json
129
- {
130
- "mcpServers": {
131
- "codebrain": {
132
- "command": "python",
133
- "args": ["-m", "codebrain.mcp_server"],
134
- "env": { "CODEBRAIN_PROJECT": "/absolute/path/to/repo" }
135
- }
136
- }
137
- }
138
- ```
139
-
140
- ---
141
-
142
- ## What you can do from the CLI
143
-
144
- ```bash
145
- brain impact create_user # what breaks if I change this?
146
- brain callers create_user # who calls this?
147
- brain trace create_user # what does it call, recursively?
148
- brain deadcode # actually-unused functions, with confidence levels
149
- brain hotspots # riskiest symbols (most depended on)
150
- brain cycles # import cycles
151
- brain health # codebase score 0-100
152
- brain coupling # module-to-module coupling
153
- brain layers # architectural layers inferred from imports
154
- brain zoom system|module|symbol # Google Maps for your architecture
155
- brain ask "where does login flow live?"
156
- ```
157
-
158
- Sample output:
159
-
160
- ```
161
- $ brain impact getAstroData
162
- Impact of changing predictions_api.py::getAstroData:
163
- [1] Ascendant.py::compileAstroDetails (CALLS)
164
- [1] AsthaKoota.py::getNakAndRasi (CALLS)
165
- [2] ProfileBuilder.py::buildProfile (CALLS via compileAstroDetails)
166
- ... 48 dependents across 69 files
167
- Blast radius: 5.2% of the codebase
168
- ```
169
-
170
- ```
171
- $ brain hotspots
172
- Risk hotspots (top 3):
173
- 48.2 function getAstroData 48 deps 69 files
174
- 35.1 function compileAstroDetails 35 deps 52 files
175
- 28.7 class ProfileBuilder 28 deps 41 files
176
- ```
177
-
178
- Run `brain --help` for the full command list (60+).
179
-
180
- ---
181
-
182
- ## Pre-commit and CI
183
-
184
- ```bash
185
- brain hook install # validates staged Python files before each commit
186
- brain ci --base origin/main # exit 1 on structural regressions in a PR
187
- brain diff-impact # blast radius of currently-staged changes
188
- ```
189
-
190
- GitHub Action:
191
-
192
- ```yaml
193
- - run: pip install codebrain
194
- - run: brain ci --base origin/main --json
195
- ```
196
-
197
- ---
198
-
199
- ## Language support
200
-
201
- | Language | Parser | Status |
202
- |---|---|---|
203
- | Python | AST (stdlib) | full |
204
- | TypeScript / JS / JSX / Vue | tree-sitter | full — `pip install "codebrain[ts]"` |
205
- | Java | tree-sitter | full — Spring Boot aware |
206
- | Go, Rust, C#, Kotlin, Dart | tree-sitter / regex | good |
207
- | COBOL, Fortran, MUMPS, PL/SQL | regex | basic — for legacy migration |
208
-
209
- Adding a parser: implement `BaseParser`, register via the
210
- `codebrain.parsers` entry point. See `docs/USAGE.md`.
211
-
212
- ---
213
-
214
- ## Optional extras
215
-
216
- ```bash
217
- pip install "codebrain[ts]" # TypeScript / JS / Vue
218
- pip install "codebrain[api]" # FastAPI REST server
219
- pip install "codebrain[llm]" # AI-powered explain / ask / rewrite
220
- pip install "codebrain[all]" # everything
221
- ```
222
-
223
- Core install (`pip install codebrain`) is enough for Python projects
224
- and the MCP server.
225
-
226
- ---
227
-
228
- ## Configuration
229
-
230
- `.codebrain.toml` at repo root, or `CODEBRAIN_*` env vars:
231
-
232
- ```toml
233
- [index]
234
- exclude = ["vendor/", "**/__generated__/**"]
235
-
236
- [mcp]
237
- tool_timeout = 25
238
- idle_timeout = 1800
239
-
240
- [parser]
241
- languages = ["python", "typescript", "java"]
242
- ```
243
-
244
- ---
245
-
246
- ## How it works
247
-
248
- ```
249
- Source files ─► Parser ─► Nodes + Edges ─► SQLite (.codebrain/graph.db)
250
-
251
- ┌─────────────────────┴───────────────────────┐
252
- ▼ ▼
253
- brain CLI MCP server / REST API
254
- ```
255
-
256
- - **Node** — a symbol (function, class, method, file)
257
- - **Edge** — a relationship (CALLS, IMPORTS, CONTAINS, EXTENDS, DATAFLOW)
258
- - **GraphStore** — SQLite with WAL mode, lives in `.codebrain/` (auto-gitignored)
259
- - **QueryEngine** — BFS/DFS for impact, call chains, dead code, cycles
260
-
261
- Everything stays on your machine. The only thing that leaves is what
262
- you explicitly send to an LLM via `brain ask` / `brain explain` /
263
- `brain rewrite`.
264
-
265
- ---
266
-
267
- ## Documentation
268
-
269
- - **[docs/USAGE.md](docs/USAGE.md)** — full usage guide: workflows,
270
- every command, MCP setup, troubleshooting.
271
- - **[docs/cli-reference.md](docs/cli-reference.md)** — generated CLI
272
- reference.
273
- - **[docs/mcp-tools.md](docs/mcp-tools.md)** — every MCP tool with
274
- examples.
275
- - **[docs/PRD.md](docs/PRD.md)** — product requirements.
276
-
277
- ---
278
-
279
- ## Development
280
-
281
- ```bash
282
- git clone https://github.com/monk0062006/CodeBrain.git
283
- cd CodeBrain
284
- pip install -e ".[dev]"
285
-
286
- pytest tests/ # 1,900+ tests
287
- ruff check codebrain/
288
- mypy codebrain/
289
- ```
290
-
291
- ---
292
-
293
- ## License
294
-
295
- MIT. Use it however you want.
296
-
297
- ## Links
298
-
299
- - PyPI: https://pypi.org/project/codebrain/
300
- - Issues: https://github.com/monk0062006/CodeBrain/issues
1
+ Metadata-Version: 2.4
2
+ Name: codebrain
3
+ Version: 0.3.2
4
+ Summary: Know what breaks before you break it. Structural knowledge graph for codebases — impact analysis, dead code detection, health scores. No LLM required.
5
+ Author: CodeBrain Contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 CodeBrain Contributors
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/monk0062006/CodeBrain
29
+ Project-URL: Repository, https://github.com/monk0062006/CodeBrain
30
+ Project-URL: Issues, https://github.com/monk0062006/CodeBrain/issues
31
+ Keywords: code-analysis,static-analysis,knowledge-graph,impact-analysis,dead-code,codebase-health,mcp,ai-coding,structural-analysis,refactoring
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Programming Language :: Python :: 3.13
39
+ Classifier: Topic :: Software Development :: Quality Assurance
40
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
+ Classifier: Topic :: Software Development :: Testing
42
+ Classifier: Environment :: Console
43
+ Classifier: Operating System :: OS Independent
44
+ Classifier: Typing :: Typed
45
+ Requires-Python: >=3.11
46
+ Description-Content-Type: text/markdown
47
+ License-File: LICENSE
48
+ Requires-Dist: click>=8.1
49
+ Requires-Dist: watchdog>=3.0
50
+ Requires-Dist: mcp<1.20,>=1.0
51
+ Requires-Dist: jinja2>=3.1
52
+ Requires-Dist: psutil>=5.9
53
+ Provides-Extra: api
54
+ Requires-Dist: fastapi>=0.110; extra == "api"
55
+ Requires-Dist: uvicorn>=0.27; extra == "api"
56
+ Provides-Extra: llm
57
+ Requires-Dist: httpx>=0.27; extra == "llm"
58
+ Provides-Extra: ts
59
+ Requires-Dist: tree-sitter>=0.21; extra == "ts"
60
+ Requires-Dist: tree-sitter-languages>=1.10; extra == "ts"
61
+ Provides-Extra: dev
62
+ Requires-Dist: pytest>=7.0; extra == "dev"
63
+ Requires-Dist: pytest-tmp-files>=0.0.2; extra == "dev"
64
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
65
+ Requires-Dist: mypy>=1.8; extra == "dev"
66
+ Requires-Dist: ruff>=0.3; extra == "dev"
67
+ Requires-Dist: httpx>=0.27; extra == "dev"
68
+ Provides-Extra: all
69
+ Requires-Dist: codebrain[api,llm,ts]; extra == "all"
70
+ Dynamic: license-file
71
+
72
+ # CodeBrain
73
+
74
+ **Know what breaks before you break it.**
75
+
76
+ CodeBrain builds a structural knowledge graph of your codebase — every
77
+ function, class, import, and call chain — and stores it locally in
78
+ SQLite. Wire it into Claude Code, Cursor, or any MCP-compatible agent
79
+ and your AI suddenly knows the structure of your code instead of
80
+ guessing.
81
+
82
+ ```bash
83
+ pip install codebrain
84
+ cd your-project
85
+ brain init
86
+ ```
87
+
88
+ ```
89
+ Indexing your-project (1,328 files) ...
90
+ Done in 135s — 17,756 nodes, 111,793 edges
91
+ Health: 93/100 (A)
92
+ ```
93
+
94
+ Free. MIT-licensed. No cloud. No LLM required for the core features.
95
+
96
+ ---
97
+
98
+ ## Why
99
+
100
+ AI coding agents (Claude Code, Cursor, Copilot) generate code faster
101
+ than you can review it. They read fragments of code, lack persistent
102
+ structural memory, and apply local fixes. When an agent removes a
103
+ function, it doesn't know 3 other files call it. When it changes a
104
+ signature, it doesn't know what depends on the old shape.
105
+
106
+ CodeBrain knows. It maintains a persistent graph of every symbol and
107
+ relationship and gives agents tools (via MCP) to query it.
108
+
109
+ ---
110
+
111
+ ## Wire it into Claude Code
112
+
113
+ The killer feature. One command:
114
+
115
+ ```bash
116
+ brain setup
117
+ ```
118
+
119
+ Indexes the repo, drops a `CLAUDE.md` with project context, writes the
120
+ MCP config. Restart Claude Code and it has tools like
121
+ `mcp__codebrain__impact_analysis`, `mcp__codebrain__find_dead_code`,
122
+ `mcp__codebrain__call_chain`, `mcp__codebrain__zoom`,
123
+ `mcp__codebrain__ask_codebase`, plus a few dozen more. It uses them on
124
+ its own.
125
+
126
+ Manual config (any MCP-compatible client):
127
+
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "codebrain": {
132
+ "command": "python",
133
+ "args": ["-m", "codebrain.mcp_server"],
134
+ "env": { "CODEBRAIN_PROJECT": "/absolute/path/to/repo" }
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ ---
141
+
142
+ ## What you can do from the CLI
143
+
144
+ ```bash
145
+ brain impact create_user # what breaks if I change this?
146
+ brain callers create_user # who calls this?
147
+ brain trace create_user # what does it call, recursively?
148
+ brain deadcode # actually-unused functions, with confidence levels
149
+ brain hotspots # riskiest symbols (most depended on)
150
+ brain cycles # import cycles
151
+ brain health # codebase score 0-100
152
+ brain coupling # module-to-module coupling
153
+ brain layers # architectural layers inferred from imports
154
+ brain zoom system|module|symbol # Google Maps for your architecture
155
+ brain ask "where does login flow live?"
156
+ ```
157
+
158
+ Sample output:
159
+
160
+ ```
161
+ $ brain impact getAstroData
162
+ Impact of changing predictions_api.py::getAstroData:
163
+ [1] Ascendant.py::compileAstroDetails (CALLS)
164
+ [1] AsthaKoota.py::getNakAndRasi (CALLS)
165
+ [2] ProfileBuilder.py::buildProfile (CALLS via compileAstroDetails)
166
+ ... 48 dependents across 69 files
167
+ Blast radius: 5.2% of the codebase
168
+ ```
169
+
170
+ ```
171
+ $ brain hotspots
172
+ Risk hotspots (top 3):
173
+ 48.2 function getAstroData 48 deps 69 files
174
+ 35.1 function compileAstroDetails 35 deps 52 files
175
+ 28.7 class ProfileBuilder 28 deps 41 files
176
+ ```
177
+
178
+ Run `brain --help` for the full command list (60+).
179
+
180
+ ---
181
+
182
+ ## Pre-commit and CI
183
+
184
+ ```bash
185
+ brain hook install # validates staged Python files before each commit
186
+ brain ci --base origin/main # exit 1 on structural regressions in a PR
187
+ brain diff-impact # blast radius of currently-staged changes
188
+ ```
189
+
190
+ GitHub Action:
191
+
192
+ ```yaml
193
+ - run: pip install codebrain
194
+ - run: brain ci --base origin/main --json
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Language support
200
+
201
+ | Language | Parser | Status |
202
+ |---|---|---|
203
+ | Python | AST (stdlib) | full |
204
+ | TypeScript / JS / JSX / Vue | tree-sitter | full — `pip install "codebrain[ts]"` |
205
+ | Java | tree-sitter | full — Spring Boot aware |
206
+ | Go, Rust, C#, Kotlin, Dart | tree-sitter / regex | good |
207
+ | COBOL, Fortran, MUMPS, PL/SQL | regex | basic — for legacy migration |
208
+
209
+ Adding a parser: implement `BaseParser`, register via the
210
+ `codebrain.parsers` entry point. See `docs/USAGE.md`.
211
+
212
+ ---
213
+
214
+ ## Optional extras
215
+
216
+ ```bash
217
+ pip install "codebrain[ts]" # TypeScript / JS / Vue
218
+ pip install "codebrain[api]" # FastAPI REST server
219
+ pip install "codebrain[llm]" # AI-powered explain / ask / rewrite
220
+ pip install "codebrain[all]" # everything
221
+ ```
222
+
223
+ Core install (`pip install codebrain`) is enough for Python projects
224
+ and the MCP server.
225
+
226
+ ---
227
+
228
+ ## Configuration
229
+
230
+ `.codebrain.toml` at repo root, or `CODEBRAIN_*` env vars:
231
+
232
+ ```toml
233
+ [index]
234
+ exclude = ["vendor/", "**/__generated__/**"]
235
+
236
+ [mcp]
237
+ tool_timeout = 25
238
+ idle_timeout = 1800
239
+
240
+ [parser]
241
+ languages = ["python", "typescript", "java"]
242
+ ```
243
+
244
+ ---
245
+
246
+ ## How it works
247
+
248
+ ```
249
+ Source files ─► Parser ─► Nodes + Edges ─► SQLite (.codebrain/graph.db)
250
+
251
+ ┌─────────────────────┴───────────────────────┐
252
+ ▼ ▼
253
+ brain CLI MCP server / REST API
254
+ ```
255
+
256
+ - **Node** — a symbol (function, class, method, file)
257
+ - **Edge** — a relationship (CALLS, IMPORTS, CONTAINS, EXTENDS, DATAFLOW)
258
+ - **GraphStore** — SQLite with WAL mode, lives in `.codebrain/` (auto-gitignored)
259
+ - **QueryEngine** — BFS/DFS for impact, call chains, dead code, cycles
260
+
261
+ Everything stays on your machine. The only thing that leaves is what
262
+ you explicitly send to an LLM via `brain ask` / `brain explain` /
263
+ `brain rewrite`.
264
+
265
+ ---
266
+
267
+ ## Documentation
268
+
269
+ - **[docs/USAGE.md](docs/USAGE.md)** — full usage guide: workflows,
270
+ every command, MCP setup, troubleshooting.
271
+ - **[docs/cli-reference.md](docs/cli-reference.md)** — generated CLI
272
+ reference.
273
+ - **[docs/mcp-tools.md](docs/mcp-tools.md)** — every MCP tool with
274
+ examples.
275
+ - **[docs/PRD.md](docs/PRD.md)** — product requirements.
276
+
277
+ ---
278
+
279
+ ## Development
280
+
281
+ ```bash
282
+ git clone https://github.com/monk0062006/CodeBrain.git
283
+ cd CodeBrain
284
+ pip install -e ".[dev]"
285
+
286
+ pytest tests/ # 1,900+ tests
287
+ ruff check codebrain/
288
+ mypy codebrain/
289
+ ```
290
+
291
+ ---
292
+
293
+ ## License
294
+
295
+ MIT. Use it however you want.
296
+
297
+ ## Links
298
+
299
+ - PyPI: https://pypi.org/project/codebrain/
300
+ - Issues: https://github.com/monk0062006/CodeBrain/issues
@@ -7,4 +7,4 @@ try:
7
7
  except PackageNotFoundError:
8
8
  # Source checkout without installation (e.g. running from a worktree).
9
9
  # Keep in sync with [project.version] in pyproject.toml.
10
- __version__ = "0.3.1"
10
+ __version__ = "0.3.2"