@autodev/codebase 0.0.5 → 0.0.7
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.
- package/README.md +279 -224
- package/dist/cli.js +125432 -57
- package/dist/cli.js.map +1 -1
- package/dist/index.js +19259 -109028
- package/dist/index.js.map +1 -1
- package/dist/tree-sitter/tree-sitter-dart.wasm +0 -0
- package/dist/tree-sitter/tree-sitter-tlaplus.wasm +0 -0
- package/dist/tree-sitter/tree-sitter-zig.wasm +0 -0
- package/package.json +11 -28
package/README.md
CHANGED
|
@@ -1,336 +1,391 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
# @autodev/codebase
|
|
4
2
|
|
|
5
3
|
<div align="center">
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@autodev/codebase)
|
|
6
|
+
[](https://github.com/anrgct/autodev-codebase)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
8
9
|
</div>
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
```sh
|
|
12
|
+
╭─ ~/workspace/autodev-codebase
|
|
13
|
+
╰─❯ codebase --demo --search="user manage"
|
|
14
|
+
Found 3 results in 2 files for: "user manage"
|
|
15
|
+
|
|
16
|
+
==================================================
|
|
17
|
+
File: "hello.js"
|
|
18
|
+
==================================================
|
|
19
|
+
< class UserManager > (L7-20)
|
|
20
|
+
class UserManager {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.users = [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
addUser(user) {
|
|
26
|
+
this.users.push(user);
|
|
27
|
+
console.log('User added:', user.name);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
getUsers() {
|
|
31
|
+
return this.users;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
|
|
12
|
-
|
|
35
|
+
==================================================
|
|
36
|
+
File: "README.md" | 2 snippets
|
|
37
|
+
==================================================
|
|
38
|
+
< md_h1 Demo Project > md_h2 Usage > md_h3 JavaScript Functions > (L16-20)
|
|
39
|
+
### JavaScript Functions
|
|
40
|
+
|
|
41
|
+
- greetUser(name) - Greets a user by name
|
|
42
|
+
- UserManager - Class for managing user data
|
|
43
|
+
|
|
44
|
+
─────
|
|
45
|
+
< md_h1 Demo Project > md_h2 Search Examples > (L27-38)
|
|
46
|
+
## Search Examples
|
|
47
|
+
|
|
48
|
+
Try searching for:
|
|
49
|
+
- "greet user"
|
|
50
|
+
- "process data"
|
|
51
|
+
- "user management"
|
|
52
|
+
- "batch processing"
|
|
53
|
+
- "YOLO model"
|
|
54
|
+
- "computer vision"
|
|
55
|
+
- "object detection"
|
|
56
|
+
- "model training"
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
A vector embedding-based code semantic search tool with MCP server and multi-model integration. Can be used as a pure CLI tool. Supports Ollama for fully local embedding and reranking, enabling complete offline operation and privacy protection for your code repository.
|
|
13
60
|
|
|
14
61
|
## 🚀 Features
|
|
15
62
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
63
|
+
- **🔍 Semantic Code Search**: Vector-based search using advanced embedding models
|
|
64
|
+
- **🌐 MCP Server**: HTTP-based MCP server with SSE and stdio adapters
|
|
65
|
+
- **💻 Pure CLI Tool**: Standalone command-line interface without GUI dependencies
|
|
66
|
+
- **⚙️ Layered Configuration**: CLI, project, and global config management
|
|
67
|
+
- **🎯 Advanced Path Filtering**: Glob patterns with brace expansion and exclusions
|
|
68
|
+
- **🌲 Tree-sitter Parsing**: Support for 40+ programming languages
|
|
69
|
+
- **💾 Qdrant Integration**: High-performance vector database
|
|
70
|
+
- **🔄 Multiple Providers**: OpenAI, Ollama, Jina, Gemini, Mistral, OpenRouter, Vercel
|
|
71
|
+
- **📊 Real-time Watching**: Automatic index updates
|
|
72
|
+
- **⚡ Batch Processing**: Efficient parallel processing
|
|
73
|
+
- **📝 Code Outline Extraction**: Generate structured code outlines with AI summaries
|
|
22
74
|
|
|
23
75
|
## 📦 Installation
|
|
24
76
|
|
|
25
|
-
### 1.
|
|
26
|
-
|
|
77
|
+
### 1. Dependencies
|
|
27
78
|
```bash
|
|
28
|
-
|
|
29
|
-
brew install ollama
|
|
30
|
-
|
|
31
|
-
# Start Ollama service
|
|
79
|
+
brew install ollama ripgrep
|
|
32
80
|
ollama serve
|
|
81
|
+
ollama pull nomic-embed-text
|
|
82
|
+
```
|
|
33
83
|
|
|
34
|
-
|
|
35
|
-
|
|
84
|
+
### 2. Qdrant
|
|
85
|
+
```bash
|
|
86
|
+
docker run -d -p 6333:6333 -p 6334:6334 --name qdrant qdrant/qdrant
|
|
36
87
|
```
|
|
37
88
|
|
|
38
|
-
###
|
|
89
|
+
### 3. Install
|
|
90
|
+
```bash
|
|
91
|
+
npm install -g @autodev/codebase
|
|
92
|
+
codebase --set-config embedderProvider=ollama,embedderModelId=nomic-embed-text
|
|
93
|
+
```
|
|
39
94
|
|
|
40
|
-
|
|
95
|
+
## 🛠️ Quick Start
|
|
41
96
|
|
|
42
97
|
```bash
|
|
43
|
-
#
|
|
44
|
-
|
|
98
|
+
# Demo mode (recommended for first-time)
|
|
99
|
+
# Creates a demo directory in current working directory for testing
|
|
45
100
|
|
|
46
|
-
#
|
|
47
|
-
|
|
101
|
+
# Index & search
|
|
102
|
+
codebase --demo --index
|
|
103
|
+
codebase --demo --search="user greet"
|
|
48
104
|
|
|
49
|
-
#
|
|
50
|
-
|
|
105
|
+
# MCP server
|
|
106
|
+
codebase --demo --serve
|
|
51
107
|
```
|
|
52
108
|
|
|
53
|
-
|
|
109
|
+
## 📋 Commands
|
|
110
|
+
|
|
111
|
+
### 📝 AI-Powered Code Outlines
|
|
54
112
|
|
|
55
|
-
|
|
113
|
+
Generate intelligent code summaries with one command:
|
|
56
114
|
|
|
57
115
|
```bash
|
|
58
|
-
|
|
59
|
-
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
|
|
116
|
+
codebase --outline "src/**/*.ts" --summarize
|
|
60
117
|
```
|
|
61
118
|
|
|
62
|
-
|
|
119
|
+
**Output Example:**
|
|
120
|
+
```
|
|
121
|
+
# src/cli.ts (1902 lines)
|
|
122
|
+
└─ Implements a simplified CLI for @autodev/codebase using Node.js native parseArgs.
|
|
123
|
+
Manages codebase indexing, searching, and MCP server operations.
|
|
63
124
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
125
|
+
27--35 | function initGlobalLogger
|
|
126
|
+
└─ Initializes a global logger instance with specified log level and timestamps.
|
|
127
|
+
|
|
128
|
+
45--54 | interface SearchResult
|
|
129
|
+
└─ Defines the structure for search result payloads, including file path, code chunk,
|
|
130
|
+
and relevance score.
|
|
131
|
+
|
|
132
|
+
... (full outline with AI summaries)
|
|
69
133
|
```
|
|
70
134
|
|
|
71
|
-
|
|
135
|
+
**Benefits:**
|
|
136
|
+
- 🧠 **Understand code fast** - Get function-level summaries without reading every line
|
|
137
|
+
- 💾 **Smart caching** - Only summarizes changed code blocks
|
|
138
|
+
- 🌐 **Multi-language** - English/Chinese summaries supported
|
|
139
|
+
- ⚡ **Batch processing** - Efficiently handles large codebases
|
|
72
140
|
|
|
141
|
+
**Quick Setup:**
|
|
73
142
|
```bash
|
|
74
|
-
#
|
|
75
|
-
|
|
143
|
+
# Configure Ollama (recommended for free, local AI)
|
|
144
|
+
codebase --set-config summarizerProvider=ollama,summarizerOllamaModelId=qwen3-vl:4b-instruct
|
|
76
145
|
|
|
77
|
-
#
|
|
78
|
-
|
|
146
|
+
# Or use DeepSeek (cost-effective API)
|
|
147
|
+
codebase --set-config summarizerProvider=openai-compatible,summarizerOpenAiCompatibleBaseUrl=https://api.deepseek.com/v1,summarizerOpenAiCompatibleModelId=deepseek-chat,summarizerOpenAiCompatibleApiKey=sk-your-key
|
|
79
148
|
```
|
|
80
|
-
### 5. Install Autodev-codebase
|
|
81
149
|
|
|
150
|
+
|
|
151
|
+
### Indexing & Search
|
|
82
152
|
```bash
|
|
83
|
-
|
|
153
|
+
# Index the codebase
|
|
154
|
+
codebase --index --path=/my/project --force
|
|
155
|
+
|
|
156
|
+
# Search with filters
|
|
157
|
+
codebase --search="error handling" --path-filters="src/**/*.ts"
|
|
158
|
+
|
|
159
|
+
# Search with custom limit and minimum score
|
|
160
|
+
codebase --search="authentication" --limit=20 --min-score=0.7
|
|
161
|
+
codebase --search="API" -l 30 -S 0.5
|
|
162
|
+
|
|
163
|
+
# Search in JSON format
|
|
164
|
+
codebase --search="authentication" --json
|
|
165
|
+
|
|
166
|
+
# Clear index data
|
|
167
|
+
codebase --clear --path=/my/project
|
|
84
168
|
```
|
|
85
169
|
|
|
86
|
-
|
|
170
|
+
### MCP Server
|
|
171
|
+
```bash
|
|
172
|
+
# HTTP mode (recommended)
|
|
173
|
+
codebase --serve --port=3001 --path=/my/project
|
|
174
|
+
|
|
175
|
+
# Stdio adapter
|
|
176
|
+
codebase --stdio-adapter --server-url=http://localhost:3001/mcp
|
|
87
177
|
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
178
|
+
|
|
179
|
+
### Configuration
|
|
180
|
+
```bash
|
|
181
|
+
# View config
|
|
182
|
+
codebase --get-config
|
|
183
|
+
codebase --get-config embedderProvider --json
|
|
184
|
+
|
|
185
|
+
# Set config
|
|
186
|
+
codebase --set-config embedderProvider=ollama,embedderModelId=nomic-embed-text
|
|
187
|
+
codebase --set-config --global qdrantUrl=http://localhost:6333
|
|
93
188
|
```
|
|
94
|
-
## 🛠️ Usage
|
|
95
189
|
|
|
96
|
-
###
|
|
190
|
+
### Advanced Features
|
|
97
191
|
|
|
98
|
-
|
|
192
|
+
#### 🔍 LLM-Powered Search Reranking
|
|
193
|
+
Enable LLM reranking to dramatically improve search relevance:
|
|
99
194
|
|
|
100
|
-
#### 1. Interactive TUI Mode (Default)
|
|
101
195
|
```bash
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
codebase
|
|
196
|
+
# Enable reranking with Ollama (recommended)
|
|
197
|
+
codebase --set-config rerankerEnabled=true,rerankerProvider=ollama,rerankerOllamaModelId=qwen3-vl:4b-instruct
|
|
105
198
|
|
|
199
|
+
# Or use OpenAI-compatible providers
|
|
200
|
+
codebase --set-config rerankerEnabled=true,rerankerProvider=openai-compatible,rerankerOpenAiCompatibleModelId=deepseek-chat
|
|
106
201
|
|
|
107
|
-
#
|
|
108
|
-
codebase --
|
|
109
|
-
codebase --path=/my/project
|
|
110
|
-
codebase --path=/my/project --log-level=info
|
|
202
|
+
# Search with automatic reranking
|
|
203
|
+
codebase --search="user authentication" # Results are automatically reranked by LLM
|
|
111
204
|
```
|
|
112
205
|
|
|
113
|
-
|
|
206
|
+
**Benefits:**
|
|
207
|
+
- 🎯 **Higher precision**: LLM understands semantic relevance beyond vector similarity
|
|
208
|
+
- 📊 **Smart scoring**: Results are reranked on a 0-10 scale based on query relevance
|
|
209
|
+
- ⚡ **Batch processing**: Efficiently handles large result sets with configurable batch sizes
|
|
210
|
+
- 🎛️ **Threshold control**: Filter results with `rerankerMinScore` to keep only high-quality matches
|
|
211
|
+
|
|
212
|
+
#### Path Filtering & Export
|
|
114
213
|
```bash
|
|
115
|
-
#
|
|
116
|
-
|
|
117
|
-
codebase
|
|
214
|
+
# Path filtering with brace expansion and exclusions
|
|
215
|
+
codebase --search="API" --path-filters="src/**/*.ts,lib/**/*.js"
|
|
216
|
+
codebase --search="utils" --path-filters="{src,test}/**/*.ts"
|
|
118
217
|
|
|
119
|
-
#
|
|
120
|
-
codebase
|
|
121
|
-
codebase mcp-server --path=/workspace --port=3002
|
|
218
|
+
# Export results in JSON format for scripts
|
|
219
|
+
codebase --search="auth" --json
|
|
122
220
|
```
|
|
123
221
|
|
|
222
|
+
#### 📝 AI-Powered Code Outlines
|
|
223
|
+
Generate intelligent code summaries and outlines:
|
|
124
224
|
|
|
125
|
-
|
|
225
|
+
```bash
|
|
226
|
+
# Extract code structure
|
|
227
|
+
codebase --outline src/index.ts
|
|
126
228
|
|
|
127
|
-
|
|
229
|
+
# With AI summaries (recommended)
|
|
230
|
+
codebase --outline "src/**/*.ts" --summarize
|
|
128
231
|
|
|
129
|
-
|
|
232
|
+
# Preview before processing
|
|
233
|
+
codebase --outline "src/**/*.ts" --dry-run
|
|
130
234
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
4. **Built-in Defaults**
|
|
235
|
+
# Clear cache and regenerate
|
|
236
|
+
codebase --outline src/index.ts --summarize --clear-summarize-cache
|
|
237
|
+
```
|
|
135
238
|
|
|
136
|
-
|
|
239
|
+
**Key Benefits:**
|
|
240
|
+
- 🎯 **Function-level summaries**: Understand code purpose at a glance
|
|
241
|
+
- 💾 **Smart caching**: Avoid redundant LLM calls
|
|
242
|
+
- 🌐 **Multi-language**: English / Chinese support
|
|
243
|
+
- ⚡ **Batch processing**: Efficiently handle large codebases
|
|
137
244
|
|
|
138
|
-
|
|
139
|
-
- Global: `~/.autodev-cache/autodev-config.json`
|
|
140
|
-
- Project: `./autodev-config.json`
|
|
141
|
-
- CLI: Pass parameters directly when running commands
|
|
245
|
+
## ⚙️ Configuration
|
|
142
246
|
|
|
247
|
+
### Config Layers (Priority Order)
|
|
248
|
+
1. **CLI Arguments** - Runtime parameters (`--path`, `--config`, `--log-level`, `--force`, etc.)
|
|
249
|
+
2. **Project Config** - `./autodev-config.json` (or custom path via `--config`)
|
|
250
|
+
3. **Global Config** - `~/.autodev-cache/autodev-config.json`
|
|
251
|
+
4. **Built-in Defaults** - Fallback values
|
|
143
252
|
|
|
144
|
-
|
|
253
|
+
**Note:** CLI arguments provide runtime override for paths, logging, and operational behavior. For persistent configuration (embedderProvider, API keys, search parameters), use `--set-config` to save to config files.
|
|
145
254
|
|
|
146
|
-
|
|
255
|
+
### Common Config Examples
|
|
147
256
|
|
|
257
|
+
**Ollama:**
|
|
148
258
|
```json
|
|
149
259
|
{
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
|
|
153
|
-
"model": "dengcao/Qwen3-Embedding-0.6B:Q8_0",
|
|
154
|
-
"dimension": 1024,
|
|
155
|
-
"baseUrl": "http://localhost:11434"
|
|
156
|
-
},
|
|
157
|
-
"qdrantUrl": "http://localhost:6333",
|
|
158
|
-
"qdrantApiKey": "your-api-key-if-needed",
|
|
159
|
-
"searchMinScore": 0.4
|
|
260
|
+
"embedderProvider": "ollama",
|
|
261
|
+
"embedderModelId": "nomic-embed-text",
|
|
262
|
+
"qdrantUrl": "http://localhost:6333"
|
|
160
263
|
}
|
|
161
264
|
```
|
|
162
265
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
Create a project-specific configuration file at `./autodev-config.json`:
|
|
166
|
-
|
|
266
|
+
**OpenAI:**
|
|
167
267
|
```json
|
|
168
268
|
{
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"model": "openai/text-embedding-3-smallnpm",
|
|
174
|
-
"dimension": 1536,
|
|
175
|
-
},
|
|
176
|
-
"qdrantUrl": "http://localhost:6334"
|
|
269
|
+
"embedderProvider": "openai",
|
|
270
|
+
"embedderModelId": "text-embedding-3-small",
|
|
271
|
+
"embedderOpenAiApiKey": "sk-your-key",
|
|
272
|
+
"qdrantUrl": "http://localhost:6333"
|
|
177
273
|
}
|
|
178
274
|
```
|
|
179
275
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
| `embedder.apiKey` | string | API key (for OpenAI/compatible providers) | - |
|
|
190
|
-
| `qdrantUrl` | string | Qdrant vector database URL | `http://localhost:6333` |
|
|
191
|
-
| `qdrantApiKey` | string | Qdrant API key (if authentication enabled) | - |
|
|
192
|
-
| `searchMinScore` | number | Minimum similarity score for search results | `0.4` |
|
|
193
|
-
|
|
194
|
-
**Note**: The `isConfigured` field is automatically calculated based on the completeness of your configuration and should not be set manually. The system will determine if the configuration is valid based on the required fields for your chosen provider.
|
|
195
|
-
|
|
196
|
-
#### Configuration Priority Examples
|
|
276
|
+
**OpenAI-Compatible:**
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"embedderProvider": "openai-compatible",
|
|
280
|
+
"embedderModelId": "text-embedding-3-small",
|
|
281
|
+
"embedderOpenAiCompatibleApiKey": "sk-your-key",
|
|
282
|
+
"embedderOpenAiCompatibleBaseUrl": "https://api.openai.com/v1"
|
|
283
|
+
}
|
|
284
|
+
```
|
|
197
285
|
|
|
286
|
+
### Key Configuration Options
|
|
287
|
+
|
|
288
|
+
| Category | Options | Description |
|
|
289
|
+
|----------|---------|-------------|
|
|
290
|
+
| **Embedding** | `embedderProvider`, `embedderModelId`, `embedderModelDimension` | Provider and model settings |
|
|
291
|
+
| **API Keys** | `embedderOpenAiApiKey`, `embedderOpenAiCompatibleApiKey` | Authentication |
|
|
292
|
+
| **Vector Store** | `qdrantUrl`, `qdrantApiKey` | Qdrant connection |
|
|
293
|
+
| **Search** | `vectorSearchMinScore`, `vectorSearchMaxResults` | Search behavior |
|
|
294
|
+
| **Reranker** | `rerankerEnabled`, `rerankerProvider` | Result reranking |
|
|
295
|
+
| **Summarizer** | `summarizerProvider`, `summarizerLanguage`, `summarizerBatchSize` | AI summary generation |
|
|
296
|
+
|
|
297
|
+
**Key CLI Arguments:**
|
|
298
|
+
- `--serve` / `--index` / `--search` - Core operations
|
|
299
|
+
- `--outline <pattern>` - Extract code outlines (supports glob patterns)
|
|
300
|
+
- `--summarize` - Generate AI summaries for code outlines
|
|
301
|
+
- `--dry-run` - Preview operations before execution
|
|
302
|
+
- `--title` - Show only file-level summaries
|
|
303
|
+
- `--clear-summarize-cache` - Clear all summary caches
|
|
304
|
+
- `--get-config` / `--set-config` - Configuration management
|
|
305
|
+
- `--path`, `--demo`, `--force` - Common options
|
|
306
|
+
- `--limit` / `-l <number>` - Maximum number of search results (default: from config, max 50)
|
|
307
|
+
- `--min-score` / `-S <number>` - Minimum similarity score for search results (0-1, default: from config)
|
|
308
|
+
- `--help` - Show all available options
|
|
309
|
+
|
|
310
|
+
For complete CLI reference, see [CONFIG.md](CONFIG.md).
|
|
311
|
+
|
|
312
|
+
**Configuration Commands:**
|
|
198
313
|
```bash
|
|
199
|
-
#
|
|
200
|
-
codebase
|
|
201
|
-
|
|
202
|
-
# Override model via CLI (highest priority)
|
|
203
|
-
codebase --model="custom-model"
|
|
204
|
-
|
|
205
|
-
# Use project config with CLI overrides
|
|
206
|
-
codebase --config=./my-config.json --qdrant-url=http://remote:6333
|
|
207
|
-
```
|
|
314
|
+
# View config
|
|
315
|
+
codebase --get-config
|
|
316
|
+
codebase --get-config --json
|
|
208
317
|
|
|
209
|
-
|
|
318
|
+
# Set config (saves to file)
|
|
319
|
+
codebase --set-config embedderProvider=ollama,embedderModelId=nomic-embed-text
|
|
320
|
+
codebase --set-config --global embedderProvider=openai,embedderOpenAiApiKey=sk-xxx
|
|
210
321
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- `--force` - ignore cache force re-index
|
|
215
|
-
- `--ollama-url=<url>` - Ollama API URL (default: http://localhost:11434)
|
|
216
|
-
- `--qdrant-url=<url>` - Qdrant vector DB URL (default: http://localhost:6333)
|
|
217
|
-
- `--model=<model>` - Embedding model (default: nomic-embed-text)
|
|
218
|
-
- `--config=<path>` - Config file path
|
|
219
|
-
- `--storage=<path>` - Storage directory path
|
|
220
|
-
- `--cache=<path>` - Cache directory path
|
|
221
|
-
- `--log-level=<level>` - Log level: error|warn|info|debug (default: error)
|
|
222
|
-
- `--log-level=<level>` - Log level: error|warn|info|debug (default: error)
|
|
223
|
-
- `--help, -h` - Show help
|
|
322
|
+
# Use custom config file
|
|
323
|
+
codebase --config=/path/to/config.json --get-config
|
|
324
|
+
codebase --config=/path/to/config.json --set-config embedderProvider=ollama
|
|
224
325
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
326
|
+
# Runtime override (paths, logging, etc.)
|
|
327
|
+
codebase --index --path=/my/project --log-level=info --force
|
|
328
|
+
```
|
|
228
329
|
|
|
330
|
+
For complete configuration reference, see [CONFIG.md](CONFIG.md).
|
|
229
331
|
|
|
230
|
-
|
|
332
|
+
## 🔌 MCP Integration
|
|
231
333
|
|
|
232
|
-
|
|
334
|
+
### HTTP Streamable Mode (Recommended)
|
|
335
|
+
```bash
|
|
336
|
+
codebase --serve --port=3001
|
|
337
|
+
```
|
|
233
338
|
|
|
339
|
+
**IDE Config:**
|
|
234
340
|
```json
|
|
235
341
|
{
|
|
236
342
|
"mcpServers": {
|
|
237
343
|
"codebase": {
|
|
238
|
-
"url": "http://localhost:3001/
|
|
344
|
+
"url": "http://localhost:3001/mcp"
|
|
239
345
|
}
|
|
240
346
|
}
|
|
241
347
|
}
|
|
242
348
|
```
|
|
243
349
|
|
|
244
|
-
|
|
350
|
+
### Stdio Adapter
|
|
351
|
+
```bash
|
|
352
|
+
# First start the MCP server in one terminal
|
|
353
|
+
codebase --serve --port=3001
|
|
245
354
|
|
|
355
|
+
# Then connect via stdio adapter in another terminal (for IDEs that require stdio)
|
|
356
|
+
codebase --stdio-adapter --server-url=http://localhost:3001/mcp
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**IDE Config:**
|
|
246
360
|
```json
|
|
247
361
|
{
|
|
248
362
|
"mcpServers": {
|
|
249
363
|
"codebase": {
|
|
250
364
|
"command": "codebase",
|
|
251
|
-
"args": [
|
|
252
|
-
"stdio-adapter",
|
|
253
|
-
"--server-url=http://localhost:3001/sse"
|
|
254
|
-
]
|
|
365
|
+
"args": ["stdio-adapter", "--server-url=http://localhost:3001/mcp"]
|
|
255
366
|
}
|
|
256
367
|
}
|
|
257
368
|
}
|
|
258
369
|
```
|
|
259
|
-
## 🌐 MCP Server Features
|
|
260
370
|
|
|
261
|
-
|
|
262
|
-
- **Home Page**: `http://localhost:3001` - Server status and configuration
|
|
263
|
-
- **Health Check**: `http://localhost:3001/health` - JSON status endpoint
|
|
264
|
-
- **MCP Endpoint**: `http://localhost:3001/sse` - SSE/HTTP MCP protocol endpoint
|
|
371
|
+
## 🤝 Contributing
|
|
265
372
|
|
|
266
|
-
|
|
267
|
-
- **`search_codebase`** - Semantic search through your codebase
|
|
268
|
-
- Parameters: `query` (string), `limit` (number), `filters` (object)
|
|
269
|
-
- Returns: Formatted search results with file paths, scores, and code blocks
|
|
373
|
+
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue on [GitHub](https://github.com/anrgct/autodev-codebase).
|
|
270
374
|
|
|
375
|
+
## 📄 License
|
|
271
376
|
|
|
377
|
+
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
|
272
378
|
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
# Development mode with demo files
|
|
276
|
-
npm run dev
|
|
379
|
+
## 🙏 Acknowledgments
|
|
277
380
|
|
|
278
|
-
|
|
279
|
-
npm run build
|
|
381
|
+
This project is a fork and derivative work based on [Roo Code](https://github.com/RooCodeInc/Roo-Code). We've built upon their excellent foundation to create this specialized codebase analysis tool with enhanced features and MCP server capabilities.
|
|
280
382
|
|
|
281
|
-
|
|
282
|
-
npm run type-check
|
|
383
|
+
---
|
|
283
384
|
|
|
284
|
-
|
|
285
|
-
npm run demo-tui
|
|
385
|
+
<div align="center">
|
|
286
386
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
387
|
+
**🌟 If you find this tool helpful, please give us a [star on GitHub](https://github.com/anrgct/autodev-codebase)!**
|
|
388
|
+
|
|
389
|
+
Made with ❤️ for the developer community
|
|
290
390
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
**Mainstream Embedding Models Performance**
|
|
294
|
-
|
|
295
|
-
| Model | Dimension | Avg Precision@3 | Avg Precision@5 | Good Queries (≥66.7%) | Failed Queries (0%) |
|
|
296
|
-
| ------------------------------------------------ | --------- | --------------- | --------------- | --------------------- | ------------------- |
|
|
297
|
-
| siliconflow/Qwen/Qwen3-Embedding-8B | 4096 | **76.7%** | 66.0% | 5/10 | 0/10 |
|
|
298
|
-
| siliconflow/Qwen/Qwen3-Embedding-4B | 2560 | **73.3%** | 54.0% | 5/10 | 1/10 |
|
|
299
|
-
| voyage/voyage-code-3 | 1024 | **73.3%** | 52.0% | 6/10 | 1/10 |
|
|
300
|
-
| siliconflow/Qwen/Qwen3-Embedding-0.6B | 1024 | **63.3%** | 42.0% | 4/10 | 1/10 |
|
|
301
|
-
| morph-embedding-v2 | 1536 | **56.7%** | 44.0% | 3/10 | 1/10 |
|
|
302
|
-
| openai/text-embedding-ada-002 | 1536 | **53.3%** | 38.0% | 2/10 | 1/10 |
|
|
303
|
-
| voyage/voyage-3-large | 1024 | **53.3%** | 42.0% | 3/10 | 2/10 |
|
|
304
|
-
| openai/text-embedding-3-large | 3072 | **46.7%** | 38.0% | 1/10 | 3/10 |
|
|
305
|
-
| voyage/voyage-3.5 | 1024 | **43.3%** | 38.0% | 1/10 | 2/10 |
|
|
306
|
-
| voyage/voyage-3.5-lite | 1024 | **36.7%** | 28.0% | 1/10 | 2/10 |
|
|
307
|
-
| openai/text-embedding-3-small | 1536 | **33.3%** | 28.0% | 1/10 | 4/10 |
|
|
308
|
-
| siliconflow/BAAI/bge-large-en-v1.5 | 1024 | **30.0%** | 28.0% | 0/10 | 3/10 |
|
|
309
|
-
| siliconflow/Pro/BAAI/bge-m3 | 1024 | **26.7%** | 24.0% | 0/10 | 2/10 |
|
|
310
|
-
| ollama/nomic-embed-text | 768 | **16.7%** | 18.0% | 0/10 | 6/10 |
|
|
311
|
-
| siliconflow/netease-youdao/bce-embedding-base_v1 | 1024 | **13.3%** | 16.0% | 0/10 | 6/10 |
|
|
312
|
-
|
|
313
|
-
------
|
|
314
|
-
|
|
315
|
-
**Ollama-based Embedding Models Performance**
|
|
316
|
-
|
|
317
|
-
| Model | Dimension | Precision@3 | Precision@5 | Good Queries (≥66.7%) | Failed Queries (0%) |
|
|
318
|
-
| -------------------------------------------------------- | --------- | ----------- | ----------- | --------------------- | ------------------- |
|
|
319
|
-
| ollama/dengcao/Qwen3-Embedding-4B:Q4_K_M | 2560 | 66.7% | 48.0% | 4/10 | 1/10 |
|
|
320
|
-
| ollama/dengcao/Qwen3-Embedding-0.6B:f16 | 1024 | 63.3% | 44.0% | 3/10 | 0/10 |
|
|
321
|
-
| ollama/dengcao/Qwen3-Embedding-0.6B:Q8_0 | 1024 | 63.3% | 44.0% | 3/10 | 0/10 |
|
|
322
|
-
| ollama/dengcao/Qwen3-Embedding-4B:Q8_0 | 2560 | 60.0% | 48.0% | 3/10 | 1/10 |
|
|
323
|
-
| lmstudio/taylor-jones/bge-code-v1-Q8_0-GGUF | 1536 | 60.0% | 54.0% | 4/10 | 1/10 |
|
|
324
|
-
| ollama/dengcao/Qwen3-Embedding-8B:Q4_K_M | 4096 | 56.7% | 42.0% | 2/10 | 2/10 |
|
|
325
|
-
| ollama/hf.co/nomic-ai/nomic-embed-code-GGUF:Q4_K_M | 3584 | 53.3% | 44.0% | 2/10 | 0/10 |
|
|
326
|
-
| ollama/bge-m3:f16 | 1024 | 26.7% | 24.0% | 0/10 | 2/10 |
|
|
327
|
-
| ollama/hf.co/nomic-ai/nomic-embed-text-v2-moe-GGUF:f16 | 768 | 26.7% | 20.0% | 0/10 | 2/10 |
|
|
328
|
-
| ollama/granite-embedding:278m-fp16 | 768 | 23.3% | 18.0% | 0/10 | 4/10 |
|
|
329
|
-
| ollama/unclemusclez/jina-embeddings-v2-base-code:f16 | 768 | 23.3% | 16.0% | 0/10 | 5/10 |
|
|
330
|
-
| lmstudio/awhiteside/CodeRankEmbed-Q8_0-GGUF | 768 | 23.3% | 16.0% | 0/10 | 5/10 |
|
|
331
|
-
| lmstudio/wsxiaoys/jina-embeddings-v2-base-code-Q8_0-GGUF | 768 | 23.3% | 16.0% | 0/10 | 5/10 |
|
|
332
|
-
| ollama/dengcao/Dmeta-embedding-zh:F16 | 768 | 20.0% | 20.0% | 0/10 | 6/10 |
|
|
333
|
-
| ollama/znbang/bge:small-en-v1.5-q8_0 | 384 | 16.7% | 16.0% | 0/10 | 6/10 |
|
|
334
|
-
| lmstudio/nomic-ai/nomic-embed-text-v1.5-GGUF@Q4_K_M | 768 | 16.7% | 14.0% | 0/10 | 6/10 |
|
|
335
|
-
| ollama/nomic-embed-text:f16 | 768 | 16.7% | 18.0% | 0/10 | 6/10 |
|
|
336
|
-
| ollama/snowflake-arctic-embed2:568m:f16 | 1024 | 16.7% | 18.0% | 0/10 | 5/10 |
|
|
391
|
+
</div>
|