Repofind

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

Local codebase search for agents: hybrid keyword/semantic search, locate, expand, related code.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Repofind 為本機程式碼庫建立索引,讓助理以關鍵字或語意搜尋、定位精確字串、擴充上下文並找出相似程式碼。

可以做什麼
  • 以關鍵字與語意混合排序搜尋已索引的本機儲存庫,回傳最相符的程式碼區塊及其檔案、行號範圍與分數
  • 定位環境變數、符號或錯誤碼等精確子字串,可輸出計數、檔案清單、位置或完整行
  • 以某筆命中為錨點,回傳同一檔案中相鄰的程式碼區塊
  • 依命中的檔案路徑與錨點行,在其他檔案中尋找相似程式碼
  • 讀取已儲存的基準模式查詢彙總及其節省的 token 數
適用情境
適合助理需要探索陌生或大型本機程式碼庫時,以更少、更精準的讀取取代反覆 grep 與逐一開啟檔案的猜測。也適用於重視檔案路徑與行號範圍的程式碼導覽問題。
執行需求
透過 npx 或 Docker 以 stdio 在本機執行,不需帳號,也未宣告驗證。選用的 TAKARA_API_KEY 可啟用語意搜尋;MIRU_OPENAI_BASE_URL 與 MIRU_OPENAI_EMBEDDING_MODEL 設定嵌入端點,MIRU_MAX_INDEX_FILES 限制索引規模。僅支援桌面端。
安裝前請注意
設定 TAKARA_API_KEY 後,查詢與程式碼區塊會傳送到相容 OpenAI 的嵌入端點(預設 infer.takara.ai),程式碼將離開本機。索引會跳過 .git、node_modules 與超過 1MB 的檔案,但允許副檔名內的其他內容都會被讀取。原產品的 auth 工具並未包含在內。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Repofind,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

repofind

Finding code in a repository you have never opened usually starts with a guess: a word to grep, a filename to try. repofind replaces the guessing with an index. Point it at a local directory and it walks the tree — skipping .git, node_modules, files over a megabyte, and anything outside a source-and-text extension allowlist — splits each file into consecutive 40-line chunks, and ranks those chunks against your question. One call returns the five best places to look, each with its file, line range, the chunk text, and a score.

Ranking is hybrid. A pinned BM25 scorer (k1 = 1.2, b = 0.75) over the chunk texts always runs. When a TAKARA_API_KEY is present in the environment, an embeddings step joins in: the query and the chunks are embedded through an OpenAI-compatible endpoint and each chunk's final score becomes bm25 + 10 * max(0, cosine). Without a key — or if the embedder fails — the result says so plainly in its notes and ranks by keyword alone. By default only the best hit per file is kept, so five hits mean five different files to open.

The other tools cover the rest of the exploration loop. locate finds an exact substring — an env var, a symbol, an error code — and reports it as a count, a file list, bare locations, or full lines. expand takes a hit you already have and returns its chunk plus the neighbouring chunks in the same file. find_related takes the same anchor and ranks chunks from every other file against it. read_benchmark rolls up saved benchmark-mode queries into a token-savings total. The original product's auth tool is not part of this rebuild: its interactive device login and AWS-profile validation cannot be reproduced from the published spec, so the surface here is five of the six tools.

CLI

bash
npx @reneturcios/repofind search '{"query": "retry backoff logic", "repo": "."}'npx @reneturcios/repofind locate '{"literal": "DATABASE_URL", "mode": "locations"}'npx @reneturcios/repofind expand '{"file_path": "src/client.ts", "anchor_line": 83}'npx @reneturcios/repofind find_related '{"file_path": "src/client.ts", "anchor_line": 83}'npx @reneturcios/repofind read_benchmark '{}'npx @reneturcios/repofind --version

Each tool subcommand takes the tool's arguments as one JSON string and prints the result as JSON. Exit codes: 0 on success, 1 on a runtime error, 2 on a usage error.

Environment variables: TAKARA_API_KEY enables the semantic half; MIRU_OPENAI_BASE_URL (default https://infer.takara.ai/v1) and MIRU_OPENAI_EMBEDDING_MODEL (default ds1-miru-int8) configure the embeddings endpoint; MIRU_MAX_INDEX_FILES caps the index (default 10000); MIRU_BENCHMARK_HISTORY_PATH overrides the benchmark history location.

MCP server

bash
npx -y @reneturcios/repofind mcp

MCP client config:

json
{  "mcpServers": {    "repofind": {      "command": "npx",      "args": ["-y", "@reneturcios/repofind", "mcp"]    }  }}

Tools

  • search — Hybrid semantic + keyword search over an indexed local codebase. Default for code exploration — one call per question.

    • query (string, required) — natural language or code query
    • repo (string, optional) — local directory to index; defaults to the working directory
    • include / exclude (string arrays, optional) — gitignore-style glob patterns against repo-relative paths
    • dedupe_by_file (boolean, default true) — keep the best hit per file

    Returns {hits, ranking, notes} with at most 5 hits; each hit is {file_path, absolute_path, start_line, end_line, anchor_line, truncated, snippet, score} with the score rounded to 4 decimals.

  • locate — Find exact substrings (env vars, symbols, error codes) in an indexed local codebase.

    • literal (string, required); mode one of count, files, locations, lines (default lines); limit caps locations/lines; ignore_case (default false); repo, include, exclude as in search.
  • expand — Return more context in the same file around a search hit: the anchor chunk plus neighbouring chunks.

    • file_path and anchor_line (required); before / after chunk counts (default 1 each).
  • find_related — Find similar code in other files, from a hit's file_path and anchor_line. Returns the same {hits, ranking, notes} shape as search, with the source file excluded.

  • read_benchmark — Cumulative token-savings rollup from saved benchmark-mode queries. Returns {queries, total_tokens_saved, average_tokens_saved}; a missing history file is a zero rollup, not an error.

Docker

bash
docker run -i ghcr.io/cloudcorprecords/repofinddocker run --rm ghcr.io/cloudcorprecords/repofind locate '{"literal": "TODO"}'

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (temp fixture repos, fake embedder, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

來源:README.md,提交 520b9e5

工具

5

locate

Find exact substrings (env vars, symbols, error codes) in an indexed local codebase.

輸入參數moderepolimitexcludeincludeliteral必填ignore_case

expand

Return more context in the same file around a search hit: the anchor chunk plus neighbouring chunks.

輸入參數repoafterbeforefile_path必填anchor_line必填

read_benchmark

Cumulative token-savings rollup from saved benchmark-mode queries.

輸入參數repo

版本歷史

1
  1. v0.1.0最新Nov 5, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分