[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-HKUDS--FastCode":3,"tool-HKUDS--FastCode":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150720,2,"2026-04-11T11:33:10",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":103,"forks":104,"last_commit_at":105,"license":75,"difficulty_score":32,"env_os":106,"env_gpu":107,"env_ram":108,"env_deps":109,"category_tags":116,"github_topics":75,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":117,"updated_at":118,"faqs":119,"releases":165},6667,"HKUDS\u002FFastCode","FastCode","\"FastCode: Accelerating and Streamlining Your Code Understanding\"","FastCode 是一款专为高效代码理解与分析打造的开源框架，旨在帮助开发者快速掌握大型代码库的结构与逻辑。面对日益庞大的软件架构，传统工具往往存在响应慢、成本高且准确率不足的问题，FastCode 通过创新的三阶段处理流程，实现了比主流工具快 2 至 4 倍的运行速度，同时大幅降低约 50% 的使用成本，并在准确性上表现更优。\n\n它特别适合需要频繁阅读、维护或重构复杂项目的软件开发人员、技术研究人员以及架构师使用。无论是单人开发还是团队协作，FastCode 都能提供流畅的代码探索体验。其核心技术亮点包括：基于抽象语法树（AST）的多层级代码索引，支持 Python、Java、Go 等八种主流语言；结合语义嵌入与关键词搜索的混合检索机制，确保查找精准；以及构建调用、依赖和继承三层关系图谱，实现智能化的结构导航。此外，FastCode 兼容本地小模型，并可通过 MCP 服务器无缝集成到 Cursor、Claude Code 等常用编辑器中，让开发者在不打开所有文件的情况下，也能闪电般定位关键代码，显著提升工作效率。","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"assets\u002FFastCode.svg\" alt=\"FastCode Logo\" width=\"200\"\u002F>\n\n\u003C!-- # FastCode -->\n\n### FastCode: Accelerating and Streamlining Your Code Understanding\n\n| **⚡ High Performance** | **💰 Cost Efficient** | **🚀 Fast & Scalable** |\n\n[![Python 3.12+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg)](LICENSE)\n[![Code style: black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack)\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F1\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬WeChat-Group-07c160?style=for-the-badge&logo=wechat&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F2\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬Feishu-Group-3370ff?style=for-the-badge&logo=bytedance&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n[Features](#-why-fastcode) • [Quick Start](#-quick-start) • [Installation](#-installation) • [MCP Server](#mcp-server-use-in-cursor--claude-code--windsurf) • [Documentation](#-how-it-works)\n\n\u003C\u002Fdiv>\n\n---\n\n## 🎯 Why FastCode?\n\nFastCode is a token-efficient framework for comprehensive code understanding and analysis: delivering **superior speed**, **exceptional accuracy**, and **cost-effectiveness** for large-scale codebases and software architectures.\n\n🚀 **Superior Speed Advantage** - Runs 3x faster than Cursor and 4x faster than Claude Code.\n\n💰 **Significant Cost Savings** - Costs 55% less than Cursor and 44% less than Claude Code.\n\n⚡ **Highest Accuracy** - Outperforms Cursor and Claude Code with the highest accuracy score.\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_78cdb15435cf.png\" alt=\"FastCode Performance vs Cost\" width=\"850\"\u002F>\n\u003C\u002Fdiv>\n\n---\n\n## Key Features of FastCode\n\n### 🎯 Core Performance Advantages\n- 2-4x Faster than competitors (Cursor\u002FClaude Code)\n- 44-55% Cost Reduction compared to alternatives\n- Highest Accuracy Score across benchmarks\n- Up to 10x Token Savings through smart navigation\n\n### 🛠️ Technical Capabilities\n- Large-Scale Repository Analysis - Handle massive codebases efficiently\n- Multi-Language Support - Python, JavaScript, TypeScript, Java, Go, C\u002FC++, Rust, C#\n- Multi-Repository Reasoning - Cross-repo dependency analysis\n- Small Model Support - Local model compatibility (qwen3-coder-30b)\n\n### 💻 User Experience\n- **MCP Server** - Use FastCode directly through MCP integration (e.g., Cursor, Claude Code)\n- Beautiful Web UI - Intuitive codebase exploration\n- Flexible API - Easy workflow integration\n- Smart Structural Navigation - Load only what you need\n\n---\n\n## 🎥 See FastCode in Action\n\n\u003Cdiv align=\"center\">\n\n[![Watch FastCode Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_9ebb88674855.jpg)](https:\u002F\u002Fyoutu.be\u002FNwexLWHPBOY)\n\n**Click to watch FastCode in action** - See how FastCode analyzes complex codebases with lightning speed.\n\n---\n\n\u003C\u002Fdiv>\n\n### Core Technologies Behind FastCode\n\nFastCode introduces a three-phase framework that transforms how LLMs understand and navigate codebases:\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_d0bb349e83ed.png\" alt=\"FastCode Framework\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n## 🏗️ Semantic-Structural Code Representation\n\n### Multi-layered codebase understanding for comprehensive analysis\n\n- **🔍 Hierarchical Code Units** — Advanced multi-level indexing spanning files, classes, functions, and documentation using AST-based parsing across 8+ programming languages\n\n- **🔗 Hybrid Index** — Seamlessly combines semantic embeddings with keyword search (BM25) for robust and precise code retrieval\n\n- **📊 Multi-Layer Graph Modeling** — Three interconnected relationship graphs (Call Graph, Dependency Graph, Inheritance Graph) enabling structural navigation across the entire codebase\n\n### 🧭 Lightning-Fast Codebase Navigation\n\nFinding the right code without opening every file - at lightning speed\n\n- **⚡ Two-Stage Smart Search** — Like having a research assistant that first finds potentially relevant code, then ranks and organizes the best matches for your specific question.\n\n- **📁 Safe File Browsing** — Explores your project structure securely, understanding folder organization and file patterns without compromising security.\n\n- **🌐 Following Code Connections** — Traces how code pieces connect (up to 2 steps away), like following a trail of breadcrumbs through your codebase.\n\n- **🎯 Code Skimming** — Instead of reading entire files, FastCode just looks at the \"headlines\" - function names, class definitions, and type hints. This is like reading a book's chapter titles instead of every page, saving massive amounts of processing power.\n\n### 💰 Cost-Efficient Context Management\n\nGetting maximum insight while minimizing costs - automatically\n\n- **📈 Budget-Aware Decision Making** — Considers five key factors before processing: confidence level, query complexity, codebase size, resource cost, and iteration count. Like a cost-conscious financial advisor that weighs all options before making decisions.\n\n- **🔄 Resource-Optimized Learning** — Continuously adapts its approach in real-time, getting more efficient about what information to gather and when to stop. Think of it as an AI that maximizes value and becomes more cost-effective with every query.\n\n- **🎯 Value-First Selection** — Prioritizes high-impact, low-cost information first, like choosing the ripest fruit at the best price. This cost-optimized approach ensures you get maximum value for every token spent until the perfect stopping point is reached.\n\n---\n\n## 📊 Benchmark Performance\n\nFastCode has been rigorously tested on four major benchmarks representing real-world software engineering challenges:\n\n### 🎯 Evaluation Datasets\n\n| Benchmark | Focus Area | What It Tests |\n|-----------|------------|---------------|\n| SWE-QA | Software Engineering Q&A | Complex technical question answering |\n| LongCodeQA | Extended Code Analysis | Long-context code understanding |\n| LOC-BENCH | Code Localization | Bug detection & feature requests |\n| GitTaskBench | Real-World Tasks | Production repository workflows |\n\n### 🏆 Outstanding Results\n- ✅ **Superior Accuracy** — Consistently outperforms state-of-the-art baselines across all benchmarks\n\n- ✅ **10x Token Efficiency** — Achieves better results while using up to 90% fewer tokens\n\n- ✅ **Real-World Validation** — Proven performance on actual production codebases and workflows\n\n---\n\n## 🚀 Quick Start\n\nGet FastCode running in under 2 minutes:\n\n```bash\n# 1. Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\n\n# 2. Install dependencies\npip install -r requirements.txt\n\n# 3. Configure your API keys\ncp env.example .env\n# Edit .env with your API keys\n\n# 4. Launch the Web UI\npython web_app.py --host 0.0.0.0 --port 5000\n```\n\nOpen http:\u002F\u002Flocalhost:5000 and start asking questions about your code! 🎉\n\n---\n\n## 📦 Installation\n\nFastCode supports **Linux**, **macOS**, and **Windows**. Choose your platform below:\n\n> **💡 Recommendation:** We recommend using [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) for faster and more reliable dependency installation.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🐧 Linux Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```bash\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```bash\n   cp env.example .env\n   nano .env  # or use your preferred editor\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gpt-5.2\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **Launch FastCode**\n   ```bash\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🍎 macOS Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```bash\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```bash\n   cp env.example .env\n   nano .env  # or use: open -e .env\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gemini-3-flash\n   BASE_URL=https:\u002F\u002F...\n   ```\n\n4. **Launch FastCode**\n   ```bash\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n**Note for Apple Silicon (M1\u002FM2\u002FM3):** All dependencies are compatible with ARM architecture.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>💻 Windows Installation\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Prerequisites\n- Python 3.12 or higher\n- Git\n\n### Step-by-Step Guide\n\n1. **Clone FastCode**\n   ```cmd\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **Install Dependencies**\n\n   **Option A: Using uv (Recommended)**\n   ```cmd\n   # Install uv\n   pip install uv\n   # create new env with uv\n   uv venv --python=3.12\n   .venv\\Scripts\\activate\n\n   # Install dependencies with uv\n   uv pip install -r requirements.txt\n   ```\n\n   **Option B: Using pip**\n   ```cmd\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment**\n   ```cmd\n   copy env.example .env\n   notepad .env\n   ```\n\n   Add your API keys:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=qwen\u002Fqwen3-coder-30b-a3b-instruct\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **Launch FastCode**\n   ```cmd\n   # Web UI (Recommended)\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # Or use the CLI\n   python main.py query --repo-path C:\\path\\to\\your\\repo --query \"Your question here\"\n   ```\n\n**Troubleshooting:**\n- If you get SSL errors: `pip install --upgrade certifi`\n- For permission errors, run Command Prompt as Administrator\n- If `faiss-cpu` fails to install: `pip install faiss-cpu --no-cache-dir`\n- If you run `.\u002Frun_nanobot.sh` (bash script) on Windows, use **Git Bash** or **WSL**, and keep `.sh` files in **LF** line endings. This repo enforces LF for `*.sh` via `.gitattributes`, but older clones may need a one-time re-checkout.\n\n\u003C\u002Fdetails>\n\n---\n\n## 🎮 Usage\n\n### Web Interface (Recommended)\n\nThe Web UI provides the most intuitive experience:\n\n1. **Launch the server:**\n   ```bash\n   python web_app.py --host 0.0.0.0 --port 5000\n   ```\n\n2. **Open your browser:** Navigate to http:\u002F\u002Flocalhost:5000\n\n3. **Load a repository:** Use the sidebar to index your codebase\n\n4. **Start asking questions:**\n   - \"Where is the authentication logic implemented?\"\n   - \"How does the payment processing flow work?\"\n   - \"What files would be affected if I change the User model?\"\n   - \"Explain the dependency between module A and module B\"\n\n### Command Line Interface\n\nFor automation and scripting:\n\n```bash\n# Single repository query\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\"\n\n# Multi-repository query\npython main.py query --repos \u002Fpath\u002Fto\u002Frepo1 \u002Fpath\u002Fto\u002Frepo2 --query \"Your question\"\n\n# With custom model\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\" --model gpt-4-turbo\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>REST API\u003C\u002Fb>\u003C\u002Fsummary>\n\nIntegrate FastCode into your tools with the comprehensive REST API:\n\n```bash\n# Start the API server\npython api.py --host 0.0.0.0 --port 8000\n```\n\nThe API provides all features available in the Web UI. Visit http:\u002F\u002Flocalhost:8000\u002Fdocs for interactive API documentation.\n\n**Key API Endpoints:**\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Repository Management\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# List available and loaded repositories\nGET \u002Frepositories\n\n# Load a repository from URL or local path\nPOST \u002Fload\n{\n  \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n  \"is_url\": true\n}\n\n# Index the loaded repository\nPOST \u002Findex?force=false\n\n# Load and index in one call\nPOST \u002Fload-and-index\n{\n  \"source\": \"\u002Fpath\u002Fto\u002Frepo\",\n  \"is_url\": false\n}\n\n# Load multiple existing indexed repositories\nPOST \u002Fload-repositories\n{\n  \"repo_names\": [\"repo1\", \"repo2\"]\n}\n\n# Index multiple repositories at once\nPOST \u002Findex-multiple\n{\n  \"sources\": [\n    {\"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo1\", \"is_url\": true},\n    {\"source\": \"\u002Fpath\u002Fto\u002Frepo2\", \"is_url\": false}\n  ]\n}\n\n# Upload repository as ZIP file\nPOST \u002Fupload-zip\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# Upload and index in one call\nPOST \u002Fupload-and-index?force=false\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# Delete repositories and their indexes\nPOST \u002Fdelete-repos\n{\n  \"repo_names\": [\"repo1\", \"repo2\"],\n  \"delete_source\": true\n}\n\n# Get repository summary\nGET \u002Fsummary\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Query & Conversation\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# Query repository (single response)\nPOST \u002Fquery\n{\n  \"question\": \"How does authentication work?\",\n  \"filters\": null,\n  \"repo_filter\": [\"repo1\"],\n  \"multi_turn\": false,\n  \"session_id\": null\n}\n\n# Query with streaming response (SSE)\nPOST \u002Fquery-stream\n{\n  \"question\": \"Explain the database schema\",\n  \"multi_turn\": true,\n  \"session_id\": \"abc123\"\n}\n\n# Start a new conversation session\nPOST \u002Fnew-session?clear_session_id=old_session\n\n# List all conversation sessions\nGET \u002Fsessions\n\n# Get conversation history\nGET \u002Fsession\u002F{session_id}\n\n# Delete a conversation session\nDELETE \u002Fsession\u002F{session_id}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>System & Status\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# Health check\nGET \u002Fhealth\n\n# Get system status\nGET \u002Fstatus?full_scan=false\n\n# Clear cache\nPOST \u002Fclear-cache\n\n# Get cache statistics\nGET \u002Fcache-stats\n\n# Refresh index cache\nPOST \u002Frefresh-index-cache\n\n# Unload current repository\nDELETE \u002Frepository\n```\n\u003C\u002Fdetails>\n\n**Example Usage:**\n\n```python\nimport requests\n\n# Start a session and query\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fload-and-index\", json={\n    \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n    \"is_url\": True\n})\n\n# Query the repository\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fquery\", json={\n    \"question\": \"Where is the main entry point?\",\n    \"multi_turn\": False\n})\n\nresult = response.json()\nprint(result[\"answer\"])\nprint(f\"Tokens used: {result['total_tokens']}\")\n```\n\n\u003C\u002Fdetails>\n\n\u003Ca id=\"mcp-server-use-in-cursor--claude-code--windsurf\">\u003C\u002Fa>\n\u003Cdetails>\n\u003Csummary>\u003Cb>MCP Server (Use in Cursor \u002F Claude Code \u002F Windsurf)\u003C\u002Fb>\u003C\u002Fsummary>\n\nFastCode can run as an [MCP (Model Context Protocol)](https:\u002F\u002Fmodelcontextprotocol.io\u002F) server, allowing AI coding assistants like **Cursor**, **Claude Code**, and **Windsurf** to use FastCode's repo-level code understanding capabilities directly.\n\n#### Setup\n\nAdd the following to your MCP configuration:\n\nBefore configuring MCP, make sure FastCode dependencies are installed in the local uv virtual environment:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\nuv venv --python=3.12\nsource .venv\u002Fbin\u002Factivate\nuv pip install -r requirements.txt\n```\n\nThe MCP server should be launched with `.venv\u002Fbin\u002Fpython`, and it needs `OPENAI_API_KEY`, `MODEL`, and `BASE_URL`.\n\n**Cursor** (`~\u002F.cursor\u002Fmcp.json`):\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code** (`claude_desktop_config.json`):\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\nOr via `claude mcp add` (ensure the same env vars are available in your shell):\n```bash\nclaude mcp add fastcode -- \u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\n```\n\n**SSE transport** (for remote \u002F shared deployments):\n```bash\nOPENAI_API_KEY=sk-... MODEL=gpt-5.2 BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1 \\\n\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py --transport sse --port 8080\n```\n\n#### Available Tools\n\n| Tool | Description |\n|------|-------------|\n| `code_qa` | Core tool — ask questions about one or more code repositories. Automatically clones (if URL) and indexes repos that haven't been indexed yet. Supports multi-turn conversations. |\n| `list_indexed_repos` | List all repositories that have been indexed and are available for querying. |\n| `list_sessions` | List all existing conversation sessions with titles and turn counts. |\n| `get_session_history` | Retrieve the full Q&A history of a specific session. |\n| `delete_session` | Delete a conversation session and all its history. |\n| `delete_repo_metadata` | Delete indexed metadata for a repository (`.faiss`, `_metadata.pkl`, `_bm25.pkl`, `_graphs.pkl`) and remove its entry from `repo_overviews.pkl`, while keeping the repository source code. |\n\n#### `code_qa` Parameters\n\n| Parameter | Required | Default | Description |\n|-----------|----------|---------|-------------|\n| `question` | Yes | — | The question to ask about the code |\n| `repos` | Yes | — | List of repo sources (GitHub URLs or local paths). Multiple repos supported. |\n| `multi_turn` | No | `true` | Enable multi-turn conversation mode |\n| `session_id` | No | auto-generated | Session ID for continuing a conversation. Returned in the response of each call. |\n\n#### How It Works\n\n1. **Auto-detection**: For each repo in `repos`, FastCode checks if it's already indexed. If yes, it skips indexing entirely.\n2. **Auto-clone**: If a repo is a URL and not yet on disk, FastCode clones it to `.\u002Frepos\u002F` and indexes it.\n3. **Multi-turn**: When `multi_turn` is enabled (default), previous Q&A context from the same `session_id` is used for query rewriting and answer generation. The `session_id` is returned in each response — pass it back in subsequent calls to continue the conversation.\n4. **Multi-repo**: Pass multiple repos to `repos` and FastCode will search across all of them, using LLM-based repository selection to find the most relevant code.\n\n#### Usage Example\n\nIn Cursor or Claude Code, simply ask:\n\n```\nUse FastCode to analyze what this repository at \u002Fpath\u002Fto\u002Frepo_name is for.\n```\n\nor\n\n```\nUse FastCode to analyze the authentication flow in https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\n```\n\nThe AI assistant will call `code_qa` with the URL, FastCode will clone and index the repo (if needed), and return a detailed answer with source references.\n\nFor follow-up questions, the assistant reuses the same `session_id` automatically:\n\n```\nWhich files would be affected if I change the User model?\n```\n\n\u003C\u002Fdetails>\n\n---\n\n\n## 🔧 Configuration\n\n### Supported LLM Providers\n\nFastCode works with multiple LLM providers:\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenAI\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-...\nMODEL=gpt-4\nBASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003C!-- \u003Cdetails>\n\u003Csummary>\u003Cb>Anthropic Claude\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-ant-...\nMODEL=claude-3-opus-20240229\nBASE_URL=https:\u002F\u002Fapi.anthropic.com\u002Fv1\n```\n\u003C\u002Fdetails> -->\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenRouter (Multiple Models)\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-or-...\nMODEL=google\u002Fgemini-flash-1.5\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Local Models (Ollama)\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=ollama\nMODEL=qwen3-coder-30b_fastcode\nBASE_URL=http:\u002F\u002Flocalhost:11434\u002Fv1\n```\n\u003C\u002Fdetails>\n\n### Supported Languages\n\nFastCode automatically detects and parses:\n- 🐍 Python\n- 📜 JavaScript \u002F TypeScript\n- ☕ Java\n- 🦀 Rust\n- 🐹 Go\n- ⚙️ C \u002F C++\n- 💎 C#\n\n---\n\n\n## 🤖 Nanobot + Feishu (Lark) Integration (Docker Deployment)\n\nFastCode can be integrated with a Feishu (Lark) bot via [Nanobot](https:\u002F\u002Fgithub.com\u002Fnanobot-ai\u002Fnanobot), enabling conversational code repository queries directly within Feishu.\n\n### Architecture\n\n```\nFeishu User ←→ Feishu Open Platform ←→ Nanobot (WebSocket) ←→ FastCode API\n                                        (port 18791)            (port 8001)\n```\n\n- **FastCode Container**: Provides the code analysis REST API (port 8001)\n- **Nanobot Container**: Connects to Feishu via WebSocket and invokes FastCode tools (port 18791)\n- Both containers communicate over Docker's internal network — no public IP required\n\n### Quick Start\n\n```bash\n# One-command launch (automatically builds images and generates config on first run)\n.\u002Frun_nanobot.sh\n\n# Subsequent runs auto-detect the current state:\n# - Services running → show status + health check\n# - Services stopped → auto-restart\n# - Images not found → auto-build and start\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Configuration\u003C\u002Fb>\u003C\u002Fsummary>\n\n#### 1. Unified Configuration (`.env`)\n\nAll API keys and model settings are centralized in the `.env` file, shared by both services:\n\n```bash\n# ===== Shared API Configuration =====\nOPENAI_API_KEY=sk-or-v1-xxx        # Shared by both services\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n\n# ===== FastCode Model (Code Analysis) =====\nMODEL=google\u002Fgemini-3-flash-preview\n\n# ===== Nanobot Model (Agent Reasoning \u002F Feishu Conversations) =====\nNANOBOT_MODEL=minimax\u002Fminimax-m2.1\n```\n\nThe API key is automatically injected into the Nanobot container via `docker-compose.yml` environment variables — no need to duplicate it in `nanobot_config.json`.\n\n#### 2. FastCode Core Configuration\n\n- `config\u002Fconfig.yaml` — FastCode retrieval and indexing settings\n\n#### 3. Nanobot Configuration (`nanobot_config.json`)\n\n`run_nanobot.sh` auto-generates this file. You only need to configure **Feishu credentials and the systemPrompt** here; API keys and model settings are managed centrally via `.env`.\n\n```json\n{\n  \"channels\": {\n    \"feishu\": {\n      \"enabled\": true,\n      \"appId\": \"cli_xxxxxxxxx\",\n      \"appSecret\": \"your_app_secret\"\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Feishu App Setup\u003C\u002Fb>\u003C\u002Fsummary>\n\nNanobot receives Feishu messages via a WebSocket long-lived connection — **no public IP or webhook required**.\n\n#### 1. Create an App\n\nGo to the [Feishu Open Platform](https:\u002F\u002Fopen.feishu.cn\u002Fapp) → Create a **Custom Enterprise App** → Note the **App ID** (`cli_xxx`) and **App Secret**.\n\n#### 2. Enable Bot Capability\n\nNavigate to App Settings → **App Features** → Enable the \"Bot\" capability.\n\n#### 3. Add Permissions\n\nAdd the following permissions under **Permission Management**:\n\n| Permission | Description |\n|------------|-------------|\n| `im:message` | Read messages |\n| `im:message:send_as_bot` | Send messages as the bot |\n| `im:resource` | Access resource files in messages |\n| `im:chat` | Retrieve group chat information |\n\n#### 4. Configure Event Subscriptions\n\n> ⚠️ **Note the order**: You must start Nanobot to establish the WebSocket connection first, then configure event subscriptions in the Feishu admin console.\n\n1. Enter `appId` and `appSecret` in `nanobot_config.json`, then start the service (`.\u002Frun_nanobot.sh`)\n2. Verify the log shows `connected to wss:\u002F\u002Fmsg-frontier.feishu.cn`, confirming a successful connection\n3. Go back to the Feishu admin console → **Events & Callbacks** → Select \"**Receive events via long-lived connection**\" → Save\n4. Add event: `im.message.receive_v1` (Receive messages)\n\n#### 5. Publish the App\n\nGo to **Version Management** → Create a version → Submit for review (internal enterprise apps can be self-approved) → Once published, you can chat with the bot in Feishu.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker Compose Structure\u003C\u002Fb>\u003C\u002Fsummary>\n\n```yaml\nservices:\n  fastcode:          # FastCode API (port 8001)\n    build: .\n    volumes:\n      - .\u002F.env:\u002Fapp\u002F.env:ro\n      - .\u002Fconfig:\u002Fapp\u002Fconfig:ro\n      - .\u002Fdata:\u002Fapp\u002Fdata\n      - .\u002Frepos:\u002Fapp\u002Frepos\n\n  nanobot:           # Nanobot Gateway (port 18791 → 18790)\n    build: .\u002Fnanobot\n    command: [\"gateway\"]\n    volumes:\n      - .\u002Fnanobot_config.json:\u002Froot\u002F.nanobot\u002Fconfig.json:ro\n    environment:\n      - FASTCODE_API_URL=http:\u002F\u002Ffastcode:8001\n      # API key and model injected from .env\n      - NANOBOT_PROVIDERS__OPENROUTER__API_KEY=${OPENAI_API_KEY}\n      - NANOBOT_AGENTS__DEFAULTS__MODEL=${NANOBOT_MODEL}\n    depends_on:\n      - fastcode\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Management Commands\u003C\u002Fb>\u003C\u002Fsummary>\n\n| Command | Description |\n|---------|-------------|\n| `.\u002Frun_nanobot.sh` | Smart launch (auto-detects state) |\n| `.\u002Frun_nanobot.sh --build` | Force rebuild images |\n| `.\u002Frun_nanobot.sh --fg` | Run in foreground (view live logs) |\n| `.\u002Frun_nanobot.sh stop` | Stop all services |\n| `.\u002Frun_nanobot.sh restart` | Restart all services |\n| `.\u002Frun_nanobot.sh logs` | View live logs |\n| `.\u002Frun_nanobot.sh status` | View service status + health check |\n| `.\u002Frun_nanobot.sh config` | Re-check \u002F regenerate Nanobot config |\n| `.\u002Frun_nanobot.sh clean` | Stop and remove containers and images |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Registered FastCode Tools in Nanobot\u003C\u002Fb>\u003C\u002Fsummary>\n\nOn startup, Nanobot automatically registers the following tools via the `FASTCODE_API_URL` environment variable:\n\n| Tool Name | Function |\n|-----------|----------|\n| `fastcode_load_repo` | Load and index a code repository (GitHub URL or local path) |\n| `fastcode_query` | Query code using natural language, with multi-turn conversation support |\n| `fastcode_list_repos` | List loaded \u002F available repositories |\n| `fastcode_status` | View FastCode system status |\n| `fastcode_session` | Manage conversation sessions (create \u002F list \u002F history \u002F delete) |\n\n\u003C\u002Fdetails>\n\n### Feishu Usage Example\n\nChat with the bot in Feishu:\n\n```\nUser: https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\nBot:  ✓ Repository loaded and indexed (152 files, 3847 code elements)\n\nUser: How is the authentication logic implemented in this project?\nBot:  This project uses JWT for authentication... [detailed analysis]\n\nUser: Which files would be affected by changes to the User model?\nBot:  The following 8 files would be affected... [impact analysis]\n```\n\n---\n\n\n## 🧠 How It Works\n\nFastCode uses a novel **scouting-first** approach that fundamentally differs from traditional code reasoning systems:\n\n### Traditional Approach ❌\n```\nQuestion → Load Files → Search → Load More Files → Search Again → ... → Answer\n💸 High token cost from repeated file loading\n```\n\n### FastCode Approach ✅\n```\nQuestion → Build Semantic Map → Navigate Structure → Load Targets → Answer\n💰 Minimal token cost with precise targeting\n```\n\n\n---\n\n## 📚 Examples\n\n### Example 1: Understanding Authentication Flow\n\n**Query:** \"How does user authentication work in this application?\"\n\n**FastCode Process:**\n1. 🗺️ Scouts for authentication-related structures\n2. 🔍 Identifies `auth.py`, `middleware.py`, `user_model.py`\n3. 📊 Traces dependencies between these files\n4. 📖 Loads only relevant functions\n5. ✅ Provides comprehensive answer\n\n### Example 2: Impact Analysis\n\n**Query:** \"What would break if I change the User model schema?\"\n\n**FastCode Process:**\n1. 🗺️ Locates User model definition\n2. 🔗 Traces all imports and usages\n3. 📊 Maps dependency graph\n4. 📖 Loads affected code sections\n5. ✅ Lists all impacted files and functions\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! FastCode is built for the community, by the community.\n\n### Ways to Contribute\n\n- 🐛 **Report Bugs** - Found an issue? Let us know!\n- 💡 **Suggest Features** - Have ideas? We'd love to hear them!\n- 📝 **Improve Documentation** - Help others understand FastCode better\n- 🔧 **Submit Pull Requests** - Code contributions are always welcome\n\n\u003C!-- ### Development Setup\n\n```bash\n# Clone and setup\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # or .venv\\Scripts\\activate on Windows\npip install -r requirements.txt\n\n# Run tests\npytest tests\u002F\n\n# Code formatting\nblack .\n``` -->\n\n---\n\n## 📄 License\n\nFastCode is released under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n## 🌟 Star History\n\n\u003Cdiv align=\"center\">\n\nIf FastCode saves you tokens and time, consider giving us a star! ⭐\n\n**Built with ❤️ for developers who value efficiency**\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#HKUDS\u002FFastCode&Date\">\n    \u003Cpicture>\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png&theme=dark\" \u002F>\n      \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png\" \u002F>\n      \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png\" style=\"border-radius: 15px; box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);\" \u002F>\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Cem> Thanks for visiting ✨ FastCode!\u003C\u002Fem>\u003Cbr>\u003Cbr>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_c90392e15b91.png\" alt=\"Views\">\n\u003C\u002Fp>\n","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"assets\u002FFastCode.svg\" alt=\"FastCode Logo\" width=\"200\"\u002F>\n\n\u003C!-- # FastCode -->\n\n### FastCode：加速并简化你的代码理解\n\n| **⚡ 高性能** | **💰 成本高效** | **🚀 快速且可扩展** |\n\n[![Python 3.12+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg)](LICENSE)\n[![代码风格：black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack)\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F1\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬WeChat-Group-07c160?style=for-the-badge&logo=wechat&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F2\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F💬Feishu-Group-3370ff?style=for-the-badge&logo=bytedance&logoColor=white&labelColor=1a1a2e\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n[功能特性](#-why-fastcode) • [快速入门](#-quick-start) • [安装指南](#-installation) • [MCP服务器](#mcp-server-use-in-cursor--claude-code--windsurf) • [文档说明](#-how-it-works)\n\n\u003C\u002Fdiv>\n\n---\n\n## 🎯 为什么选择 FastCode？\n\nFastCode 是一个面向全面代码理解和分析的高效能框架，专为大规模代码库和软件架构设计，能够提供 **卓越的速度**、**极高的准确性** 以及 **显著的成本效益**。\n\n🚀 **速度优势** - 运行速度比 Cursor 快 3 倍，比 Claude Code 快 4 倍。\n\n💰 **大幅节省成本** - 成本比 Cursor 低 55%，比 Claude Code 低 44%。\n\n⚡ **最高准确率** - 在各项基准测试中均以最高准确率超越 Cursor 和 Claude Code。\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_78cdb15435cf.png\" alt=\"FastCode 性能与成本对比\" width=\"850\"\u002F>\n\u003C\u002Fdiv>\n\n---\n\n## FastCode 的核心特性\n\n### 🎯 核心性能优势\n- 比竞争对手（Cursor\u002FClaude Code）快 2–4 倍\n- 相较于其他方案，成本降低 44%–55%\n- 各项基准测试中取得最高准确率\n- 通过智能导航实现高达 10 倍的 token 节省\n\n### 🛠️ 技术能力\n- 大规模代码库分析 - 高效处理海量代码\n- 多语言支持 - Python、JavaScript、TypeScript、Java、Go、C\u002FC++、Rust、C#\n- 多仓库推理 - 跨仓库依赖关系分析\n- 小模型支持 - 兼容本地模型（qwen3-coder-30b）\n\n### 💻 用户体验\n- **MCP 服务器** - 可通过 MCP 集成直接使用 FastCode（如 Cursor、Claude Code）\n- 美观的 Web UI - 直观的代码库探索界面\n- 灵活的 API - 易于集成工作流\n- 智能结构化导航 - 仅加载所需内容\n\n---\n\n## 🎥 观看 FastCode 实际演示\n\n\u003Cdiv align=\"center\">\n\n[![观看 FastCode 演示视频](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_9ebb88674855.jpg)](https:\u002F\u002Fyoutu.be\u002FNwexLWHPBOY)\n\n**点击观看 FastCode 实际运行效果** - 了解 FastCode 如何以闪电般的速度分析复杂代码库。\n\n---\n\n\u003C\u002Fdiv>\n\n### FastCode 的核心技术\n\nFastCode 引入了一种三阶段框架，彻底改变了 LLM 对代码库的理解与导航方式：\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_d0bb349e83ed.png\" alt=\"FastCode 框架\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n## 🏗️ 语义-结构化代码表示\n\n### 多层次代码理解，实现全面分析\n\n- **🔍 层次化代码单元** — 基于 AST 解析，在 8 种以上编程语言中构建跨越文件、类、函数及文档的多级索引体系\n\n- **🔗 混合索引** — 无缝结合语义嵌入与关键词搜索（BM25），实现强大而精准的代码检索\n\n- **📊 多层图建模** — 构建相互关联的三大关系图（调用图、依赖图、继承图），支持在整个代码库中的结构化导航\n\n### 🧭 闪电般快速的代码库导航\n\n无需逐个打开文件，即可迅速找到所需代码——速度惊人\n\n- **⚡ 两阶段智能搜索** — 类似于一位研究助理，先定位可能相关的代码片段，再针对您的具体问题对结果进行排序和整理。\n\n- **📁 安全的文件浏览** — 安全地探索项目结构，理解文件夹组织和文件模式，同时确保安全性。\n\n- **🌐 跟踪代码连接** — 追踪代码各部分之间的联系（最多两步距离），如同在代码库中沿着面包屑路径前进。\n\n- **🎯 代码略读** — 不必阅读整个文件，FastCode 只查看“标题”——函数名、类定义和类型注解。这就像阅读一本书的章节标题而非每一页一样，从而大幅节省计算资源。\n\n### 💰 成本高效的上下文管理\n\n自动获取最大洞察力，同时将成本降至最低\n\n- **📈 预算意识决策** — 在处理前综合考虑五个关键因素：置信度、查询复杂性、代码库大小、资源成本和迭代次数。就像一位精打细算的财务顾问，在做出决定之前权衡所有选项。\n\n- **🔄 资源优化学习** — 实时调整策略，更加高效地收集信息，并适时停止。可以将其视为一种随着每次查询不断优化自身价值、提升成本效益的人工智能。\n\n- **🎯 价值优先选择** — 首先关注高影响力、低成本的信息，就像挑选成熟度最高且价格最优的水果一样。这种成本优化的方法确保您在每个 token 上都能获得最大价值，直到达到最佳停止点为止。\n\n---\n\n## 📊 基准测试表现\n\nFastCode 已在四个主要基准测试中接受了严格检验，这些测试代表了现实世界中的软件工程挑战：\n\n### 🎯 评估数据集\n\n| 基准测试 | 重点领域 | 测试内容 |\n|-----------|------------|---------------|\n| SWE-QA | 软件工程问答 | 复杂技术问题解答 |\n| LongCodeQA | 长文本代码分析 | 长上下文代码理解 |\n| LOC-BENCH | 代码定位 | 缺陷检测与功能请求 |\n| GitTaskBench | 真实任务 | 生产环境代码库工作流 |\n\n### 🏆 卓越成果\n- ✅ **卓越的准确率** — 在所有基准测试中均持续优于最先进的基线模型\n\n- ✅ **10倍的 token 效率** — 使用多达 90% 更少的 token 却取得了更好的结果\n\n- ✅ **真实场景验证** — 在实际生产代码库和工作流中证明了其性能\n\n---\n\n## 🚀 快速入门\n\n只需不到 2 分钟即可启动 FastCode：\n\n```bash\n# 1. 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\n\n# 2. 安装依赖\npip install -r requirements.txt\n\n# 3. 配置 API 密钥\ncp env.example .env\n# 编辑 .env 文件，填入您的 API 密钥\n\n# 4. 启动 Web UI\npython web_app.py --host 0.0.0.0 --port 5000\n```\n\n打开 http:\u002F\u002Flocalhost:5000，开始向 FastCode 提问关于你的代码吧！🎉\n\n---\n\n## 📦 安装\n\nFastCode 支持 **Linux**、**macOS** 和 **Windows**。请在下方选择您的平台：\n\n> **💡 推荐：** 我们建议使用 [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) 来进行更快、更可靠的依赖安装。\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🐧 Linux 安装\u003C\u002Fb>\u003C\u002Fsummary>\n\n### 前置条件\n- Python 3.12 或更高版本\n- Git\n\n### 分步指南\n\n1. **克隆 FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **安装依赖**\n\n   **选项 A：使用 uv（推荐）**\n   ```bash\n   # 安装 uv\n   pip install uv\n   # 使用 uv 创建新虚拟环境\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # 使用 uv 安装依赖\n   uv pip install -r requirements.txt\n   ```\n\n   **选项 B：使用 pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **配置环境**\n   ```bash\n   cp env.example .env\n   nano .env  # 或使用您喜欢的编辑器\n   ```\n\n   添加您的 API 密钥：\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gpt-5.2\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **启动 FastCode**\n   ```bash\n   # Web UI（推荐）\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # 或使用命令行界面\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🍎 macOS 安装\u003C\u002Fb>\u003C\u002Fsummary>\n\n### 前置条件\n- Python 3.12 或更高版本\n- Git\n\n### 分步指南\n\n1. **克隆 FastCode**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **安装依赖**\n\n   **选项 A：使用 uv（推荐）**\n   ```bash\n   # 安装 uv\n   pip install uv\n   # 使用 uv 创建新虚拟环境\n   uv venv --python=3.12\n   source .venv\u002Fbin\u002Factivate\n\n   # 使用 uv 安装依赖\n   uv pip install -r requirements.txt\n   ```\n\n   **选项 B：使用 pip**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **配置环境**\n   ```bash\n   cp env.example .env\n   nano .env  # 或使用：open -e .env\n   ```\n\n   添加您的 API 密钥：\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=gemini-3-flash\n   BASE_URL=https:\u002F\u002F...\n   ```\n\n4. **启动 FastCode**\n   ```bash\n   # Web UI（推荐）\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # 或使用命令行界面\n   python main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"Your question here\"\n   ```\n\n**Apple Silicon (M1\u002FM2\u002FM3) 注意事项：** 所有依赖项均兼容 ARM 架构。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>💻 Windows 安装\u003C\u002Fb>\u003C\u002Fsummary>\n\n### 前置条件\n- Python 3.12 或更高版本\n- Git\n\n### 分步指南\n\n1. **克隆 FastCode**\n   ```cmd\n   git clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\n   cd FastCode\n   ```\n\n2. **安装依赖**\n\n   **选项 A：使用 uv（推荐）**\n   ```cmd\n   # 安装 uv\n   pip install uv\n   # 使用 uv 创建新虚拟环境\n   uv venv --python=3.12\n   .venv\\Scripts\\activate\n\n   # 使用 uv 安装依赖\n   uv pip install -r requirements.txt\n   ```\n\n   **选项 B：使用 pip**\n   ```cmd\n   pip install -r requirements.txt\n   ```\n\n3. **配置环境**\n   ```cmd\n   copy env.example .env\n   notepad .env\n   ```\n\n   添加您的 API 密钥：\n   ```env\n   OPENAI_API_KEY=your_openai_api_key_here\n   MODEL=qwen\u002Fqwen3-coder-30b-a3b-instruct\n   BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n   ```\n\n4. **启动 FastCode**\n   ```cmd\n   # Web UI（推荐）\n   python web_app.py --host 0.0.0.0 --port 5000\n\n   # 或使用命令行界面\n   python main.py query --repo-path C:\\path\\to\\your\\repo --query \"Your question here\"\n   ```\n\n**故障排除：**\n- 如果出现 SSL 错误：`pip install --upgrade certifi`\n- 如果遇到权限错误，请以管理员身份运行命令提示符。\n- 如果 `faiss-cpu` 无法安装：`pip install faiss-cpu --no-cache-dir`\n- 如果在 Windows 上运行 `.\u002Frun_nanobot.sh`（bash 脚本），请使用 **Git Bash** 或 **WSL**，并确保 `.sh` 文件使用 **LF** 换行符。此仓库通过 `.gitattributes` 强制使用 LF 格式，但旧克隆可能需要重新检出一次。\n\n\u003C\u002Fdetails>\n\n---\n\n## 🎮 使用方法\n\n### Web 界面（推荐）\n\nWeb UI 提供最直观的体验：\n\n1. **启动服务器：**\n   ```bash\n   python web_app.py --host 0.0.0.0 --port 5000\n   ```\n\n2. **打开浏览器：** 访问 http:\u002F\u002Flocalhost:5000\n\n3. **加载代码库：** 使用侧边栏索引您的代码库\n\n4. **开始提问：**\n   - “认证逻辑是在哪里实现的？”\n   - “支付流程是如何运作的？”\n   - “如果我修改 User 模型，哪些文件会受到影响？”\n   - “请解释模块 A 和模块 B 之间的依赖关系。”\n\n### 命令行界面\n\n适用于自动化和脚本编写：\n\n```bash\n# 单一代码库查询\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\"\n\n# 多代码库查询\npython main.py query --repos \u002Fpath\u002Fto\u002Frepo1 \u002Fpath\u002Fto\u002Frepo2 --query \"Your question\"\n\n# 使用自定义模型\npython main.py query --repo-path \u002Fpath\u002Fto\u002Frepo --query \"Your question\" --model gpt-4-turbo\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>REST API\u003C\u002Fb>\u003C\u002Fsummary>\n\n通过功能全面的 REST API 将 FastCode 集成到您的工具中：\n\n```bash\n# 启动 API 服务器\npython api.py --host 0.0.0.0 --port 8000\n```\n\nAPI 提供了 Web UI 中的所有功能。访问 http:\u002F\u002Flocalhost:8000\u002Fdocs 可查看交互式的 API 文档。\n\n**关键 API 端点：**\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>代码库管理\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# 列出可用及已加载的代码库\nGET \u002Frepositories\n\n# 从 URL 或本地路径加载代码库\nPOST \u002Fload\n{\n  \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n  \"is_url\": true\n}\n\n# 对已加载的代码库进行索引\nPOST \u002Findex?force=false\n\n# 一次性加载并索引\nPOST \u002Fload-and-index\n{\n  \"source\": \"\u002Fpath\u002Fto\u002Frepo\",\n  \"is_url\": false\n}\n\n# 加载多个已索引的代码库\nPOST \u002Fload-repositories\n{\n  \"repo_names\": [\"repo1\", \"repo2\"]\n}\n\n# 一次性对多个代码库进行索引\nPOST \u002Findex-multiple\n{\n  \"sources\": [\n    {\"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo1\", \"is_url\": true},\n    {\"source\": \"\u002Fpath\u002Fto\u002Frepo2\", \"is_url\": false}\n  ]\n}\n\n# 上传 ZIP 格式的代码库\nPOST \u002Fupload-zip\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# 上传并索引一次完成\nPOST \u002Fupload-and-index?force=false\nContent-Type: multipart\u002Fform-data\nfile: \u003Czip_file>\n\n# 删除代码库及其索引\nPOST \u002Fdelete-repos\n{\n  \"repo_names\": [\"repo1\", \"repo2\"],\n  \"delete_source\": true\n}\n\n# 获取代码库摘要\nGET \u002Fsummary\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>查询与对话\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# 查询代码库（单次响应）\nPOST \u002Fquery\n{\n  \"question\": \"认证是如何工作的？\",\n  \"filters\": null,\n  \"repo_filter\": [\"repo1\"],\n  \"multi_turn\": false,\n  \"session_id\": null\n}\n\n# 带流式响应的查询（SSE）\nPOST \u002Fquery-stream\n{\n  \"question\": \"请解释数据库模式\",\n  \"multi_turn\": true,\n  \"session_id\": \"abc123\"\n}\n\n# 开始一个新的对话会话\nPOST \u002Fnew-session?clear_session_id=old_session\n\n# 列出所有对话会话\nGET \u002Fsessions\n\n# 获取对话历史\nGET \u002Fsession\u002F{session_id}\n\n# 删除一个对话会话\nDELETE \u002Fsession\u002F{session_id}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>系统与状态\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# 健康检查\nGET \u002Fhealth\n\n# 获取系统状态\nGET \u002Fstatus?full_scan=false\n\n# 清除缓存\nPOST \u002Fclear-cache\n\n# 获取缓存统计信息\nGET \u002Fcache-stats\n\n# 刷新索引缓存\nPOST \u002Frefresh-index-cache\n\n#  Entladen des aktuellen Repositorys\nDELETE \u002Frepository\n```\n\u003C\u002Fdetails>\n\n**使用示例：**\n\n```python\nimport requests\n\n# 启动会话并查询\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fload-and-index\", json={\n    \"source\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\",\n    \"is_url\": True\n})\n\n# 查询仓库\nresponse = requests.post(\"http:\u002F\u002Flocalhost:8000\u002Fquery\", json={\n    \"question\": \"主入口在哪里？\",\n    \"multi_turn\": False\n})\n\nresult = response.json()\nprint(result[\"answer\"])\nprint(f\"使用的 token 数量：{result['total_tokens']}\")\n```\n\n\u003C\u002Fdetails>\n\n\u003Ca id=\"mcp-server-use-in-cursor--claude-code--windsurf\">\u003C\u002Fa>\n\u003Cdetails>\n\u003Csummary>\u003Cb>MCP 服务器（用于 Cursor、Claude Code 和 Windsurf）\u003C\u002Fb>\u003C\u002Fsummary>\n\nFastCode 可以作为 [MCP（模型上下文协议）](https:\u002F\u002Fmodelcontextprotocol.io\u002F) 服务器运行，从而使像 **Cursor**、**Claude Code** 和 **Windsurf** 这样的 AI 编程助手能够直接使用 FastCode 的仓库级代码理解能力。\n\n#### 设置\n\n在您的 MCP 配置中添加以下内容：\n\n在配置 MCP 之前，请确保本地 uv 虚拟环境中已安装 FastCode 的依赖项：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\nuv venv --python=3.12\nsource .venv\u002Fbin\u002Factivate\nuv pip install -r requirements.txt\n```\n\nMCP 服务器应使用 `.venv\u002Fbin\u002Fpython` 启动，并且需要设置 `OPENAI_API_KEY`、`MODEL` 和 `BASE_URL`。\n\n**Cursor** (`~\u002F.cursor\u002Fmcp.json`)：\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code** (`claude_desktop_config.json`)：\n```json\n{\n  \"mcpServers\": {\n    \"fastcode\": {\n      \"command\": \"\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython\",\n      \"args\": [\"\u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\"],\n      \"env\": {\n        \"MODEL\": \"gpt-5.2\",\n        \"BASE_URL\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n或者通过 `claude mcp add` 命令（请确保您的 shell 中已设置相同的环境变量）：\n```bash\nclaude mcp add fastcode -- \u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py\n```\n\n**SSE 传输方式**（适用于远程或共享部署）：\n```bash\nOPENAI_API_KEY=sk-... MODEL=gpt-5.2 BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1 \\\n\u002Fpath\u002Fto\u002FFastCode\u002F.venv\u002Fbin\u002Fpython \u002Fpath\u002Fto\u002FFastCode\u002Fmcp_server.py --transport sse --port 8080\n```\n\n#### 可用工具\n\n| 工具 | 描述 |\n|------|-------------|\n| `code_qa` | 核心工具 — 用于询问关于一个或多个代码仓库的问题。如果仓库尚未被索引，则会自动克隆（如果是 URL）并进行索引。支持多轮对话。 |\n| `list_indexed_repos` | 列出所有已被索引且可用于查询的仓库。 |\n| `list_sessions` | 列出所有现有的对话会话及其标题和轮次数量。 |\n| `get_session_history` | 检索特定会话的完整问答历史。 |\n| `delete_session` | 删除一个对话会话及其所有历史记录。 |\n| `delete_repo_metadata` | 删除某个仓库的索引元数据（`.faiss`、`_metadata.pkl`、`_bm25.pkl`、`_graphs.pkl`），并从 `repo_overviews.pkl` 中移除该仓库条目，同时保留仓库的源代码。 |\n\n#### `code_qa` 参数\n\n| 参数 | 必需 | 默认值 | 描述 |\n|-----------|----------|---------|-------------|\n| `question` | 是 | — | 关于代码的问题 |\n| `repos` | 是 | — | 仓库来源列表（GitHub URL 或本地路径）。支持多个仓库。 |\n| `multi_turn` | 否 | `true` | 启用多轮对话模式 |\n| `session_id` | 否 | 自动生成 | 用于继续对话的会话 ID。每次调用都会返回该 ID。 |\n\n#### 工作原理\n\n1. **自动检测**：对于 `repos` 中的每个仓库，FastCode 会检查其是否已被索引。如果已索引，则完全跳过索引过程。\n2. **自动克隆**：如果仓库是 URL 且尚未存在于磁盘上，FastCode 会将其克隆到 `.\u002Frepos\u002F` 并进行索引。\n3. **多轮对话**：当启用 `multi_turn`（默认）时，来自同一 `session_id` 的先前问答上下文将用于重写查询和生成答案。每次响应中都会返回 `session_id`——在后续调用中将其传回即可继续对话。\n4. **多仓库查询**：您可以将多个仓库传递给 `repos` 参数，FastCode 将在所有仓库中进行搜索，并利用 LLM 基于仓库选择最相关的代码。\n\n#### 使用示例\n\n在 Cursor 或 Claude Code 中，只需输入：\n\n```\n使用 FastCode 分析一下位于 \u002Fpath\u002Fto\u002Frepo_name 的这个仓库是用来做什么的。\n```\n\n或者\n\n```\n使用 FastCode 分析一下 https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project 中的认证流程。\n```\n\nAI 助手会调用 `code_qa` 接口并传入 URL，FastCode 会在必要时克隆并索引该仓库，然后返回包含源代码引用的详细答案。\n\n对于后续问题，助手会自动重复使用同一个 `session_id`：\n\n```\n如果我修改 User 模型，哪些文件会受到影响？\n```\n\n\u003C\u002Fdetails>\n\n---\n\n\n## 🔧 配置\n\n### 支持的 LLM 提供商\n\nFastCode 可与多家 LLM 提供商合作：\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenAI\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-...\nMODEL=gpt-4\nBASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003C!-- \u003Cdetails>\n\u003Csummary>\u003Cb>Anthropic Claude\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-ant-...\nMODEL=claude-3-opus-20240229\nBASE_URL=https:\u002F\u002Fapi.anthropic.com\u002Fv1\n```\n\u003C\u002Fdetails> -->\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>OpenRouter（多种模型）\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=sk-or-...\nMODEL=google\u002Fgemini-flash-1.5\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>本地模型（Ollama）\u003C\u002Fb>\u003C\u002Fsummary>\n\n```env\nOPENAI_API_KEY=ollama\nMODEL=qwen3-coder-30b_fastcode\nBASE_URL=http:\u002F\u002Flocalhost:11434\u002Fv1\n```\n\u003C\u002Fdetails>\n\n### 支持的语言\n\nFastCode 会自动检测并解析：\n- 🐍 Python\n- 📜 JavaScript \u002F TypeScript\n- ☕ Java\n- 🦀 Rust\n- 🐹 Go\n- ⚙️ C \u002F C++\n- 💎 C#\n\n---\n\n\n## 🤖 Nanobot + Feishu（Lark）集成（Docker 部署）\n\nFastCode 可以通过 [Nanobot](https:\u002F\u002Fgithub.com\u002Fnanobot-ai\u002Fnanobot) 与 Feishu（Lark）机器人集成，从而实现在 Feishu 内部直接进行对话式的代码仓库查询。\n\n### 架构\n\n```\n飞书用户 ←→ 飞书开放平台 ←→ Nanobot (WebSocket) ←→ FastCode API\n                                        (端口 18791)            (端口 8001)\n```\n\n- **FastCode 容器**：提供代码分析 REST API（端口 8001）\n- **Nanobot 容器**：通过 WebSocket 连接到飞书，并调用 FastCode 工具（端口 18791）\n- 两个容器通过 Docker 的内部网络进行通信——无需公网 IP\n\n### 快速开始\n\n```bash\n# 一键启动（首次运行时会自动构建镜像并生成配置）\n.\u002Frun_nanobot.sh\n\n# 后续运行会自动检测当前状态：\n# - 服务正在运行 → 显示状态 + 健康检查\n# - 服务已停止 → 自动重启\n# - 镜像未找到 → 自动构建并启动\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>配置\u003C\u002Fb>\u003C\u002Fsummary>\n\n#### 1. 统一配置（`.env`）\n\n所有 API 密钥和模型设置都集中在一个 `.env` 文件中，供两个服务共享：\n\n```bash\n# ===== 共享 API 配置 =====\nOPENAI_API_KEY=sk-or-v1-xxx        # 两个服务共用\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\n\n# ===== FastCode 模型（代码分析）=====\nMODEL=google\u002Fgemini-3-flash-preview\n\n# ===== Nanobot 模型（智能体推理 \u002F 飞书对话）=====\nNANOBOT_MODEL=minimax\u002Fminimax-m2.1\n```\n\nAPI 密钥会通过 `docker-compose.yml` 中的环境变量自动注入到 Nanobot 容器中——无需在 `nanobot_config.json` 中重复填写。\n\n#### 2. FastCode 核心配置\n\n- `config\u002Fconfig.yaml` — FastCode 检索和索引设置\n\n#### 3. Nanobot 配置（`nanobot_config.json`）\n\n`run_nanobot.sh` 会自动生成此文件。你只需在此处配置 **飞书凭证和 systemPrompt**；API 密钥和模型设置则由 `.env` 文件统一管理。\n\n```json\n{\n  \"channels\": {\n    \"feishu\": {\n      \"enabled\": true,\n      \"appId\": \"cli_xxxxxxxxx\",\n      \"appSecret\": \"your_app_secret\"\n    }\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>飞书应用设置\u003C\u002Fb>\u003C\u002Fsummary>\n\nNanobot 通过 WebSocket 长连接接收飞书消息——**无需公网 IP 或 Webhook**。\n\n#### 1. 创建应用\n\n前往 [飞书开放平台](https:\u002F\u002Fopen.feishu.cn\u002Fapp) → 创建一个 **自定义企业应用** → 记下 **App ID**（`cli_xxx`）和 **App Secret**。\n\n#### 2. 启用机器人功能\n\n进入应用设置 → **应用功能** → 启用“机器人”功能。\n\n#### 3. 添加权限\n\n在 **权限管理** 中添加以下权限：\n\n| 权限 | 描述 |\n|------------|-------------|\n| `im:message` | 读取消息 |\n| `im:message:send_as_bot` | 以机器人身份发送消息 |\n| `im:resource` | 访问消息中的资源文件 |\n| `im:chat` | 获取群聊信息 |\n\n#### 4. 配置事件订阅\n\n> ⚠️ **注意顺序**：必须先启动 Nanobot 建立 WebSocket 连接，然后再在飞书管理后台配置事件订阅。\n\n1. 在 `nanobot_config.json` 中填入 `appId` 和 `appSecret`，然后启动服务（`.\u002Frun_nanobot.sh`）\n2. 确认日志显示 `connected to wss:\u002F\u002Fmsg-frontier.feishu.cn`，表明连接成功\n3. 返回飞书管理后台 → **事件与回调** → 选择“通过长连接接收事件” → 保存\n4. 添加事件：`im.message.receive_v1`（接收消息）\n\n#### 5. 发布应用\n\n进入 **版本管理** → 创建版本 → 提交审核（企业内部应用可自行批准）→ 发布后，即可在飞书中与机器人聊天。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker Compose 结构\u003C\u002Fb>\u003C\u002Fsummary>\n\n```yaml\nservices:\n  fastcode:          # FastCode API（端口 8001）\n    build: .\n    volumes:\n      - .\u002F.env:\u002Fapp\u002F.env:ro\n      - .\u002Fconfig:\u002Fapp\u002Fconfig:ro\n      - .\u002Fdata:\u002Fapp\u002Fdata\n      - .\u002Frepos:\u002Fapp\u002Frepos\n\n  nanobot:           # Nanobot 网关（端口 18791 → 18790）\n    build: .\u002Fnanobot\n    command: [\"gateway\"]\n    volumes:\n      - .\u002Fnanobot_config.json:\u002Froot\u002F.nanobot\u002Fconfig.json:ro\n    environment:\n      - FASTCODE_API_URL=http:\u002F\u002Ffastcode:8001\n      # API 密钥和模型从 .env 注入\n      - NANOBOT_PROVIDERS__OPENROUTER__API_KEY=${OPENAI_API_KEY}\n      - NANOBOT_AGENTS__DEFAULTS__MODEL=${NANOBOT_MODEL}\n    depends_on:\n      - fastcode\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>管理命令\u003C\u002Fb>\u003C\u002Fsummary>\n\n| 命令 | 描述 |\n|---------|-------------|\n| `.\u002Frun_nanobot.sh` | 智能启动（自动检测状态）|\n| `.\u002Frun_nanobot.sh --build` | 强制重建镜像 |\n| `.\u002Frun_nanobot.sh --fg` | 前台运行（查看实时日志）|\n| `.\u002Frun_nanobot.sh stop` | 停止所有服务 |\n| `.\u002Frun_nanobot.sh restart` | 重启所有服务 |\n| `.\u002Frun_nanobot.sh logs` | 查看实时日志 |\n| `.\u002Frun_nanobot.sh status` | 查看服务状态 + 健康检查 |\n| `.\u002Frun_nanobot.sh config` | 重新检查\u002F生成 Nanobot 配置 |\n| `.\u002Frun_nanobot.sh clean` | 停止并移除容器和镜像 |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Nanobot 中注册的 FastCode 工具\u003C\u002Fb>\u003C\u002Fsummary>\n\n启动时，Nanobot 会通过 `FASTCODE_API_URL` 环境变量自动注册以下工具：\n\n| 工具名称 | 功能 |\n|-----------|----------|\n| `fastcode_load_repo` | 加载并索引代码仓库（GitHub URL 或本地路径）|\n| `fastcode_query` | 使用自然语言查询代码，支持多轮对话 |\n| `fastcode_list_repos` | 列出已加载\u002F可用的仓库 |\n| `fastcode_status` | 查看 FastCode 系统状态 |\n| `fastcode_session` | 管理对话会话（创建\u002F列出\u002F历史记录\u002F删除）|\n\n\u003C\u002Fdetails>\n\n### 飞书使用示例\n\n在飞书中与机器人对话：\n\n```\n用户：https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo\n机器人：✓ 仓库已加载并索引完毕（152 个文件，3847 个代码元素）\n\n用户：这个项目中的认证逻辑是如何实现的？\n机器人：该项目使用 JWT 进行认证……[详细分析]\n\n用户：如果对 User 模型进行修改，哪些文件会受到影响？\n机器人：以下 8 个文件会受到影响……[影响分析]\n```\n\n---\n\n\n## 🧠 工作原理\n\nFastCode 采用一种全新的 **侦察优先** 方法，这与传统的代码推理系统有根本区别：\n\n### 传统方法 ❌\n```\n问题 → 加载文件 → 搜索 → 再次加载更多文件 → 再次搜索 → … → 回答\n💸 重复加载文件导致高额 token 费用\n```\n\n### FastCode 方法 ✅\n```\n问题 → 构建语义地图 → 导航结构 → 加载目标 → 回答\n💰 精准定位，token 费用极低\n```\n\n\n---\n\n## 📚 示例\n\n### 示例 1：理解认证流程\n\n**查询**：“这个应用中的用户认证是如何工作的？”\n\n**FastCode 流程**：\n1. 🗺️ 侦察与认证相关的结构\n2. 🔍 找到 `auth.py`、`middleware.py`、`user_model.py`\n3. 📊 追踪这些文件之间的依赖关系\n4. 📖 只加载相关函数\n5. ✅ 提供全面的答案\n\n### 示例 2：影响分析\n\n**查询：** “如果我更改 User 模型的模式，会破坏什么？”\n\n**FastCode 流程：**\n1. 🗺️ 定位 User 模型定义\n2. 🔗 追踪所有导入和使用情况\n3. 📊 绘制依赖关系图\n4. 📖 加载受影响的代码部分\n5. ✅ 列出所有受影响的文件和函数\n\n---\n\n## 🤝 贡献\n\n我们欢迎各位贡献！FastCode 是由社区共建、为社区服务的工具。\n\n### 贡献方式\n\n- 🐛 **报告 Bug** - 发现问题了吗？请告诉我们！\n- 💡 **提出功能建议** - 有好点子吗？我们非常期待听到你的想法！\n- 📝 **改进文档** - 帮助更多人更好地理解 FastCode\n- 🔧 **提交 Pull Request** - 代码贡献随时欢迎\n\n\u003C!-- ### 开发环境搭建\n\n```bash\n# 克隆并设置\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # 或者在 Windows 上使用 .venv\\Scripts\\activate\npip install -r requirements.txt\n\n# 运行测试\npytest tests\u002F\n\n# 代码格式化\nblack .\n``` -->\n\n---\n\n## 📄 许可证\n\nFastCode 采用 MIT 许可证发布。详情请参阅 [LICENSE](LICENSE) 文件。\n\n---\n\n## 🌟 星标历史\n\n\u003Cdiv align=\"center\">\n\n如果 FastCode 为你节省了 Token 和时间，请考虑给我们点个 Star 吧！⭐\n\n**用 ❤️ 打造，专为重视效率的开发者而生**\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#HKUDS\u002FFastCode&Date\">\n    \u003Cpicture>\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png&theme=dark\" \u002F>\n      \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png\" \u002F>\n      \u003Cimg alt=\"星标历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_3f5c93100f47.png\" style=\"border-radius: 15px; box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);\" \u002F>\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Cem> 感谢您的访问 ✨ FastCode！\u003C\u002Fem>\u003Cbr>\u003Cbr>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_readme_c90392e15b91.png\" alt=\"访问量\">\n\u003C\u002Fp>","# FastCode 快速上手指南\n\nFastCode 是一个高性能、低成本的代码理解与分析框架，专为大规模代码库设计。相比 Cursor 和 Claude Code，它速度提升 3-4 倍，成本降低 44-55%，同时保持更高的准确率。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux、macOS 或 Windows\n*   **Python 版本**：3.12 或更高版本\n*   **依赖工具**：Git\n*   **API Key**：需要准备大模型 API Key（支持 OpenAI、Qwen、Gemini 等）\n\n> 💡 **推荐**：建议使用 [`uv`](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) 进行依赖管理，安装速度更快且更稳定。\n> *国内用户可使用镜像源加速：* `export UV_INDEX_URL=https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 安装步骤\n\n### 1. 克隆项目\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode.git\ncd FastCode\n```\n\n### 2. 创建虚拟环境并安装依赖\n\n**方案 A：使用 uv（推荐）**\n```bash\n# 安装 uv (如已安装可跳过)\npip install uv\n\n# 创建 Python 3.12 虚拟环境\nuv venv --python=3.12\n\n# 激活环境\n# Linux\u002FmacOS:\nsource .venv\u002Fbin\u002Factivate\n# Windows (PowerShell):\n.venv\\Scripts\\activate\n\n# 安装依赖\nuv pip install -r requirements.txt\n```\n\n**方案 B：使用 pip**\n```bash\npip install -r requirements.txt\n```\n\n### 3. 配置环境变量\n复制示例配置文件并填入您的 API 信息：\n```bash\ncp env.example .env\n```\n\n编辑 `.env` 文件，配置以下内容（以 OpenAI 为例）：\n```env\nOPENAI_API_KEY=your_openai_api_key_here\nMODEL=gpt-4-turbo\nBASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n```\n*注：若使用国内模型（如 Qwen），请相应修改 `MODEL` 和 `BASE_URL`。*\n\n## 基本使用\n\nFastCode 提供 Web 界面和命令行两种使用方式，推荐优先体验 Web 界面。\n\n### 方式一：启动 Web UI（推荐）\n\n1.  **启动服务**\n    ```bash\n    python web_app.py --host 0.0.0.0 --port 5000\n    ```\n\n2.  **访问界面**\n    打开浏览器访问 `http:\u002F\u002Flocalhost:5000`。\n\n3.  **开始使用**\n    *   在侧边栏加载（Index）您的代码仓库。\n    *   直接在对话框中输入自然语言问题，例如：\n        *   \"认证逻辑在哪里实现？\"\n        *   \"支付处理流程是如何工作的？\"\n        *   \"如果修改 User 模型会影响哪些文件？\"\n\n### 方式二：命令行使用 (CLI)\n\n适用于脚本自动化或快速查询：\n\n```bash\n# 单仓库查询\npython main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"解释核心模块的依赖关系\"\n\n# 多仓库联合分析\npython main.py query --repos \u002Fpath\u002Fto\u002Frepo1 \u002Fpath\u002Fto\u002Frepo2 --query \"跨仓库的调用链是怎样的？\"\n\n# 指定特定模型运行\npython main.py query --repo-path \u002Fpath\u002Fto\u002Fyour\u002Frepo --query \"查找所有数据库连接代码\" --model qwen\u002Fqwen3-coder-30b-a3b-instruct\n```","某大型金融科技团队需要在两天内完成对遗留的百万行多语言核心交易系统进行安全漏洞排查与重构评估。\n\n### 没有 FastCode 时\n- **分析效率低下**：工程师手动翻阅代码或依赖传统 IDE 全局搜索，面对跨 Python、Java 和 Go 的复杂调用链，定位一个关键函数的所有引用点往往需要数小时。\n- **Token 成本高昂**：直接将大段代码投喂给通用 AI 助手（如 Cursor 或 Claude Code）进行全库分析，因缺乏智能导航导致上下文冗余，单次任务 Token 消耗巨大且易超出限额。\n- **理解准确度不足**：通用工具难以精准识别深层继承关系和跨仓库依赖，常遗漏隐蔽的逻辑漏洞或给出错误的重构建议，需人工反复验证。\n- **响应速度缓慢**：在处理大规模代码库时，现有工具索引和推理耗时过长，严重拖慢了整个团队的紧急响应节奏。\n\n### 使用 FastCode 后\n- **秒级精准定位**：利用 FastCode 的三层图谱模型（调用图、依赖图、继承图），工程师在几秒钟内即可理清跨语言的完整调用链路，快速锁定风险模块。\n- **成本大幅降低**：凭借智能结构导航技术，FastCode 仅加载必要代码片段，相比其他方案节省高达 55% 的 Token 成本，让全量深度分析变得经济可行。\n- **洞察深度提升**：基于语义与结构混合索引，FastCode 准确识别出隐藏的循环依赖和异常继承路径，提供的修复方案准确率显著优于竞品。\n- **极速分析体验**：整体分析速度提升至原来的 3-4 倍，原本需要两天的工作量现在半天即可完成，团队得以从容应对紧急合规要求。\n\nFastCode 通过极致的速度与成本优势，将大规模代码库的深度理解从“不可能完成的任务”变成了日常开发的高效常态。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHKUDS_FastCode_9ebb8867.jpg","HKUDS","✨Data Intelligence Lab@HKU✨","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FHKUDS_fc32cc87.jpg",null,"https:\u002F\u002Fsites.google.com\u002Fview\u002Fchaoh","https:\u002F\u002Fgithub.com\u002FHKUDS",[79,83,87,91,95,99],{"name":80,"color":81,"percentage":82},"Python","#3572A5",92.6,{"name":84,"color":85,"percentage":86},"HTML","#e34c26",4.4,{"name":88,"color":89,"percentage":90},"Shell","#89e051",2.1,{"name":92,"color":93,"percentage":94},"TypeScript","#3178c6",0.6,{"name":96,"color":97,"percentage":98},"Dockerfile","#384d54",0.2,{"name":100,"color":101,"percentage":102},"JavaScript","#f1e05a",0.1,2124,250,"2026-04-11T07:14:48","Linux, macOS, Windows","未说明 (支持本地小模型如 qwen3-coder-30b，但未明确指定 GPU 需求；主要依赖 API 调用)","未说明",{"notes":110,"python":111,"dependencies":112},"推荐使用 uv 进行依赖安装以获取更快更可靠的体验。支持通过 API 连接多种大模型（如 OpenAI, Gemini, Qwen 等），需配置 .env 文件中的 API KEY。Windows 用户若运行 shell 脚本需使用 Git Bash 或 WSL，并注意 faiss-cpu 安装失败时可尝试 --no-cache-dir 参数。Apple Silicon (M1\u002FM2\u002FM3) 完全兼容。","3.12+",[113,114,115],"uv (推荐)","faiss-cpu","black (代码风格)",[35,14,52],"2026-03-27T02:49:30.150509","2026-04-11T23:21:14.080753",[120,125,130,135,140,145,150,155,160],{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},30111,"为什么加载仓库后提示'Relevant Code Context 为空'？","这通常是因为 API 端点返回了空内容。解决方法是修改配置文件 config\u002Fconfig.yaml，将第 120 行的 enable_agency_mode 设置为 false：\nenable_agency_mode: false","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F29",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},30112,"FastCode 是否支持 Java 语言？","是的，FastCode 支持 Java。目前 Python 的支持最完善，CallExtractor 在 Java 上可能缺少部分图扩展功能，但整体仍可正常工作。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F22",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},30110,"FastCode 是否支持作为 MCP 服务器在 Claude Code 或 Cursor 中使用？","是的，目前已支持 MCP 服务器功能。您可以将 FastCode 作为 MCP 服务器与 Cursor、Claude Code 及其他 MCP 客户端一起使用。维护者已推送相关实现，直接更新代码即可启用。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F5",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},30109,"如何配置使用 OpenRouter 模型？","您可以保留 config 文件中的原始配置，并在 .env 文件中设置以下环境变量：\nOPENAI_API_KEY=sk-or-...\nMODEL=google\u002Fgemini-3-flash-preview\nBASE_URL=https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F11",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},30113,"添加本地项目路径时，原文件会被删除吗？","不会删除您原本的项目文件。FastCode 会将所有仓库克隆或上传到安全工作目录 .\u002Frepos 下进行操作。只有当 .\u002Frepos 目录下存在重名项目时，才会默认删除旧版本并使用最新克隆的版本。除非您手动修改了配置中的 repo_root 路径。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F16",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},30114,"FastCode 能否读写本地目录或创建新文件？","FastCode 可以针对本地目录，您可以将本地目录压缩为 zip 上传，或直接在 URL 处输入本地路径（如 \u002Fpath\u002Fto\u002Frepo_name）。但目前版本主要用于理解代码库，因此是只读模式，不支持创建或改写文件。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F14",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},30115,"运行 web_app.py 时下载模型报错怎么办？","这通常是因为本地网络无法直接访问 Hugging Face 服务器（常见于中国大陆地区）。即使网络正常，脚本连接也可能超时。解决方案有两种：\n1. 使用镜像源：运行脚本前设置 Hugging Face 镜像。\n2. 本地下载：手动下载模型文件，并将代码中的模型名称替换为本地文件夹路径。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F9",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},30116,"如何配置使用 Anthropic 模型？","FastCode 支持 Anthropic 模型。如需使用原生 Anthropic API，请按以下步骤配置：\n1. 在 config\u002Fconfig.yaml 第 145 行，将 provider: \"openai\" 改为 provider: \"anthropic\"。\n2. 在 .env 文件中设置 ANTHROPIC_API_KEY=您的密钥。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F4",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},30117,"遇到 tree-sitter 0.23.x 版本兼容性错误（QueryCursor 不存在）如何解决？","tree-sitter 0.23.x 移除了 QueryCursor 类。若使用该版本，需将代码中的 QueryCursor 替换为 query.matches() 方法。或者升级环境至 Python 3.10+ 以使用 tree-sitter 0.25.x 及以上版本，从而避免此兼容性问题。","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FFastCode\u002Fissues\u002F3",[166],{"id":167,"version":168,"summary_zh":169,"released_at":170},212652,"v1.0.1","## 变更内容\n* 新功能：添加 MCP 支持\n* 修复：添加 OpenAI `max_tokens`\u002F`max_completion_tokens` 兼容层\n* 修复嵌入器，在可用时使用 Apple Silicon MPS","2026-02-25T14:30:16"]