docs: make Chinese README the default
CI / test (1.26, ubuntu-latest) (push) Waiting to run
CI / test (1.26, macos-latest) (push) Waiting to run
CI / build-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / build-onnx (push) Waiting to run
CI / benchmark (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
security / govulncheck (push) Waiting to run
security / trivy-fs (push) Waiting to run

This commit is contained in:
wehub-resource-sync
2026-07-13 10:23:36 +00:00
parent ea1eb58ceb
commit 2eb041bed8
+86 -81
View File
@@ -1,3 +1,8 @@
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/zzet/gortex) · [上游 README](https://github.com/zzet/gortex/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
<div align="center">
<p align="center">
@@ -5,9 +10,9 @@
</p>
### High-performance and efficient code-intelligence engine for AI agents and IDE
#### Indexes code into graph and exposes it via CLI, MCP Server, and web UI. Multi-repository support by default.
#### Single static binary for macOS, Linux, and Windows — no dependency chain, simple installation and use.
### 面向 AI 智能体与 IDE 的高性能高效代码智能引擎
#### 将代码索引为图结构,并通过 CLIMCP Server 与 Web UI 暴露。默认支持多仓库。
#### macOSLinux Windows 单静态二进制 — 无依赖链,安装与使用简单。
---
[![CI](https://github.com/zzet/gortex/actions/workflows/ci.yml/badge.svg)](https://github.com/zzet/gortex/actions/workflows/ci.yml)
@@ -25,44 +30,44 @@
<a href="https://trendshift.io/repositories/36832" target="_blank"><img src="https://trendshift.io/api/badge/repositories/36832" alt="zzet%2Fgortex | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</div>
High-quality parsing 257 languages/grammars through tree-sitter AST analysis, in-process resolvers, enhanced with [compiler-grade resolution](https://github.com/zzet/gortex/blob/main/docs/lsp.md) for Python, TypeScript / JavaScript, PHP, C#, Go, C, C++, Java, Kotlin, Swift, Zig, Rust, Ruby, Elixir, Ocaml, Haskell, and [others](https://github.com/zzet/gortex/blob/main/docs/languages.md#at-a-glance) - producing a persistent provenance-tiered knowledge graph of functions, classes, call chains, HTTP routes, and cross-service contracts and calls with a strong confidence model. 175 (configurable) MCP tools - use only what you need. Zero dependencies. Plug and play across 18 coding agents. **Up to 50× fewer tokens per response**. Reproducible [benchmarks](BENCHMARK.md).
通过 tree-sitter AST 分析、进程内解析器,并借助 [编译器级解析](https://github.com/zzet/gortex/blob/main/docs/lsp.md))(适用于 PythonTypeScript / JavaScriptPHP、C#、Go、C、C++JavaKotlinSwiftZigRustRubyElixirOcamlHaskell 及[其他语言](https://github.com/zzet/gortex/blob/main/docs/languages.md#at-a-glance))),高质量解析 257 种语言/语法,生成函数、类、调用链、HTTP 路由以及跨服务契约与调用的持久化、来源分级知识图谱,并具备强置信度模型。175 个(可配置)MCP 工具 — 按需使用即可。零依赖。即插即用,支持 18 种编程智能体。**每次响应最多可减少 50× token**。可复现的[基准测试](BENCHMARK.md)
> 18 AI coding agents (Claude Code, Kiro, Cursor, Windsurf, VS Code / Copilot, Continue.dev, Cline, OpenCode, Antigravity, Codex CLI, Gemini CLI, Zed, Aider, Kilo Code, OpenClaw, Hermes, Oh My Pi, Pi) supported out of the box.
> 开箱即用支持 18 AI 编程智能体(Claude CodeKiroCursorWindsurfVS Code / CopilotContinue.devClineOpenCodeAntigravityCodex CLIGemini CLIZedAiderKilo CodeOpenClawHermesOh My Pi、Pi)。
>
> One install configures every one detected on your machine — see [docs/agents.md](docs/agents.md).
> 一次安装即可配置本机检测到的所有智能体 — 参见 [docs/agents.md](docs/agents.md)
<details>
<summary>Gortex Web UI — force-directed knowledge graph visualization</summary>
<summary>Gortex Web UI — 力导向知识图谱可视化</summary>
![Gortex Web UI — force-directed knowledge graph visualization](assets/graph.png)
![Gortex Web UI — 力导向知识图谱可视化](assets/graph.png)
</details>
## Why it matters
## 为何重要
- **50× fewer tokens per response** — graph-native lookups beat naive file reads. Agents read **just what they need**, not the full file, not the 500-line file around it.
- **Full development cycle** - no 'read file before edit'. Agents ask for sources, tell what to change, and don't waste context of reading noise.
- **257 languages/grammars** - every file in the repository reachable; no mix of tools and bloating/hallycinating agents. Three tiers (bespoke tree-sitter, regex, forest-backed signatures) plus Jupyter and Databricks notebooks → [docs/languages.md](docs/languages.md)
- **Cross-repo by default** — N repos in one graph; contracts, references, and call chains span repo boundaries with evidence-gated resolution, contract matching, impact analysis, per-session isolation → [docs/multi-repo.md](docs/multi-repo.md)
- **Extreamly fast analysis** — a precomputed depth-3 reach index turns blast-radius queries into O(seeds × reach) map lookups. Safe to ask "what breaks if I change this?" on every edit. No dozens of tool calls to grasp context.
- **Zero external dependencies** — single binary, everything in-process. No network, no model download to get started. Install, start daemon, use.
- **Agent integrations (17)** — `gortex init` configures every detected coding assistant on the machine → [docs/agents.md](docs/agents.md)
- **100+ MCP tools, 16 resources, 3 prompts** — symbol lookup, call chains, blast radius, dataflow, clone detection, refactoring, code actions → [docs/mcp.md](docs/mcp.md)
- **Semantic search default-on** — baked GloVe-50d (3.8 MB embedded), hybrid BM25 + vector + RRF, zero deps; opt-in MiniLM / Ollama / OpenAI → [docs/semantic-search.md](docs/semantic-search.md)
- **Speculative execution** — `preview_edit` / `simulate_chain` answer "what would change if I applied this WorkspaceEdit?" without touching disk
- **Live editor overlays** — push unsaved buffers as a shadow graph; tools read through it. Branching for parallel speculative sessions
- **GCX1 wire format** — published, round-trippable. **An additional 27% tokens vs JSON** at same fidelity → [docs/wire-format.md](docs/wire-format.md)
- **Long-living daemon** — one process serves every IDE window; live fsnotify, on-disk snapshots, restart, OS-supervised lifecycle
- **9 LLM providers (optional)** — local llama.cpp, Anthropic, OpenAI, Ollama, Claude / Codex CLI subprocess, Gemini, Bedrock, DeepSeek → [docs/llm.md](docs/llm.md)
- **Composable safety** — `verify_change`, `check_guards`, `audit_agent_config` flag broken callers, guard violations, stale docs before they ship
- **PR review, end to end** — `gortex prs` triages open PRs (per-PR blast radius, merge-order conflicts via shared communities, AI-ranked queue, reviewer suggestions); `gortex review` emits line-anchored findings with a BLOCK/REVIEW/APPROVE verdict from a graph-grounded rulepack; MCP tools (`pr_risk`, `get_pr_impact`, `review`, `review_pack`, `post_review`, …) expose it to agents → [docs/cli.md](docs/cli.md)
- **HTTP server + Web UI** — versioned `/v1/*` API + MCP 2026 Streamable HTTP; standalone Next.js 15 UI with five 3D graph modes → [docs/server.md](docs/server.md)
- **Telemetry off by default** — opt-in anonymous tool/command counts only (no code, paths, names, or exact counts); nothing transmitted unless you configure an endpoint. `gortex telemetry on|off|status`; honours `DO_NOT_TRACK` → [docs/telemetry.md](docs/telemetry.md)
- **每次响应减少 50× token** — 基于图谱的原生查询优于朴素的文件读取。智能体只读取**所需内容**,而非整个文件,也不是其周围那 500 行。
- **完整开发周期** — 无需「先读文件再编辑」。智能体查询源码、说明要改什么,不会因阅读噪音浪费上下文。
- **257 种语言/语法** — 仓库中每个文件均可触达;无需混用多种工具,避免智能体臃肿与幻觉。三层机制(定制 tree-sitter、正则、forest 支撑签名)外加 Jupyter Databricks 笔记本 → [docs/languages.md](docs/languages.md)
- **默认跨仓库** — N 个仓库纳入同一图谱;契约、引用与调用链跨越仓库边界,具备证据门控解析、契约匹配、影响分析与会话级隔离 → [docs/multi-repo.md](docs/multi-repo.md)
- **极速分析** — 预计算的深度 3 可达索引将爆炸半径查询转化为 O(seeds × reach) 的映射查找。每次编辑都可安全地问「若我改这里,什么会坏?」。无需数十次工具调用来把握上下文。
- **零外部依赖** — 单一二进制,一切在进程内完成。无需网络,无需下载模型即可起步。安装、启动守护进程、使用。
- **智能体集成(17** — `gortex init` 为本机检测到的每个编程助手完成配置 → [docs/agents.md](docs/agents.md)
- **100+ MCP 工具、16 个资源、3 个提示** — 符号查找、调用链、爆炸半径、数据流、克隆检测、重构、代码操作 → [docs/mcp.md](docs/mcp.md)
- **语义搜索默认开启** — 内置 GloVe-50d(嵌入 3.8 MB),混合 BM25 + 向量 + RRF,零依赖;可选 MiniLM / Ollama / OpenAI → [docs/semantic-search.md](docs/semantic-search.md)
- **推测执行** — `preview_edit` / `simulate_chain` 在不触碰磁盘的情况下回答「若我应用此 WorkspaceEdit,会发生什么变化?」
- **实时编辑器叠加层** — 将未保存缓冲区推送为影子图谱;工具透过它读取。支持并行推测会话的分支
- **GCX1 线格式** — 已发布、可往返。相同保真度下**比 JSON 再少 27% token** → [docs/wire-format.md](docs/wire-format.md)
- **长驻守护进程** — 单一进程服务所有 IDE 窗口;实时 fsnotify、磁盘快照、重启、操作系统监管生命周期
- **9 LLM 提供商(可选)** — 本地 llama.cppAnthropicOpenAIOllamaClaude / Codex CLI 子进程、GeminiBedrockDeepSeek → [docs/llm.md](docs/llm.md)
- **可组合安全** — `verify_change``check_guards``audit_agent_config` 在问题上线前标记损坏的调用方、守卫违规与过时文档
- **PR 审查,端到端** — `gortex prs` 对开放 PR 进行分诊(按 PR 的爆炸半径、通过共享社区检测合并顺序冲突、AI 排序队列、审查者建议);`gortex review` 输出锚定到行的发现,并给出基于图谱规则包的 BLOCK/REVIEW/APPROVE 裁决;MCP 工具(`pr_risk``get_pr_impact``review``review_pack``post_review`、…)向智能体暴露上述能力 → [docs/cli.md](docs/cli.md)
- **HTTP 服务器 + Web UI** — 版本化 `/v1/*` API + MCP 2026 Streamable HTTP;独立 Next.js 15 UI,含五种 3D 图谱模式 → [docs/server.md](docs/server.md)
- **遥测默认关闭** — 仅可选匿名工具/命令计数(不含代码、路径、名称或精确计数);除非你配置端点,否则不传输任何数据。`gortex telemetry on|off|status`;遵循 `DO_NOT_TRACK` → [docs/telemetry.md](docs/telemetry.md)
Full catalog of features: [docs/features.md](docs/features.md). Complete CLI reference: [docs/cli.md](docs/cli.md).
完整功能目录:[docs/features.md](docs/features.md)。完整 CLI 参考:[docs/cli.md](docs/cli.md)
## Install
## 安装
```bash
# macOS / Linux
@@ -72,9 +77,9 @@ curl -fsSL https://get.gortex.dev | sh
irm https://get.gortex.dev/install.ps1 | iex
```
Detects OS/arch, verifies SHA256 + cosign, installs to PATH. Re-run to upgrade. Homebrew, `.deb` / `.rpm` / `.apk`, scoop, signed binaries, and from-source builds: [docs/installation.md](docs/installation.md).
检测 OS/架构,校验 SHA256 + cosign,安装到 PATH。重新运行即可升级。Homebrew`.deb` / `.rpm` / `.apk`scoop、签名二进制及源码构建:[docs/installation.md](docs/installation.md)
## Quick Start
## 快速开始
```bash
gortex install # one-time machine setup (MCP, skills, slash commands)
@@ -83,40 +88,40 @@ gortex track ~/projects/myapp # add a repo
cd ~/projects/myapp && gortex init # per-repo: .mcp.json, hooks, community routing
```
Your AI assistant now uses graph queries. Full 15-minute walkthrough: [docs/onboarding.md](docs/onboarding.md).
你的 AI 助手现已使用图谱查询。完整 15 分钟入门:[docs/onboarding.md](docs/onboarding.md)
## Cross-Repo API Contracts
## 跨仓库 API 契约
Gortex auto-detects API contracts across repos and matches providers to consumers, surfaced via the `contracts` MCP tool and the web UI Contracts page.
Gortex 自动检测跨仓库 API 契约并将提供方与消费者匹配,通过 `contracts` MCP 工具及 Web UI 契约页面呈现。
| Contract type | Detection | Provider | Consumer |
| 契约类型 | 检测方式 | 提供方 | 消费方 |
|--------------|-----------|----------|----------|
| **HTTP routes** | Framework annotations (gin, Express, FastAPI, Spring, …) | Route handler | HTTP client calls (`fetch`, `http.Get`) |
| **gRPC** | Proto service definitions | Service RPC | Client stub calls |
| **GraphQL** | Schema type/field definitions | Schema | Query/mutation strings |
| **Message topics** | Kafka / RabbitMQ / NATS / Redis pub/sub | Publish calls | Subscribe calls |
| **WebSocket** | Event emit/listen patterns | `emit()` | `on()` |
| **Env vars** | `os.Getenv`, `process.env`, `.env` files | `Setenv` / `.env` | `Getenv` / `process.env` |
| **OpenAPI** | Swagger / OpenAPI spec files | Spec paths | (linked to HTTP routes) |
| **Temporal workflows** | Go / Java SDK annotations | Activity / workflow function | `ExecuteActivity` / `ExecuteChildWorkflow` |
| **HTTP 路由** | 框架注解(ginExpressFastAPISpring、…) | 路由处理器 | HTTP 客户端调用(`fetch``http.Get` |
| **gRPC** | Proto 服务定义 | 服务 RPC | 客户端桩调用 |
| **GraphQL** | Schema 类型/字段定义 | Schema | 查询/变更字符串 |
| **消息主题** | Kafka / RabbitMQ / NATS / Redis pub/sub | 发布调用 | 订阅调用 |
| **WebSocket** | 事件 emit/listen 模式 | `emit()` | `on()` |
| **环境变量** | `os.Getenv``process.env``.env` 文件 | `Setenv` / `.env` | `Getenv` / `process.env` |
| **OpenAPI** | Swagger / OpenAPI 规范文件 | 规范路径 | (关联至 HTTP 路由) |
| **Temporal 工作流** | Go / Java SDK 注解 | Activity / 工作流函数 | `ExecuteActivity` / `ExecuteChildWorkflow` |
Contracts are normalised to canonical IDs (e.g. `http::GET::/api/users/{id}`) and matched across repos to detect orphan providers / consumers and mismatches. See [docs/contracts.md](docs/contracts.md).
合约(Contracts)会被规范化为规范 IDcanonical IDs,例如 `http::GET::/api/users/{id}`),并在各仓库之间进行匹配,以检测孤立的提供方(providers/ 消费方(consumers)和不一致项。详见 [docs/contracts.md](docs/contracts.md)
## Scale — battle-tested on large repos
## 规模 — 在大型仓库上久经考验
Measured on an Apple Silicon laptop with the default CGO build.
Apple Silicon 笔记本电脑上使用默认 CGO 构建测得。
| Repository | Files | Nodes | Edges | Index time | Throughput | Peak heap |
| 仓库 | 文件数 | 节点数 | 边数 | 索引时间 | 吞吐量 | 峰值堆内存 |
| ---------- | ----: | ----: | ----: | ---------: | ---------: | --------: |
| [torvalds/linux](https://github.com/torvalds/linux) | 70,333 | 1,690,174 | 6,239,570 | ~3 min | 300 files/s | 5.07 GB |
| [microsoft/vscode](https://github.com/microsoft/vscode) | 10,762 | 204,501 | 808,902 | ~1 min | 143 files/s | 580 MB |
| zzet/gortex (self) | 430 | 5,583 | 53,830 | 3.4s | 127 files/s | 52 MB |
Parsing dominates wall time (6580 %); reference resolution and search-index build scale sub-linearly.
解析占用了绝大部分墙上时钟时间(wall time6580%);引用解析与搜索索引构建的扩展呈次线性(sub-linear)。
## Token savings dashboard
## Token 节省仪表盘
`gortex savings` reports tokens saved vs naive file reads — per-call, per-session, and cumulative across restarts, priced in USD against the headline model.
`gortex savings` 会报告相较朴素文件读取(naive file reads)所节省的 token——按每次调用、按会话,以及跨重启的累计值,并按头条模型(headline model)以美元计价。
```text
Gortex Token Savings
@@ -128,9 +133,9 @@ Last 7 days ██████████░░░░░░ 62.5% saved 60,1
All time ███████████████░ 93.3% saved 11,246,094 / 12,050,716 tokens $168.69
```
`--verbose` adds the per-tool breakdown; `--json` is machine-readable. Full reference: [docs/savings.md](docs/savings.md).
`--verbose` 提供按工具(per-tool)的细分;`--json` 为机器可读格式。完整参考:[docs/savings.md](docs/savings.md)
## Architecture
## 架构
```
gortex binary
@@ -143,34 +148,34 @@ gortex binary
Persistence ──> gob+gzip snapshot (pluggable backend)
```
Data flow, graph schema (node and edge kinds, multi-repo fields, test taxonomy), persistence model: [docs/architecture.md](docs/architecture.md).
数据流、图模式(graph schema,节点与边类型、多仓库字段、测试分类法)以及持久化模型:[docs/architecture.md](docs/architecture.md)
## Documentation
## 文档
| Topic | Reference |
| 主题 | 参考 |
| --- | --- |
| First-time walkthrough | [onboarding.md](docs/onboarding.md) |
| Installation & supply-chain verification | [installation.md](docs/installation.md) |
| Full feature catalog | [features.md](docs/features.md) |
| CLI reference | [cli.md](docs/cli.md) |
| MCP tools, resources, prompts | [mcp.md](docs/mcp.md) |
| Multi-repo workspaces | [multi-repo.md](docs/multi-repo.md) |
| HTTP server + Web UI + MCP 2026 transport | [server.md](docs/server.md) |
| Cross-repo API contracts | [contracts.md](docs/contracts.md) |
| Semantic search | [semantic-search.md](docs/semantic-search.md) |
| Optional LLM features | [llm.md](docs/llm.md) |
| LSP integration | [lsp.md](docs/lsp.md) |
| Per-community skills & agent usage | [skills.md](docs/skills.md) |
| AI agent adapters (17) | [agents.md](docs/agents.md) |
| Supported languages (257) | [languages.md](docs/languages.md) |
| Token savings | [savings.md](docs/savings.md) |
| GCX1 wire format | [wire-format.md](docs/wire-format.md) |
| Architecture & graph schema | [architecture.md](docs/architecture.md) |
| Evaluation methodology | [04-evaluation/](docs/04-evaluation/) |
| Telemetry & privacy | [telemetry.md](docs/telemetry.md) |
| Versioning policy | [versioning.md](docs/versioning.md) |
| 首次使用 walkthrough | [onboarding.md](docs/onboarding.md) |
| 安装与供应链验证 | [installation.md](docs/installation.md) |
| 完整功能目录 | [features.md](docs/features.md) |
| CLI 参考 | [cli.md](docs/cli.md) |
| MCP 工具、资源与提示词 | [mcp.md](docs/mcp.md) |
| 多仓库工作区 | [multi-repo.md](docs/multi-repo.md) |
| HTTP 服务器 + Web UI + MCP 2026 传输层 | [server.md](docs/server.md) |
| 跨仓库 API 合约 | [contracts.md](docs/contracts.md) |
| 语义搜索 | [semantic-search.md](docs/semantic-search.md) |
| 可选 LLM 功能 | [llm.md](docs/llm.md) |
| LSP 集成 | [lsp.md](docs/lsp.md) |
| 各社区技能与 agent 用法 | [skills.md](docs/skills.md) |
| AI agent 适配器(17 | [agents.md](docs/agents.md) |
| 支持的语言(257 | [languages.md](docs/languages.md) |
| Token 节省 | [savings.md](docs/savings.md) |
| GCX1 线格式(wire format | [wire-format.md](docs/wire-format.md) |
| 架构与图模式 | [architecture.md](docs/architecture.md) |
| 评估方法论 | [04-evaluation/](docs/04-evaluation/) |
| 遥测与隐私 | [telemetry.md](docs/telemetry.md) |
| 版本策略 | [versioning.md](docs/versioning.md) |
## Building from source
## 从源码构建
```bash
make build # binary with version stamping
@@ -178,12 +183,12 @@ make test # go test -race ./...
make lint # golangci-lint
```
Requires Go 1.26+ and CGO (for tree-sitter C bindings).
需要 Go 1.26+ CGO(用于 tree-sitter C 绑定)。
## License
## 许可证
Apache License 2.0. See [LICENSE.md](LICENSE.md). Copyright 2024-2026 Andrey Kumanyaev <me@zzet.org>.
Apache License 2.0。详见 [LICENSE.md](LICENSE.md)Copyright 2024-2026 Andrey Kumanyaev <me@zzet.org>
## Contributing
## 贡献
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on adding features, language extractors, and submitting PRs.
有关添加功能、语言提取器(language extractors)以及提交 PR 的指南,请参见 [CONTRIBUTING.md](CONTRIBUTING.md)。