VeyrForge/codehelper

GitHub: VeyrForge/codehelper

Codehelper 在本地对 git 仓库进行代码索引与符号图构建,通过 MCP 协议为 AI 编程助手提供项目感知级别的代码搜索和影响分析能力,同时保持代码不离本地。

Stars: 1 | Forks: 0

# Codehelper **为 AI 编程助手提供的本地优先代码库智能分析。** Codehelper 会在您的本地机器上对 git 仓库进行索引,构建符号和调用图,并暴露 **60 多个 MCP 工具**,以便 Cursor、Claude Code、Codex 和其他 MCP 客户端能够搜索、理解并安全地修改*您的*代码 —— 而无需将整个代码库上传到云端模型。 [![版本](https://img.shields.io/badge/version-3.0.1-blue)](VERSION) [![Go](https://img.shields.io/badge/go-1.25+-00ADD8)](https://go.dev/) [![MCP](https://img.shields.io/badge/MCP-server-purple)](https://modelcontextprotocol.io/) [![许可证:源码可用](https://img.shields.io/badge/license-Source--Available-orange)](LICENSE) [![平台](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey)](#支持的平台) ## 使用 Codehelper 的三大理由 1. **具备项目感知能力的 agent** — 在本地搜索符号、调用方和影响范围,而不是全量 grep 整个文件。 2. **支持离线工作** — 无需 API 密钥;您的代码始终保留在您的本地机器上。 3. **适配您的编辑器** — 支持 Cursor、Claude Code、Codex 的 MCP;每个仓库只需执行一次 `codehelper init`。 ## 安装说明 **Linux / macOS(推荐):** ``` curl -fsSL https://raw.githubusercontent.com/VeyrForge/codehelper/main/scripts/install.sh | sh ``` **Windows (PowerShell):** ``` powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 ``` **从源码构建**(需要 Go 1.25+、CGO 和 C 编译器): ``` git clone https://github.com/VeyrForge/codehelper.git && cd codehelper npm run build ``` [GitHub Releases](https://github.com/VeyrForge/codehelper/releases) 上提供的 **3.0.1** 预构建 bundles(Linux、macOS、Windows)包含 `codehelper`、MCP 服务器、**`ge` 1.0.0** 以及 **`greencompress` 1.0.0**。 **更新:** `codehelper upgrade` 会从 [VeyrForge/codehelper](https://github.com/VeyrForge/codehelper) 下载最新版本。`codehelper update` 会从本地的 git 检出中重新构建。 ## 30 秒示例 ``` cd your-git-repo codehelper init codehelper help tools --main ``` 在首次执行 `init` 后重新加载 Cursor 或 Claude Code,然后在每个会话中调用一次 **`project_context`**,以便 agent 了解存在哪些工具以及索引的新鲜度。 ## 查看运行效果 目前还没有内置的演示视频 —— 以下是典型的首次会话过程: ``` $ codehelper init init: ready — index + watch daemon active $ codehelper status symbols: 1247 edges: 3891 freshness: current $ codehelper help tools --main project_context bootstrap tool catalog + index stats query search the symbol graph context source + callers + callees impact blast radius before you edit ``` 已记录的基准测试结果:[docs/BENCHMARK.md](docs/BENCHMARK.md)。 ## 支持的平台 | 平台 | 安装 | 备注 | |----------|---------|-------| | **Linux** | `scripts/install.sh` | 完全支持;主要 CI 目标 | | **macOS** | `scripts/install.sh` | 提供 Universal 及各架构的发布二进制文件 | | **Windows** | `scripts/install.ps1` | 支持 x64 | | 客户端 | 设置 | |--------|--------| | **Cursor** | 通过 `codehelper init` 生成项目级 `.mcp.json` | | **Claude Code** | 在 `~/.claude.json` 中进行托管配置 | | **Codex** | 读取生成的 `AGENTS.md` | ## 工作原理 | 层级 | 技术 | |-------|------------| | 索引 | [tree-sitter](https://tree-sitter.github.io/) 解析器 + SQLite 符号/调用图 | | 搜索 | BM25 + trigrams + 调用图排序(可选:通过本地 embed 服务器进行语义重排) | | MCP 传输 | stdio(默认)或 HTTP (`codehelper mcp --http :8765`) | | 可选 LLM | [Green Engine](https://github.com/VeyrForge/GreenEngine) embed/chat + [Green Compress](https://github.com/VeyrForge/GreenCompress) 权重 | `init` 会对代码库进行索引,启动 watch daemon,为您的编辑器配置 MCP,并写入 agent 规则。可选的本地 dashboard:`ge ui serve` → http://127.0.0.1:8780 完整的工具参考:[docs/MCP_TOOLS.md](docs/MCP_TOOLS.md) ## 基准测试 有关在真实代码库上记录的检索和索引基准测试,请参阅 [docs/BENCHMARK.md](docs/BENCHMARK.md)。 ## 文档 - [docs/MCP_TOOLS.md](docs/MCP_TOOLS.md) — MCP 工具参考 - [docs/BENCHMARK.md](docs/BENCHMARK.md) — 基准测试结果 - [CHANGELOG.md](CHANGELOG.md) — 版本历史 - [third_party/README.md](third_party/README.md) — 内置的 Green stack 二进制文件 ## 限制 - 需要一个 **git** 仓库才能进行索引。 - 从源码构建需要 **CGO** 和 C 编译器 (tree-sitter)。 - 语义重排和部分增强功能需要可选的本地 LLM 服务([Green Engine](https://github.com/VeyrForge/GreenEngine))。 - Windows **arm64** 的预构建 CI 已暂时禁用;完全支持 x64。 ## 公开发布历史 请参阅 [CHANGELOG.md](CHANGELOG.md) 和 [GitHub Releases](https://github.com/VeyrForge/codehelper/releases)。 ## 许可证和授权使用 Codehelper 是**源码可用**软件 —— 并非开源软件。 您可以出于**个人使用**或在您的组织内**内部使用**的目的,**下载、克隆、安装、审查和运行** Codehelper。 您可以**复刻(fork)官方仓库**,但仅限于准备并向官方 VeyrForge 仓库提交贡献的目的。 **未经 VeyrForge 书面许可**,您不得重新分发 Codehelper、发布修改后的构建版本、出售或将其再许可、将其作为竞争性托管服务提供,或使用其源代码创建竞争产品。 教程和博客文章可以包含已发布源码中的**简短示例片段**用于说明,前提是它们不重新分发该软件或暗示其具有开源许可证。 如需商业再分发、OEM 许可或上述未涵盖的其他用途,请联系 VeyrForge。 本节为通俗语言的摘要。具有约束力的条款请参见 [LICENSE](LICENSE)。
标签:AI编程助手, EVTX分析, Go, MCP, Ruby工具, SOC Prime, 云安全监控, 代码智能, 开发工具, 日志审计, 符号图, 静态分析