chunkhound 0.1.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 (112) hide show
  1. chunkhound-0.1.0/.dockerignore +78 -0
  2. chunkhound-0.1.0/.gitignore +217 -0
  3. chunkhound-0.1.0/IDE-SETUP.md +106 -0
  4. chunkhound-0.1.0/LICENSE +21 -0
  5. chunkhound-0.1.0/Makefile +108 -0
  6. chunkhound-0.1.0/PKG-INFO +168 -0
  7. chunkhound-0.1.0/README.md +118 -0
  8. chunkhound-0.1.0/chunkhound/__init__.py +25 -0
  9. chunkhound-0.1.0/chunkhound/api/__init__.py +5 -0
  10. chunkhound-0.1.0/chunkhound/api/cli/__init__.py +13 -0
  11. chunkhound-0.1.0/chunkhound/api/cli/commands/__init__.py +11 -0
  12. chunkhound-0.1.0/chunkhound/api/cli/commands/config.py +488 -0
  13. chunkhound-0.1.0/chunkhound/api/cli/commands/mcp.py +57 -0
  14. chunkhound-0.1.0/chunkhound/api/cli/commands/run.py +366 -0
  15. chunkhound-0.1.0/chunkhound/api/cli/main.py +172 -0
  16. chunkhound-0.1.0/chunkhound/api/cli/parsers/__init__.py +14 -0
  17. chunkhound-0.1.0/chunkhound/api/cli/parsers/config_parser.py +393 -0
  18. chunkhound-0.1.0/chunkhound/api/cli/parsers/main_parser.py +149 -0
  19. chunkhound-0.1.0/chunkhound/api/cli/parsers/mcp_parser.py +64 -0
  20. chunkhound-0.1.0/chunkhound/api/cli/parsers/run_parser.py +91 -0
  21. chunkhound-0.1.0/chunkhound/api/cli/utils/__init__.py +13 -0
  22. chunkhound-0.1.0/chunkhound/api/cli/utils/output.py +246 -0
  23. chunkhound-0.1.0/chunkhound/api/cli/utils/validation.py +274 -0
  24. chunkhound-0.1.0/chunkhound/chunker.py +377 -0
  25. chunkhound-0.1.0/chunkhound/config.py +777 -0
  26. chunkhound-0.1.0/chunkhound/database.py +314 -0
  27. chunkhound-0.1.0/chunkhound/embeddings.py +1255 -0
  28. chunkhound-0.1.0/chunkhound/file_discovery_cache.py +260 -0
  29. chunkhound-0.1.0/chunkhound/file_watcher.py +480 -0
  30. chunkhound-0.1.0/chunkhound/mcp_entry.py +57 -0
  31. chunkhound-0.1.0/chunkhound/mcp_server.py +463 -0
  32. chunkhound-0.1.0/chunkhound/parser.py +4013 -0
  33. chunkhound-0.1.0/chunkhound/process_detection.py +276 -0
  34. chunkhound-0.1.0/chunkhound/py.typed +0 -0
  35. chunkhound-0.1.0/chunkhound/signal_coordinator.py +464 -0
  36. chunkhound-0.1.0/chunkhound/tree_cache.py +339 -0
  37. chunkhound-0.1.0/core/__init__.py +44 -0
  38. chunkhound-0.1.0/core/exceptions/__init__.py +37 -0
  39. chunkhound-0.1.0/core/exceptions/core.py +301 -0
  40. chunkhound-0.1.0/core/models/__init__.py +24 -0
  41. chunkhound-0.1.0/core/models/chunk.py +400 -0
  42. chunkhound-0.1.0/core/models/embedding.py +422 -0
  43. chunkhound-0.1.0/core/models/file.py +281 -0
  44. chunkhound-0.1.0/core/types/__init__.py +51 -0
  45. chunkhound-0.1.0/core/types/common.py +156 -0
  46. chunkhound-0.1.0/docs/CLI_GUIDE.md +522 -0
  47. chunkhound-0.1.0/docs/TROUBLESHOOTING.md +540 -0
  48. chunkhound-0.1.0/docs/bge-in-icl/configuration-reference.md +634 -0
  49. chunkhound-0.1.0/docs/bge-in-icl/deployment-guide.md +756 -0
  50. chunkhound-0.1.0/docs/bge-in-icl/monitoring-setup.md +1526 -0
  51. chunkhound-0.1.0/docs/bge-in-icl/performance-tuning.md +1489 -0
  52. chunkhound-0.1.0/docs/bge-in-icl-guide.md +417 -0
  53. chunkhound-0.1.0/docs/examples/advanced-config.yaml +143 -0
  54. chunkhound-0.1.0/docs/examples/basic-config.yaml +37 -0
  55. chunkhound-0.1.0/docs/examples/local-config.yaml +67 -0
  56. chunkhound-0.1.0/docs/examples/production-config.yaml +198 -0
  57. chunkhound-0.1.0/examples/README.md +89 -0
  58. chunkhound-0.1.0/examples/bge_icl_performance_benchmark.py +660 -0
  59. chunkhound-0.1.0/examples/bge_in_icl_phase3_demo.py +307 -0
  60. chunkhound-0.1.0/examples/csharp_example.cs +157 -0
  61. chunkhound-0.1.0/interfaces/__init__.py +11 -0
  62. chunkhound-0.1.0/interfaces/database_provider.py +197 -0
  63. chunkhound-0.1.0/interfaces/embedding_provider.py +271 -0
  64. chunkhound-0.1.0/interfaces/language_parser.py +305 -0
  65. chunkhound-0.1.0/providers/__init__.py +16 -0
  66. chunkhound-0.1.0/providers/database/__init__.py +7 -0
  67. chunkhound-0.1.0/providers/database/duckdb_provider.py +2119 -0
  68. chunkhound-0.1.0/providers/embeddings/__init__.py +7 -0
  69. chunkhound-0.1.0/providers/embeddings/openai_provider.py +469 -0
  70. chunkhound-0.1.0/providers/parsing/__init__.py +7 -0
  71. chunkhound-0.1.0/providers/parsing/csharp_parser.py +790 -0
  72. chunkhound-0.1.0/providers/parsing/java_parser.py +771 -0
  73. chunkhound-0.1.0/providers/parsing/javascript_parser.py +507 -0
  74. chunkhound-0.1.0/providers/parsing/markdown_parser.py +402 -0
  75. chunkhound-0.1.0/providers/parsing/python_parser.py +397 -0
  76. chunkhound-0.1.0/providers/parsing/typescript_parser.py +736 -0
  77. chunkhound-0.1.0/pyproject.toml +117 -0
  78. chunkhound-0.1.0/registry/__init__.py +403 -0
  79. chunkhound-0.1.0/requirements-dev.txt +18 -0
  80. chunkhound-0.1.0/requirements-lock.txt +34 -0
  81. chunkhound-0.1.0/requirements.txt +17 -0
  82. chunkhound-0.1.0/scripts/dev-setup.sh +121 -0
  83. chunkhound-0.1.0/scripts/mcp-server.sh +68 -0
  84. chunkhound-0.1.0/scripts/setup.sh +40 -0
  85. chunkhound-0.1.0/scripts/test-examples.sh +144 -0
  86. chunkhound-0.1.0/scripts/validate.sh +127 -0
  87. chunkhound-0.1.0/services/__init__.py +13 -0
  88. chunkhound-0.1.0/services/base_service.py +24 -0
  89. chunkhound-0.1.0/services/embedding_service.py +478 -0
  90. chunkhound-0.1.0/services/indexing_coordinator.py +504 -0
  91. chunkhound-0.1.0/services/search_service.py +374 -0
  92. chunkhound-0.1.0/spec.md +173 -0
  93. chunkhound-0.1.0/tests/__init__.py +56 -0
  94. chunkhound-0.1.0/tests/fixtures/csharp/Sample.cs +279 -0
  95. chunkhound-0.1.0/tests/fixtures/java/Sample.java +56 -0
  96. chunkhound-0.1.0/tests/integration/test_bge_icl_integration.py +656 -0
  97. chunkhound-0.1.0/tests/integration/test_java_indexing.py +187 -0
  98. chunkhound-0.1.0/tests/test_bge_in_icl.py +475 -0
  99. chunkhound-0.1.0/tests/test_bge_in_icl_phase3.py +343 -0
  100. chunkhound-0.1.0/tests/test_config.py +749 -0
  101. chunkhound-0.1.0/tests/test_csharp_parser.py +465 -0
  102. chunkhound-0.1.0/tests/test_database_incremental.py +310 -0
  103. chunkhound-0.1.0/tests/test_embeddings.py +433 -0
  104. chunkhound-0.1.0/tests/test_incremental_chunker.py +301 -0
  105. chunkhound-0.1.0/tests/test_incremental_parsing.py +474 -0
  106. chunkhound-0.1.0/tests/test_java_parser.py +242 -0
  107. chunkhound-0.1.0/tests/test_live_indexing_embeddings.py +202 -0
  108. chunkhound-0.1.0/tests/test_process_coordination.py +140 -0
  109. chunkhound-0.1.0/tests/test_process_detection.py +346 -0
  110. chunkhound-0.1.0/tests/test_signal_coordinator.py +593 -0
  111. chunkhound-0.1.0/tests/test_tree_cache.py +481 -0
  112. chunkhound-0.1.0/uv.lock +1717 -0
