Skip to content
Back to search

autodev-codebase

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/anrgct--autodev-codebase/badge.svg)](/listings/anrgct--autodev-codebase)

HTML

<a href="/listings/anrgct--autodev-codebase"><img src="/api/listings/anrgct--autodev-codebase/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Dependencies

brew install ollama ripgrep
ollama serve
ollama pull nomic-embed-text

2. Qdrant

docker run -d -p 6333:6333 -p 6334:6334 --name qdrant qdrant/qdrant

3. Install

npm install -g @autodev/codebase
codebase config --set embedderProvider=ollama,embedderModelId=nomic-embed-text

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 414 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # @autodev/codebase
  2. <p align="center">
  3. [![npm version](https://img.shields.io/npm/v/@autodev/codebase)](https://www.npmjs.com/package/@autodev/codebase)
  4. [![GitHub stars](https://img.shields.io/github/stars/anrgct/autodev-codebase)](https://github.com/anrgct/autodev-codebase)
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  6. </p>
  7. 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.
  8. ```sh
  9. # Semantic code search - Find code by meaning, not just keywords
  10. ╭─ ~/workspace/autodev-codebase
  11. ╰─❯ codebase search "user manage" --demo
  12. Found 20 results in 5 files for: "user manage"
  13. ==================================================
  14. File: "hello.js"
  15. ==================================================
  16. < class UserManager > (L7-20)
  17. class UserManager {
  18. constructor() {
  19. this.users = [];
  20. }
  21. addUser(user) {
  22. this.users.push(user);
  23. console.log('User added:', user.name);
  24. }
  25. getUsers() {
  26. return this.users;
  27. }
  28. }
  29. ……
  30. # Call graph analysis - Trace function call relationships and execution paths
  31. ╭─ ~/workspace/autodev-codebase
  32. ╰─❯ codebase call --demo --query="app,addUser"
  33. Connections between app, addUser:
  34. Found 2 matching node(s):
  35. - demo/app:L1-29
  36. - demo/hello.UserManager.addUser:L12-15
  37. Direct connections:
  38. - demo/app:L1-29 → demo/hello.UserManager.addUser:L12-15
  39. Chains found:
  40. - demo/app:L1-29 → demo/hello.UserManager.addUser:L12-15
  41. # Code outline with AI summaries - Understand code structure at a glance
  42. ╭─ ~/workspace/autodev-codebase
  43. ╰─❯ codebase outline 'hello.js' --demo --summarize
  44. # hello.js (23 lines)
  45. └─ Defines a greeting function that logs a personalized hello message and returns a welcome string. Implements a UserManager class managing an array of users with methods to add users and retrieve the current user list. Exports both components for external use.
  46. 2--5 | function greetUser
  47. └─ Implements user greeting logic by logging a personalized hello message and returning a welcome message
  48. 7--20 | class UserManager
  49. └─ Manages user data with methods to add users to a list and retrieve all stored users
  50. 12--15 | method addUser
  51. └─ Adds a user to the users array and logs a confirmation message with the user's name.
  52. ```
  53. ## 🚀 Features
  54. - **🔍 Semantic Code Search**: Vector-based search using advanced embedding models
  55. - **🔗 Call Graph Analysis**: Trace function call relationships and execution paths
  56. - **🌐 MCP Server**: HTTP-based MCP server with SSE and stdio adapters
  57. - **💻 Pure CLI Tool**: Standalone command-line interface without GUI dependencies
  58. - **⚙️ Layered Configuration**: CLI, project, and global config management
  59. - **🎯 Advanced Path Filtering**: Glob patterns with brace expansion and exclusions
  60. - **🌲 Tree-sitter Parsing**: Support for 40+ programming languages
  61. - **💾 Qdrant Integration**: High-performance vector database
  62. - **🔄 Multiple Providers**: OpenAI, Ollama, Jina, Gemini, Mistral, OpenRouter, Vercel
  63. - **📊 Real-time Watching**: Automatic index updates
  64. - **⚡ Batch Processing**: Efficient parallel processing
  65. - **📝 Code Outline Extraction**: Generate structured code outlines with AI summaries
  66. - **💨 Dependency Analysis Cache**: Intelligent caching for 10-50x faster re-analysis
  67. ## 📦 Installation
  68. ### 1. Dependencies
  69. ```bash
  70. brew install ollama ripgrep
  71. ollama serve
  72. ollama pull nomic-embed-text
  73. ```
  74. ### 2. Qdrant
  75. ```bash
  76. docker run -d -p 6333:6333 -p 6334:6334 --name qdrant qdrant/qdrant
  77. ```
  78. ### 3. Install
  79. ```bash
  80. npm install -g @autodev/codebase
  81. codebase config --set embedderProvider=ollama,embedderModelId=nomic-embed-text
  82. ```
  83. ## 🛠️ Quick Start
  84. ```bash
  85. # Demo mode (recommended for first-time)
  86. # Creates a demo directory in current working directory for testing
  87. # Index & search
  88. codebase index --demo
  89. codebase search "user greet" --demo
  90. # Call graph analysis
  91. codebase call --demo --query="app,addUser"
  92. # MCP server
  93. codebase index --serve --demo
  94. ```
  95. ## 📋 Commands
  96. ### 📝 Code Outlines
  97. ```bash
  98. # Extract code structure (functions, classes, methods)
  99. codebase outline "src/**/*.ts"
  100. # Generate code structure with AI summaries
  101. codebase outline "src/**/*.ts" --summarize
  102. # View only file-level summaries
  103. codebase outline "src/**/*.ts" --summarize --title
  104. # Clear summary cache
  105. codebase outline --clear-summarize-cache
  106. ```
  107. ### 🔗 Call Graph Analysis
  108. ```bash
  109. # 📊 Statistics Overview (no --query)
  110. codebase call # Show statistics overview
  111. codebase call --json # JSON format
  112. codebase call src/commands # Analyze specific directory
  113. # 🔍 Function Query (with --query)
  114. codebase call --query="getUser" # Single function call tree (default depth: 3)
  115. codebase call --query="main" --depth=5 # Custom depth
  116. codebase call --query="getUser,validateUser" # Multi-function connections (default depth: 10)
  117. # 🎨 Visualization
  118. codebase call --viz graph.json # Export Cytoscape.js format
  119. codebase call --open # Open interactive viewer
  120. codebase call --viz graph.json --open # Export and open
  121. # Specify workspace (works for both modes)
  122. codebase call --path=/my/project --query="main"
  123. ```
  124. **Query Patterns:**
  125. - **Exact match**: `--query="functionName"` or `--query="*ClassName.methodName"`
  126. - **Wildcards**: `*` (any characters), `?` (single character)
  127. - Examples: `--query="get*"`, `--query="*User*"`, `--query="*.*.get*"`
  128. - **Single function**: `--query="main"` - Shows call tree (upward + downward)
  129. - Default depth: **3** (avoids excessive output)
  130. - **Multiple functions**: `--query="main,helper"` - Analyzes connection paths between functions
  131. - Default depth: **10** (deeper search needed for path finding)
  132. **Supported Languages:**
  133. - **TypeScript/JavaScript** (.ts, .tsx, .js, .jsx)
  134. - **Python** (.py)
  135. - **Java** (.java)
  136. - **C/C++** (.c, .h, .cpp, .cc, .cxx, .hpp, .hxx, .c++)
  137. - **C#** (.cs)
  138. - **Rust** (.rs)
  139. - **Go** (.go)
  140. ### 🔍 Indexing & Search
  141. ```bash
  142. # Index the codebase
  143. codebase index --path=/my/project --force
  144. # Search with filters
  145. codebase search "error handling" --path-filters="src/**/*.ts"
  146. # Search with custom limit and minimum score
  147. codebase search "authentication" --limit=20 --min-score=0.7
  148. codebase search "API" -l 30 -S 0.5
  149. # Search in JSON format
  150. codebase search "authentication" --json
  151. # Clear index data
  152. codebase index --clear-cache --path=/my/project
  153. ```
  154. ### 🌐 MCP Server
  155. ```bash
  156. # HTTP mode (recommended)
  157. codebase index --serve --port=3001 --path=/my/project
  158. # Stdio adapter
  159. codebase stdio --server-url=http://localhost:3001/mcp
  160. ```
  161. ### ⚙️ Configuration
  162. ```bash
  163. # View config
  164. codebase config --get
  165. codebase config --get embedderProvider --json
  166. # Set config
  167. codebase config --set embedderProvider=ollama,embedderModelId=nomic-embed-text
  168. codebase config --set --global qdrantUrl=http://localhost:6333
  169. ```
  170. ### 🚀 Advanced Features
  171. #### 🔍 LLM-Powered Search Reranking
  172. Enable LLM reranking to dramatically improve search relevance:
  173. ```bash
  174. # Enable reranking with Ollama (recommended)
  175. codebase config --set rerankerEnabled=true,rerankerProvider=ollama,rerankerOllamaModelId=qwen3-vl:4b-instruct
  176. # Or use OpenAI-compatible providers
  177. codebase config --set rerankerEnabled=true,rerankerProvider=openai-compatible,rerankerOpenAiCompatibleModelId=deepseek-chat
  178. # Search with automatic reranking
  179. codebase search "user authentication" # Results are automatically reranked by LLM
  180. ```
  181. **Benefits:**
  182. - 🎯 **Higher precision**: LLM understands semantic relevance beyond vector similarity
  183. - 📊 **Smart scoring**: Results are reranked on a 0-10 scale based on query relevance
  184. - ⚡ **Batch processing**: Efficiently handles large result sets with configurable batch sizes
  185. - 🎛️ **Threshold control**: Filter results with `rerankerMinScore` to keep only high-quality matches
  186. #### Path Filtering & Export
  187. ```bash
  188. # Path filtering with brace expansion and exclusions
  189. codebase search "API" --path-filters="src/**/*.ts,lib/**/*.js"
  190. codebase search "utils" --path-filters="{src,test}/**/*.ts"
  191. # Export results in JSON format for scripts
  192. codebase search "auth" --json
  193. ```
  194. #### Path Filtering & Export
  195. ```bash
  196. # Path filtering with brace expansion and exclusions
  197. codebase search "API" --path-filters="src/**/*.ts,lib/**/*.js"
  198. codebase search "utils" --path-filters="{src,test}/**/*.ts"
  199. # Export results in JSON format for scripts
  200. codebase search "auth" --json
  201. ```
  202. ## ⚙️ Configuration
  203. ### Config Layers (Priority Order)
  204. 1. **CLI Arguments** - Runtime parameters (`--path`, `--config`, `--log-level`, `--force`, etc.)
  205. 2. **Project Config** - `./autodev-config.json` (or custom path via `--config`)
  206. 3. **Global Config** - `~/.autodev-cache/autodev-config.json`
  207. 4. **Built-in Defaults** - Fallback values
  208. **Note:** CLI arguments provide runtime override for paths, logging, and operational behavior. For persistent configuration (embedderProvider, API keys, search parameters), use `config --set` to save to config files.
  209. ### Common Config Examples
  210. **Ollama:**
  211. ```json
  212. {
  213. "embedderProvider": "ollama",
  214. "embedderModelId": "nomic-embed-text",
  215. "qdrantUrl": "http://localhost:6333"
  216. }
  217. ```
  218. **OpenAI:**
  219. ```json
  220. {
  221. "embedderProvider": "openai",
  222. "embedderModelId": "text-embedding-3-small",
  223. "embedderOpenAiApiKey": "sk-your-key",
  224. "qdrantUrl": "http://localhost:6333"
  225. }
  226. ```
  227. **OpenAI-Compatible:**
  228. ```json
  229. {
  230. "embedderProvider": "openai-compatible",
  231. "embedderModelId": "text-embedding-3-small",
  232. "embedderOpenAiCompatibleApiKey": "sk-your-key",
  233. "embedderOpenAiCompatibleBaseUrl": "https://api.openai.com/v1"
  234. }
  235. ```
  236. ### Key Configuration Options
  237. | Category | Options | Description |
  238. |----------|---------|-------------|
  239. | **Embedding** | `embedderProvider`, `embedderModelId`, `embedderModelDimension` | Provider and model settings |
  240. | **API Keys** | `embedderOpenAiApiKey`, `embedderOpenAiCompatibleApiKey` | Authentication |
  241. | **Vector Store** | `qdrantUrl`, `qdrantApiKey` | Qdrant connection |
  242. | **Search** | `vectorSearchMinScore`, `vectorSearchMaxResults` | Search behavior |
  243. | **Reranker** | `rerankerEnabled`, `rerankerProvider` | Result reranking |
  244. | **Summarizer** | `summarizerProvider`, `summarizerLanguage`, `summarizerBatchSize` | AI summary generation |
  245. **Key CLI Arguments:**
  246. - `index` - Index the codebase
  247. - `search <query>` - Search the codebase (required positional argument)
  248. - `outline <pattern>` - Extract code outlines (supports glob patterns)
  249. - `call` - Analyze function call relationships and dependency graphs
  250. - `stdio` - Start stdio adapter for MCP
  251. - `config` - Manage configuration (use with --get or --set)
  252. - `--serve` - Start MCP HTTP server (use with `index` command)
  253. - `--summarize` - Generate AI summaries for code outlines
  254. - `--dry-run` - Preview operations before execution
  255. - `--title` - Show only file-level summaries
  256. - `--clear-summarize-cache` - Clear all summary caches
  257. - `--path`, `--demo`, `--force` - Common options
  258. - `--limit` / `-l <number>` - Maximum number of search results (default: from config, max 50)
  259. - `--min-score` / `-S <number>` - Minimum similarity score for search results (0-1, default: from config)
  260. - `--query <patterns>` - Query patterns for call graph analysis (comma-separated)
  261. - `--viz <file>` - Export full dependency data for visualization (cannot use with --query)
  262. - `--open` - Open interactive graph viewer
  263. - `--depth <number>` - Set analysis depth for call graphs
  264. - `--help` - Show all available options
  265. **Configuration Commands:**
  266. ```bash
  267. # View config
  268. codebase config --get
  269. codebase config --get --json
  270. # Set config (saves to file)
  271. codebase config --set embedderProvider=ollama,embedderModelId=nomic-embed-text
  272. codebase config --set --global embedderProvider=openai,embedderOpenAiApiKey=sk-xxx
  273. # Use custom config file
  274. codebase --config=/path/to/config.json config --get
  275. codebase --config=/path/to/config.json config --set embedderProvider=ollama
  276. # Runtime override (paths, logging, etc.)
  277. codebase index --path=/my/project --log-level=info --force
  278. ```
  279. For complete configuration reference, see [CONFIG.md](CONFIG.md).
  280. ## 🔌 MCP Integration
  281. ### HTTP Streamable Mode (Recommended)
  282. ```bash
  283. codebase index --serve --port=3001
  284. ```
  285. **IDE Config:**
  286. ```json
  287. {
  288. "mcpServers": {
  289. "codebase": {
  290. "url": "http://localhost:3001/mcp"
  291. }
  292. }
  293. }
  294. ```
  295. ### Stdio Adapter
  296. ```bash
  297. # First start the MCP server in one terminal
  298. codebase index --serve --port=3001
  299. # Then connect via stdio adapter in another terminal (for IDEs that require stdio)
  300. codebase stdio --server-url=http://localhost:3001/mcp
  301. ```
  302. **IDE Config:**
  303. ```json
  304. {
  305. "mcpServers": {
  306. "codebase": {
  307. "command": "codebase",
  308. "args": ["stdio", "--server-url=http://localhost:3001/mcp"]
  309. }
  310. }
  311. }
  312. ```
  313. ## 🤝 Contributing
  314. Contributions are welcome! Please feel free to submit a Pull Request or open an Issue on [GitHub](https://github.com/anrgct/autodev-codebase).
  315. ## 📄 License
  316. This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
  317. ## 🙏 Acknowledgments
  318. 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.
  319. ---
  320. <div align="center">
  321. **🌟 If you find this tool helpful, please give us a [star on GitHub](https://github.com/anrgct/autodev-codebase)!**
  322. Made with ❤️ for the developer community
  323. </div>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.