Code Dock is a comprehensive solution for code search, exploration, and analysis, enabling seamless interaction with codebases through AI-powered search capabilities.
For detailed documentation, please refer to:
- Installation Guide - Detailed setup instructions
- User Guide - How to use the platform
- API Reference - API endpoint documentation
- MCP Tools Guide - LLM integration via MCP
- Docker Deployment - Containerized deployment
- Development Guide - Contributing to Code Dock
-
Multiple Search Modes
- Standard semantic search (RAG-based)
- Advanced AI-powered search with LLM assistance
- Text-based keyword search
-
Code Understanding
- Abstract Syntax Tree (AST) visualization
- Symbol reference tracking
- File and directory exploration
-
Rich UI Experience
- Interactive web interface
- Real-time search with WebSocket feedback
- Visual code structure exploration
-
LLM Integration
- MCP (Model Context Protocol) tools for direct LLM interaction
- Support for Claude, Qwen Plus, GPT-4 and other language models
- Agent-based intelligent exploration
The system consists of three main components:
-
Backend (Python)
- Core search and indexing engine powered by FastAPI
- Tree-sitter powered code parsing for multiple languages
- LanceDB vector database for embeddings storage
- OpenAI and VoyageAI compatible embedding generation
-
Web Frontend
- Modern HTML/CSS/JavaScript interface
- WebSocket-based real-time communication
- Interactive visualization components
-
MCP Integration
- Tools for seamless LLM integration
- Support for Claude Desktop App
- Rich toolset for codebase exploration
# Clone the repository
git clone [repository-url]
cd code-dock
# Set up environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env with your settings
# Start the server
python web_server.py
# Access web interface
# Open http://localhost:30089 in your browserFor Docker deployment:
# Navigate to deployment directory
cd code-dock-deploy
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start container
docker-compose up -dFor detailed instructions, see the Installation Guide and Docker Deployment.
code-dock/
├── api.py # Main API implementation
├── web_server.py # Web server setup
├── code_dock/ # Core functionality
│ ├── strong_search_agent.py # LLM-powered search
│ ├── treesitter.py # Code parsing
│ ├── indexer.py # Codebase indexing
│ └── ...
├── web/ # Frontend implementation
├── code_dock_mcp/ # MCP tools
└── code-dock-deploy/ # Docker deployment files
MIT
Code Dock 是一个全面的代码搜索、探索和分析解决方案,通过AI驱动的搜索功能实现与代码库的无缝交互。
详细文档请参考:
-
多种搜索模式
- 标准语义搜索(基于RAG)
- 高级AI驱动搜索(LLM辅助)
- 基于文本的关键词搜索
-
代码理解
- 抽象语法树(AST)可视化
- 符号引用追踪
- 文件和目录浏览
-
丰富的用户界面
- 交互式Web界面
- 基于WebSocket的实时搜索反馈
- 可视化代码结构探索
-
LLM集成
- MCP(Model Context Protocol)工具实现LLM直接交互
- 支持Claude、通义千问、GPT-4等大型语言模型
- 基于代理的智能探索
系统由三个主要组件组成:
-
后端(Python)
- 基于FastAPI的核心搜索和索引引擎
- 使用Tree-sitter进行多语言代码解析
- 使用LanceDB向量数据库存储嵌入向量
- 兼容OpenAI和VoyageAI的嵌入生成
-
Web前端
- 现代HTML/CSS/JavaScript界面
- 基于WebSocket的实时通信
- 交互式可视化组件
-
MCP集成
- 用于无缝LLM集成的工具
- 支持Claude Desktop App
- 丰富的代码库探索工具集
# 克隆仓库
git clone [仓库地址]
cd code-dock
# 设置环境
python -m venv venv
source venv/bin/activate # Windows系统: venv\Scripts\activate
pip install -r requirements.txt
# 配置环境变量
cp .env.example .env
# 编辑.env设置
# 启动服务器
python web_server.py
# 访问Web界面
# 在浏览器中打开 http://localhost:30089Docker部署:
# 进入部署目录
cd code-dock-deploy
# 配置环境
cp .env.example .env
# 编辑.env设置
# 启动容器
docker-compose up -dcode-dock/
├── api.py # 主要API实现
├── web_server.py # Web服务器设置
├── code_dock/ # 核心功能
│ ├── strong_search_agent.py # LLM驱动搜索
│ ├── treesitter.py # 代码解析
│ ├── indexer.py # 代码库索引
│ └── ...
├── web/ # 前端实现
├── code_dock_mcp/ # MCP工具
└── code-dock-deploy/ # Docker部署文件
MIT