codetree-rag 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codetree/__init__.py +13 -0
- codetree/cli.py +220 -0
- codetree/config.py +110 -0
- codetree/core.py +179 -0
- codetree/indexer.py +322 -0
- codetree/llm.py +116 -0
- codetree/parser.py +352 -0
- codetree/retriever.py +192 -0
- codetree_rag-0.1.0.dist-info/METADATA +496 -0
- codetree_rag-0.1.0.dist-info/RECORD +14 -0
- codetree_rag-0.1.0.dist-info/WHEEL +5 -0
- codetree_rag-0.1.0.dist-info/entry_points.txt +2 -0
- codetree_rag-0.1.0.dist-info/licenses/LICENSE +21 -0
- codetree_rag-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codetree-rag
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Vectorless RAG for Code Repositories - Navigate your codebase with LLM reasoning
|
|
5
|
+
Author-email: Tony <1094086026@qq.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/toller892/codetree
|
|
8
|
+
Project-URL: Repository, https://github.com/toller892/codetree
|
|
9
|
+
Project-URL: Issues, https://github.com/toller892/codetree/issues
|
|
10
|
+
Keywords: rag,code,llm,ai,retrieval,vectorless
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: openai>=1.0.0
|
|
24
|
+
Requires-Dist: anthropic>=0.18.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=13.0.0
|
|
27
|
+
Requires-Dist: click>=8.0.0
|
|
28
|
+
Requires-Dist: tree-sitter>=0.21.0
|
|
29
|
+
Requires-Dist: tree-sitter-python>=0.21.0
|
|
30
|
+
Requires-Dist: tree-sitter-javascript>=0.21.0
|
|
31
|
+
Requires-Dist: tiktoken>=0.5.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
+
Provides-Extra: ollama
|
|
38
|
+
Requires-Dist: ollama>=0.1.0; extra == "ollama"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# ๐ฒ CodeTree
|
|
42
|
+
|
|
43
|
+
**Vectorless RAG for Code Repositories**
|
|
44
|
+
|
|
45
|
+
> Navigate your codebase like a human expert โ using LLM reasoning, not vector similarity.
|
|
46
|
+
|
|
47
|
+
[](https://www.python.org/downloads/)
|
|
48
|
+
[](https://opensource.org/licenses/MIT)
|
|
49
|
+
[](https://github.com/toller892/Oh-Code-Rag)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ๐ค The Problem
|
|
54
|
+
|
|
55
|
+
Traditional RAG (Retrieval-Augmented Generation) for code has fundamental limitations:
|
|
56
|
+
|
|
57
|
+
| Problem | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| โ **Vector similarity โ Code relevance** | "login" and "logout" have similar embeddings, but they're completely different! |
|
|
60
|
+
| โ **Chunking destroys structure** | Splitting a class across chunks loses critical context |
|
|
61
|
+
| โ **Can't follow call chains** | "Who calls this function?" is nearly impossible with vectors |
|
|
62
|
+
| โ **No architecture understanding** | Vectors don't know that `auth/` is for authentication |
|
|
63
|
+
|
|
64
|
+
## ๐ก The Solution
|
|
65
|
+
|
|
66
|
+
**CodeTree** takes a different approach โ it builds a hierarchical tree index of your codebase and uses **LLM reasoning** to navigate it, just like a human developer would:
|
|
67
|
+
|
|
68
|
+
- โ
AST-based parsing preserves code structure
|
|
69
|
+
- โ
LLM reasons about which files are relevant
|
|
70
|
+
- โ
Understands module relationships and dependencies
|
|
71
|
+
- โ
Can trace function calls across files
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## โจ Features
|
|
76
|
+
|
|
77
|
+
| Feature | Description |
|
|
78
|
+
|---------|-------------|
|
|
79
|
+
| ๐ซ **No Vector Database** | Uses code structure + LLM reasoning instead of embedding similarity |
|
|
80
|
+
| ๐ณ **AST-Based Indexing** | Parses actual code structure โ functions, classes, imports, dependencies |
|
|
81
|
+
| ๐ **Cross-File Intelligence** | Tracks imports, function calls, and dependencies across your entire codebase |
|
|
82
|
+
| ๐ง **Reasoning-Based Retrieval** | LLM navigates the code tree like a human expert |
|
|
83
|
+
| ๐ฌ **Natural Language Queries** | Ask questions in plain English |
|
|
84
|
+
| ๐ **Privacy-First** | Works with local models (Ollama). Your code never leaves your machine |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## ๐ Comparison: Vector RAG vs CodeTree
|
|
89
|
+
|
|
90
|
+
| Feature | Vector RAG | CodeTree |
|
|
91
|
+
|---------|:----------:|:--------:|
|
|
92
|
+
| Understands code structure | โ | โ
|
|
|
93
|
+
| Cross-file references | โ | โ
|
|
|
94
|
+
| "Who calls this function?" | โ | โ
|
|
|
95
|
+
| No chunking headaches | โ | โ
|
|
|
96
|
+
| Explainable retrieval | โ | โ
|
|
|
97
|
+
| Works offline | โ ๏ธ | โ
|
|
|
98
|
+
| No vector DB needed | โ | โ
|
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## ๐ Quick Start
|
|
103
|
+
|
|
104
|
+
### Installation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/toller892/Oh-Code-Rag.git
|
|
108
|
+
cd Oh-Code-Rag
|
|
109
|
+
pip install -e .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<!-- Coming soon: pip install codetree-rag -->
|
|
113
|
+
|
|
114
|
+
### Configuration
|
|
115
|
+
|
|
116
|
+
Set your LLM API key:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
export OPENAI_API_KEY="sk-..."
|
|
120
|
+
# or
|
|
121
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Basic Usage
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from codetree import CodeTree
|
|
128
|
+
|
|
129
|
+
# Index your repository
|
|
130
|
+
tree = CodeTree("/path/to/your/repo")
|
|
131
|
+
tree.build_index()
|
|
132
|
+
|
|
133
|
+
# Ask questions about the code
|
|
134
|
+
answer = tree.query("How does the authentication system work?")
|
|
135
|
+
print(answer)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### CLI Usage
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Index a repository
|
|
142
|
+
codetree index /path/to/repo
|
|
143
|
+
|
|
144
|
+
# Query the codebase
|
|
145
|
+
codetree query "Where is database connection handled?"
|
|
146
|
+
|
|
147
|
+
# Interactive chat mode
|
|
148
|
+
codetree chat
|
|
149
|
+
|
|
150
|
+
# Show code structure
|
|
151
|
+
codetree tree
|
|
152
|
+
|
|
153
|
+
# Find symbol references
|
|
154
|
+
codetree find "UserService"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## ๐ฏ Use Cases
|
|
160
|
+
|
|
161
|
+
### ๐จโ๐ป For Developers
|
|
162
|
+
|
|
163
|
+
**Onboarding to New Codebases:**
|
|
164
|
+
- "What's the overall architecture of this project?"
|
|
165
|
+
- "How do requests flow from API to database?"
|
|
166
|
+
- "Where should I add a new payment method?"
|
|
167
|
+
|
|
168
|
+
**Code Review & Understanding:**
|
|
169
|
+
- "What does the processOrder function do?"
|
|
170
|
+
- "Who calls the validateUser method?"
|
|
171
|
+
- "What happens if authentication fails?"
|
|
172
|
+
|
|
173
|
+
### ๐ข Industry Applications
|
|
174
|
+
|
|
175
|
+
| Industry | Use Case | Example Query |
|
|
176
|
+
|----------|----------|---------------|
|
|
177
|
+
| **FinTech** | Audit & Compliance | "How is user data encrypted?" |
|
|
178
|
+
| **Healthcare** | Security Review | "Where is patient data accessed?" |
|
|
179
|
+
| **E-commerce** | Feature Development | "How does the cart system work?" |
|
|
180
|
+
| **DevOps** | Incident Response | "What services depend on Redis?" |
|
|
181
|
+
| **Education** | Code Learning | "Explain the MVC pattern in this app" |
|
|
182
|
+
|
|
183
|
+
### ๐ฌ Research & Analysis
|
|
184
|
+
|
|
185
|
+
- **Legacy Code Migration**: Understand old systems before rewriting
|
|
186
|
+
- **Security Auditing**: Find all database queries, API endpoints
|
|
187
|
+
- **Documentation Generation**: Auto-generate architecture docs
|
|
188
|
+
- **Dependency Analysis**: Map out service dependencies
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## ๐ฌ Real-World Examples
|
|
193
|
+
|
|
194
|
+
### Example 1: Understanding Project Architecture
|
|
195
|
+
|
|
196
|
+
**Query:**
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
from codetree import CodeTree
|
|
200
|
+
|
|
201
|
+
tree = CodeTree("./my-project")
|
|
202
|
+
tree.build_index()
|
|
203
|
+
|
|
204
|
+
answer = tree.query("What's the overall architecture? What are the core modules?")
|
|
205
|
+
print(answer)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Output:**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
## Project Architecture
|
|
212
|
+
|
|
213
|
+
This project follows a modular architecture with these core components:
|
|
214
|
+
|
|
215
|
+
1. **CodeTree (core.py)** - Main entry point
|
|
216
|
+
- `build_index()`: Builds the code tree
|
|
217
|
+
- `query()`: Natural language queries
|
|
218
|
+
- `find()`: Symbol search
|
|
219
|
+
|
|
220
|
+
2. **CodeIndexer (indexer.py)** - Index construction
|
|
221
|
+
- Recursively parses directories
|
|
222
|
+
- Builds TreeNode hierarchy
|
|
223
|
+
|
|
224
|
+
3. **CodeParser (parser.py)** - AST parsing
|
|
225
|
+
- Supports Python, JS, Go, Rust, Java
|
|
226
|
+
- Extracts functions, classes, imports
|
|
227
|
+
|
|
228
|
+
4. **CodeRetriever (retriever.py)** - LLM-based retrieval
|
|
229
|
+
- Two-stage: retrieve โ answer
|
|
230
|
+
- Uses reasoning prompts
|
|
231
|
+
|
|
232
|
+
## Data Flow
|
|
233
|
+
User Query โ CodeTree โ Retriever โ LLM Reasoning โ File Selection โ Answer
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Example 2: Finding Function Usage
|
|
237
|
+
|
|
238
|
+
**Query:**
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
refs = tree.find("authenticate")
|
|
242
|
+
print(refs)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Output:**
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
๐ Found 5 references to 'authenticate':
|
|
249
|
+
|
|
250
|
+
[function] src/auth/login.py:45 โ authenticate
|
|
251
|
+
[function] src/auth/oauth.py:78 โ authenticate_oauth
|
|
252
|
+
[import] src/api/middleware.py โ from auth import authenticate
|
|
253
|
+
[import] src/api/routes.py โ from auth.login import authenticate
|
|
254
|
+
[class] src/auth/base.py:12 โ Authenticator
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Example 3: Tracing Code Flow
|
|
258
|
+
|
|
259
|
+
**Query:**
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
answer = tree.query("How does a user login request flow through the system?")
|
|
263
|
+
print(answer)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Output:**
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
## Login Request Flow
|
|
270
|
+
|
|
271
|
+
1. **Entry Point**: `src/api/routes.py`
|
|
272
|
+
- @app.post("/login") routes to auth_service.authenticate()
|
|
273
|
+
|
|
274
|
+
2. **Authentication**: `src/auth/service.py`
|
|
275
|
+
- Validates credentials against database
|
|
276
|
+
- Generates JWT token on success
|
|
277
|
+
|
|
278
|
+
3. **Database**: `src/db/users.py`
|
|
279
|
+
- get_user_by_email() fetches user record
|
|
280
|
+
- verify_password() checks hash
|
|
281
|
+
|
|
282
|
+
4. **Response**: Returns JWT token or 401 error
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## ๐๏ธ How It Works
|
|
288
|
+
|
|
289
|
+
### Architecture Overview
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
293
|
+
โ CodeTree โ
|
|
294
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
295
|
+
โ โ
|
|
296
|
+
โ CodeParser โโโโโโโถ CodeIndexer โโโโโโโถ CodeIndex (JSON) โ
|
|
297
|
+
โ (AST Parse) (Build Tree) (Store) โ
|
|
298
|
+
โ โ โ
|
|
299
|
+
โ โผ โ
|
|
300
|
+
โ Answer โโโโโโโโโโโ Retrieve โโโโโโโโโโโ CodeRetriever โ
|
|
301
|
+
โ (Markdown) (Read Files) (LLM Reasoning) โ
|
|
302
|
+
โ โ
|
|
303
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Two-Stage Retrieval Process
|
|
307
|
+
|
|
308
|
+
**Stage 1: Reasoning-Based Navigation**
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
User: "How does authentication work?"
|
|
312
|
+
โ
|
|
313
|
+
โผ
|
|
314
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
315
|
+
โ LLM analyzes code tree structure: โ
|
|
316
|
+
โ โ
|
|
317
|
+
โ "Authentication relates to auth module... โ
|
|
318
|
+
โ Let me check src/auth/ directory... โ
|
|
319
|
+
โ login.py and oauth.py look relevant... โ
|
|
320
|
+
โ Also need to check who imports these..." โ
|
|
321
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
322
|
+
โ
|
|
323
|
+
โผ
|
|
324
|
+
Selected Files: [src/auth/login.py, src/auth/oauth.py, ...]
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**Stage 2: Answer Generation**
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
Read selected files โ Generate comprehensive answer with code snippets
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## ๐ฃ๏ธ Supported Languages
|
|
336
|
+
|
|
337
|
+
| Language | Extensions | Status |
|
|
338
|
+
|----------|------------|:------:|
|
|
339
|
+
| Python | `.py`, `.pyi` | โ
Full |
|
|
340
|
+
| JavaScript | `.js`, `.jsx`, `.mjs` | โ
Full |
|
|
341
|
+
| TypeScript | `.ts`, `.tsx` | โ
Full |
|
|
342
|
+
| Go | `.go` | โ
Full |
|
|
343
|
+
| Rust | `.rs` | โ
Full |
|
|
344
|
+
| Java | `.java` | โ
Full |
|
|
345
|
+
| C/C++ | `.c`, `.cpp`, `.h` | ๐ง Coming Soon |
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## โ๏ธ Configuration
|
|
350
|
+
|
|
351
|
+
Create `.codetree.yaml` in your project:
|
|
352
|
+
|
|
353
|
+
```yaml
|
|
354
|
+
# LLM Configuration
|
|
355
|
+
llm:
|
|
356
|
+
provider: openai # openai, anthropic, ollama
|
|
357
|
+
model: gpt-4o
|
|
358
|
+
temperature: 0.0
|
|
359
|
+
max_tokens: 4096
|
|
360
|
+
|
|
361
|
+
# For local/private deployment
|
|
362
|
+
# llm:
|
|
363
|
+
# provider: ollama
|
|
364
|
+
# model: llama3
|
|
365
|
+
# base_url: http://localhost:11434
|
|
366
|
+
|
|
367
|
+
# Index Settings
|
|
368
|
+
index:
|
|
369
|
+
languages:
|
|
370
|
+
- python
|
|
371
|
+
- javascript
|
|
372
|
+
- typescript
|
|
373
|
+
- go
|
|
374
|
+
exclude:
|
|
375
|
+
- node_modules
|
|
376
|
+
- __pycache__
|
|
377
|
+
- .git
|
|
378
|
+
- venv
|
|
379
|
+
- dist
|
|
380
|
+
max_file_size: 100000 # Skip files larger than 100KB
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## ๐ Performance
|
|
386
|
+
|
|
387
|
+
| Metric | Small Repo (<100 files) | Medium Repo (<1000 files) | Large Repo (<10000 files) |
|
|
388
|
+
|--------|:-----------------------:|:-------------------------:|:-------------------------:|
|
|
389
|
+
| Index Time | < 5s | < 30s | < 5min |
|
|
390
|
+
| Index Size | < 100KB | < 1MB | < 10MB |
|
|
391
|
+
| Query Time | 2-5s | 3-8s | 5-15s |
|
|
392
|
+
|
|
393
|
+
*Times depend on LLM provider latency*
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## ๐ค Contributing
|
|
398
|
+
|
|
399
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
400
|
+
|
|
401
|
+
**Areas to contribute:**
|
|
402
|
+
- ๐ Add language parsers (C++, Ruby, PHP, etc.)
|
|
403
|
+
- ๐งช Improve test coverage
|
|
404
|
+
- ๐ Documentation and examples
|
|
405
|
+
- ๐ Performance optimizations
|
|
406
|
+
- ๐จ CLI improvements
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## ๐ MCP Server (Claude Desktop & More)
|
|
411
|
+
|
|
412
|
+
CodeTree works as an MCP (Model Context Protocol) server, compatible with Claude Desktop, Cline, Continue, and other MCP clients.
|
|
413
|
+
|
|
414
|
+
### Setup for Claude Desktop
|
|
415
|
+
|
|
416
|
+
Add to your Claude Desktop config:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"mcpServers": {
|
|
421
|
+
"codetree": {
|
|
422
|
+
"command": "python",
|
|
423
|
+
"args": ["/path/to/Oh-Code-Rag/mcp/server.py"],
|
|
424
|
+
"env": {
|
|
425
|
+
"OPENAI_API_KEY": "sk-your-key-here"
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### MCP Tools
|
|
433
|
+
|
|
434
|
+
| Tool | Description |
|
|
435
|
+
|------|-------------|
|
|
436
|
+
| `codetree_index` | Index a repository |
|
|
437
|
+
| `codetree_query` | Ask questions about code |
|
|
438
|
+
| `codetree_tree` | Show code structure |
|
|
439
|
+
| `codetree_find` | Find symbol references |
|
|
440
|
+
| `codetree_stats` | Get repo statistics |
|
|
441
|
+
|
|
442
|
+
See `mcp/README.md` for full documentation.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## ๐ค Clawdbot Skill
|
|
447
|
+
|
|
448
|
+
CodeTree also comes as a Clawdbot skill for AI assistant integration.
|
|
449
|
+
|
|
450
|
+
### Install Skill
|
|
451
|
+
|
|
452
|
+
Copy the `skill/` folder to your Clawdbot skills directory:
|
|
453
|
+
|
|
454
|
+
```bash
|
|
455
|
+
cp -r skill/ ~/.clawdbot/skills/codetree/
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Skill Commands
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
# Index a repo
|
|
462
|
+
./scripts/codetree.sh index /path/to/repo
|
|
463
|
+
|
|
464
|
+
# Query code
|
|
465
|
+
./scripts/codetree.sh query /path/to/repo "How does auth work?"
|
|
466
|
+
|
|
467
|
+
# Show structure
|
|
468
|
+
./scripts/codetree.sh tree /path/to/repo
|
|
469
|
+
|
|
470
|
+
# Find symbol
|
|
471
|
+
./scripts/codetree.sh find /path/to/repo "UserService"
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
See `skill/SKILL.md` for full documentation.
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## ๐ License
|
|
479
|
+
|
|
480
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## ๐ Acknowledgments
|
|
485
|
+
|
|
486
|
+
Inspired by [PageIndex](https://github.com/VectifyAI/PageIndex) โ vectorless RAG for documents.
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## โญ Star History
|
|
491
|
+
|
|
492
|
+
[](https://star-history.com/#toller892/Oh-Code-Rag&Date)
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
**If you find CodeTree useful, please give us a โญ!**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
codetree/__init__.py,sha256=el2WC4oZZV6QCWRHlrbkrknjEjh9xeisawXik40YmNs,334
|
|
2
|
+
codetree/cli.py,sha256=XTyg24DU5KWPk8xP0ECTE9cUJmEdtqxTHaHjaNcl3fc,7748
|
|
3
|
+
codetree/config.py,sha256=Y3oYF_ljZ97zhImdh4G9waQ0WWhkwjZg0Npe-duZa4E,3634
|
|
4
|
+
codetree/core.py,sha256=o5ZkE7_rw-QKCpCpPJ9d--fbaS4GHjL-psD0kEP1egI,5985
|
|
5
|
+
codetree/indexer.py,sha256=WjSsYBBuByY1WQ2iysLM9LVgf3R1kL3Y6YsSpGOFjuE,11324
|
|
6
|
+
codetree/llm.py,sha256=bNM1ipC3uDUK7HwjiZdtE-voNuG-U7IjyZBMuXqKHzw,3663
|
|
7
|
+
codetree/parser.py,sha256=JWvFZAC9IWg7ihQJaXAVaUc27hqPVPZlNbWq1Ks0tLg,12614
|
|
8
|
+
codetree/retriever.py,sha256=MheY5q8blG-WN0bKVuAS5Pyjgc7wk9hAFbqU3Qrhlp0,6999
|
|
9
|
+
codetree_rag-0.1.0.dist-info/licenses/LICENSE,sha256=jOT1xqe0XaZhNRh5j5cDFmm1xHWdWroZ808mWb5lKxE,1061
|
|
10
|
+
codetree_rag-0.1.0.dist-info/METADATA,sha256=tuSfCySqoLfgYuTd5mUsG8Hn6KdAqyrsGEtS0oIk8pI,14215
|
|
11
|
+
codetree_rag-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
codetree_rag-0.1.0.dist-info/entry_points.txt,sha256=lBVyLiyTHADo1UkTpyxkSMHezUCj6jGLfhGn7yd3VOU,47
|
|
13
|
+
codetree_rag-0.1.0.dist-info/top_level.txt,sha256=W0VzzB6D-ZrUtYufd_0NeUy2hy4AysgqdZXlTuDq-oQ,9
|
|
14
|
+
codetree_rag-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tony
|
|
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 @@
|
|
|
1
|
+
codetree
|