@@ -0,0 +1,78 @@
1
+ # ChunkHound Docker ignore file
2
+
3
+ # Python cache
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+ *.so
8
+ .Python
9
+ build/
10
+ develop-eggs/
11
+ dist/
12
+ downloads/
13
+ eggs/
14
+ .eggs/
15
+ lib/
16
+ lib64/
17
+ parts/
18
+ sdist/
19
+ var/
20
+ wheels/
21
+ share/python-wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # Virtual environments
28
+ venv/
29
+ env/
30
+ ENV/
31
+
32
+ # IDE and editor files
33
+ .vscode/
34
+ .idea/
35
+ *.swp
36
+ *.swo
37
+ *~
38
+ .DS_Store
39
+
40
+ # Version control
41
+ .git/
42
+ .gitignore
43
+
44
+ # Documentation
45
+ docs/
46
+ *.md
47
+ !README.md
48
+
49
+ # Tests and development
50
+ tests/
51
+ test_*.py
52
+ *_test.py
53
+ .pytest_cache/
54
+ .coverage
55
+ htmlcov/
56
+
57
+ # Development configuration
58
+ .mem/
59
+ .ropeproject/
60
+ .zed/
61
+
62
+ # Database cache (will be created in container)
63
+ *.duckdb*
64
+
65
+ # Docker files
66
+ Dockerfile*
67
+ docker-compose*.yml
68
+ .dockerignore
69
+
70
+ # CI/CD
71
+ .github/
72
+ .gitlab-ci.yml
73
+
74
+ # Other
75
+ LICENSE
76
+ Makefile
77
+ requirements*.txt
78
+ scripts/
@@ -0,0 +1,217 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Abstra
171
+ # Abstra is an AI-powered process automation framework.
172
+ # Ignore directories containing user credentials, local state, and settings.
173
+ # Learn more at https://abstra.io/docs
174
+ .abstra/
175
+
176
+ # Visual Studio Code
177
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
180
+ # you could uncomment the following to ignore the enitre vscode folder
181
+ .vscode/settings.json
182
+
183
+ # Zed Editor
184
+ .zed/
185
+
186
+ # Ruff stuff:
187
+ .ruff_cache/
188
+
189
+ # PyPI configuration file
190
+ .pypirc
191
+
192
+ # Cursor
193
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
194
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
195
+ # refer to https://docs.cursor.com/context/ignore-files
196
+ .cursorignore
197
+ .cursorindexingignore
198
+
199
+ # LLM Notes
200
+ .mem
201
+
202
+ # Code Index MCP cache directory
203
+ .code_indexer/
204
+
205
+ # ChunkHound database files
206
+ .chunkhound.*
207
+ c-sharp.db
208
+
209
+ # MCP configuration files (may contain API keys)
210
+ .vscode/mcp.json
211
+ mcp.json
212
+
213
+ # RooCode
214
+ .roo/
215
+
216
+ # Backup directories
217
+ chunkhound-backup-*/
@@ -0,0 +1,106 @@
1
+ # IDE Setup for ChunkHound Development
2
+
3
+ **Quick setup for developing ChunkHound using ChunkHound itself**
4
+
5
+ ## Prerequisites
6
+
7
+ ```bash
8
+ git clone https://github.com/chunkhound/chunkhound.git
9
+ cd chunkhound
10
+ uv sync # Install dependencies
11
+ uv run chunkhound run . # Index ChunkHound's own code
12
+ ```
13
+
14
+ ## Zed Editor (Recommended)
15
+
16
+ Create `.zed/settings.json` in the ChunkHound directory:
17
+
18
+ ```json
19
+ {
20
+ "context_servers": {
21
+ "chunkhound": {
22
+ "command": "uv",
23
+ "args": ["run", "chunkhound", "mcp", "--db", ".chunkhound.duckdb"],
24
+ "cwd": ".",
25
+ "env": {
26
+ "OPENAI_API_KEY": "your-openai-api-key-here"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ## VS Code
34
+
35
+ Install the MCP extension, then add to workspace `.vscode/settings.json`:
36
+
37
+ ```json
38
+ {
39
+ "mcp.servers": {
40
+ "chunkhound": {
41
+ "command": "uv",
42
+ "args": ["run", "chunkhound", "mcp"],
43
+ "cwd": "${workspaceFolder}",
44
+ "env": {
45
+ "CHUNKHOUND_DB_PATH": "${workspaceFolder}/.chunkhound.duckdb",
46
+ "OPENAI_API_KEY": "your-openai-api-key-here"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ## Claude Desktop
54
+
55
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "chunkhound": {
61
+ "command": "uv",
62
+ "args": ["run", "chunkhound", "mcp", "--db", "/full/path/to/chunkhound/.chunkhound.duckdb"],
63
+ "cwd": "/full/path/to/chunkhound",
64
+ "env": {
65
+ "OPENAI_API_KEY": "your-openai-api-key-here"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ ## Development Workflow
73
+
74
+ 1. **Make code changes** to ChunkHound
75
+ 2. **Re-index**: `uv run chunkhound run . --verbose`
76
+ 3. **Use AI assistant** to search the updated codebase
77
+ 4. **Ask questions** like:
78
+ - "Find database connection functions"
79
+ - "Show me how parsing works"
80
+ - "Find all async functions"
81
+ - "How does the MCP server handle requests?"
82
+
83
+ ## Environment Variables
84
+
85
+ Create `.env` file in ChunkHound directory:
86
+
87
+ ```bash
88
+ OPENAI_API_KEY=your-openai-api-key-here
89
+ CHUNKHOUND_DB_PATH=./.chunkhound.duckdb
90
+ ```
91
+
92
+ ## Troubleshooting
93
+
94
+ - **MCP not connecting**: Check JSON syntax and file paths
95
+ - **Tools not appearing**: Restart your IDE after configuration changes
96
+ - **Database not found**: Run `uv run chunkhound run .` first to create database
97
+ - **Permission denied**: Make sure `uv` is in your PATH
98
+
99
+ ## Quick Test
100
+
101
+ ```bash
102
+ # Test MCP server directly
103
+ echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | uv run chunkhound mcp
104
+
105
+ # Should return 4 tools: search_regex, search_semantic, get_stats, health_check
106
+ ```
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ofri Wolfus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ # ChunkHound Development Makefile
2
+ # Makes development dead simple with common tasks
3
+
4
+ .PHONY: help install install-dev test test-watch lint format clean setup dev build check-deps validate test-examples
5
+
6
+ # Default target
7
+ help: ## Show this help message
8
+ @echo "ChunkHound Development Commands:"
9
+ @echo ""
10
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
11
+ @echo ""
12
+ @echo "Quick Start:"
13
+ @echo " make setup # One-time development setup"
14
+ @echo " make test # Run tests"
15
+ @echo " make dev # Index current directory"
16
+ @echo ""
17
+ @echo "New uv-based commands:"
18
+ @echo " ./scripts/dev-setup.sh # Index + start MCP server"
19
+ @echo " ./scripts/mcp-server.sh # Start MCP server only"
20
+
21
+ setup: ## One-time development setup (syncs deps with uv)
22
+ @echo "🔧 Setting up ChunkHound development environment..."
23
+ uv sync
24
+ @echo "✅ Setup complete! Use 'uv run' commands or activate with: source .venv/bin/activate"
25
+
26
+ install: ## Install package in development mode
27
+ uv sync
28
+
29
+ install-dev: ## Install with development dependencies
30
+ uv sync --group dev
31
+
32
+ test: ## Run all tests
33
+ uv run pytest -v
34
+
35
+ test-watch: ## Run tests in watch mode
36
+ uv run pytest -f
37
+
38
+ test-api: ## Run API integration tests
39
+ uv run python test_api.py
40
+ uv run python test_api_simple.py
41
+
42
+ lint: ## Run linting (ruff + mypy)
43
+ uv run ruff check chunkhound/
44
+ uv run mypy chunkhound/
45
+
46
+ format: ## Format code with black and ruff
47
+ uv run black chunkhound/ test_*.py
48
+ uv run ruff check --fix chunkhound/
49
+
50
+ check-deps: ## Check for dependency issues
51
+ uv tree
52
+ @echo "Dependencies look good!"
53
+
54
+ dev: ## Index current directory for development
55
+ @echo "🚀 Starting ChunkHound development indexing..."
56
+ @echo " Processing current directory..."
57
+ uv run chunkhound run . --verbose
58
+
59
+ health: ## Check system health
60
+ @echo "🏥 System Health Check"
61
+ @echo "Python: $$(uv run python --version)"
62
+ @echo "ChunkHound: $$(uv run chunkhound --version)"
63
+ @echo "MCP server available via 'uv run chunkhound mcp'"
64
+
65
+ validate: ## Run end-to-end validation tests
66
+ @echo "🧪 Running comprehensive validation..."
67
+ ./scripts/validate.sh
68
+
69
+ test-examples: ## Test all README examples to ensure they work
70
+ @echo "📖 Testing README examples..."
71
+ ./scripts/test-examples.sh
72
+
73
+ build: ## Build distribution packages
74
+ uv build
75
+
76
+ clean: ## Clean up temporary files
77
+ rm -rf build/
78
+ rm -rf dist/
79
+ rm -rf *.egg-info/
80
+ find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
81
+ find . -type f -name "*.pyc" -delete
82
+
83
+ clean-db: ## Clean database cache
84
+ rm -rf ~/.cache/chunkhound/
85
+ @echo "🗑️ Database cache cleared"
86
+
87
+ install-system: ## Install globally on system
88
+ uv pip install .
89
+
90
+ # Advanced targets
91
+ requirements: ## Generate requirements.txt from uv.lock
92
+ uv export --format requirements-txt --output-file requirements.txt
93
+
94
+ docker-build: ## Build Docker image
95
+ docker build -t chunkhound:latest .
96
+
97
+ docker-run: ## Run in Docker container
98
+ docker run -p 7474:7474 -v "$(PWD):/workspace" chunkhound:latest
99
+
100
+ # Development quality checks
101
+ check: lint test ## Run all quality checks
102
+
103
+ pre-commit: format lint test ## Pre-commit hook (format, lint, test)
104
+
105
+ ci: ## Continuous integration checks
106
+ uv sync
107
+ make check
108
+ make test-examples
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: chunkhound
3
+ Version: 0.1.0
4
+ Summary: Local-first semantic code search with vector and regex capabilities for AI assistants via MCP
5
+ Project-URL: Homepage, https://github.com/chunkhound/chunkhound
6
+ Project-URL: Repository, https://github.com/chunkhound/chunkhound
7
+ Project-URL: Issues, https://github.com/chunkhound/chunkhound/issues
8
+ Project-URL: Documentation, https://github.com/chunkhound/chunkhound#readme
9
+ Project-URL: Changelog, https://github.com/chunkhound/chunkhound/releases
10
+ Author: Ofri Wolfus
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Code Generators
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Topic :: Text Processing :: Indexing
27
+ Requires-Python: >=3.10
28
+ Requires-Dist: aiohttp>=3.8.0
29
+ Requires-Dist: click>=8.0.0
30
+ Requires-Dist: duckdb>=0.8.0
31
+ Requires-Dist: loguru>=0.6.0
32
+ Requires-Dist: mcp>=1.0.0
33
+ Requires-Dist: openai>=1.0.0
34
+ Requires-Dist: psutil>=5.8.0
35
+ Requires-Dist: pydantic>=2.0.0
36
+ Requires-Dist: pyyaml>=6.0.0
37
+ Requires-Dist: tiktoken>=0.9.0
38
+ Requires-Dist: tree-sitter-language-pack>=0.7.3
39
+ Requires-Dist: tree-sitter-markdown
40
+ Requires-Dist: tree-sitter-python>=0.20.0
41
+ Requires-Dist: tree-sitter>=0.20.0
42
+ Requires-Dist: watchdog>=4.0.0
43
+ Provides-Extra: dev
44
+ Requires-Dist: black>=23.0.0; extra == 'dev'
45
+ Requires-Dist: mypy>=1.6.0; extra == 'dev'
46
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
47
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
48
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # ChunkHound
52
+
53
+ **Semantic and Regex search for your projects via MCP.**
54
+
55
+ ChunkHound indexes your code and lets AI assistants search it intelligently. It uses Tree-Sitter to parse code and DuckDB for search. Everything is done fully locally.
56
+
57
+ ## Quick Start
58
+
59
+ ```bash
60
+ # Install (after PyPI release)
61
+ pip install chunkhound
62
+
63
+ # Or install with uv
64
+ uv add chunkhound
65
+
66
+ # Index your code
67
+ chunkhound run .
68
+
69
+ # Start search server for AI assistants
70
+ chunkhound mcp
71
+ ```
72
+
73
+ That's it! Your code is now searchable by AI assistants.
74
+
75
+ ## What It Does
76
+
77
+ - **Indexes your code** - Finds functions, classes, and methods automatically
78
+ - **Regex search** - Find exact patterns like `def.*async`
79
+ - **Semantic search** - Ask questions like "How do I connect to the database?"
80
+ - **Works with AI assistants** - Claude, Cursor, VS Code, etc.
81
+ - **Multi-language support** - Python, Java, C#, and Markdown
82
+
83
+ ## AI Assistant Setup
84
+ ```json
85
+ {
86
+ "mcpServers": {
87
+ "chunkhound": {
88
+ "command": "chunkhound",
89
+ "args": ["mcp"],
90
+ "env": {
91
+ "OPENAI_API_KEY": "your-openai-key-here"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ ## How It Works
99
+
100
+ 1. **Scan** - ChunkHound reads your Python, Java, C#, and Markdown files
101
+ 2. **Parse** - Extracts functions, classes, methods using tree-sitter
102
+ 3. **Index** - Stores code chunks in a local database
103
+ 4. **Embed** - Creates AI embeddings for semantic search (optional)
104
+ 5. **Search** - AI assistants can now search your code
105
+
106
+ ## Search Examples
107
+
108
+ Once running, ask your AI assistant:
109
+
110
+ - "Find all database connection functions"
111
+ - "Show me error handling patterns"
112
+ - "How is user authentication implemented?"
113
+ - "Find functions that process files"
114
+ - "Find Java interfaces that implement Comparable"
115
+ - "Show me C# classes with async methods"
116
+ - "Find C# interfaces and their implementations"
117
+
118
+ ## Requirements
119
+
120
+ - Python 3.10+
121
+ - OpenAI API key (optional, for semantic search)
122
+ - Works on macOS and Linux
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ # Development setup
128
+ git clone https://github.com/chunkhound/chunkhound.git
129
+ cd chunkhound
130
+ uv sync # Install dependencies
131
+ uv run chunkhound run . # Index ChunkHound's own code
132
+ uv run chunkhound mcp # Start MCP server
133
+ ```
134
+
135
+ Use ChunkHound to search its own codebase while developing!
136
+
137
+ ## Examples
138
+
139
+ See the [examples/](examples/) directory for sample code demonstrating C# language support features.
140
+
141
+ ## Commands
142
+
143
+ ```bash
144
+ chunkhound run . # Index current directory
145
+ chunkhound run . --verbose # Index with detailed output
146
+ chunkhound run . --no-embeddings # Skip AI embeddings (faster)
147
+ chunkhound mcp --verbose # Start server with logging
148
+ ```
149
+
150
+ ## Troubleshooting
151
+
152
+ **Command not found?**
153
+ - For development: Try `uv run chunkhound` instead
154
+ - For production: Install with `pip install chunkhound` or `uv add chunkhound`
155
+
156
+ **Semantic search not working?**
157
+ - Set your `OPENAI_API_KEY` environment variable
158
+
159
+ **"You must provide a model parameter" error?**
160
+ - Update to latest version: `pip install --upgrade chunkhound`
161
+ - Or specify model explicitly: `chunkhound run . --model text-embedding-3-small`
162
+
163
+ **Database errors?**
164
+ - Delete `.chunkhound.db` and re-run `chunkhound run .`
165
+
166
+ ## License
167
+
168
+ MIT