Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
MCP serverAn toànQuy trình & bộ nhớ agentDễ cho người mới

octocode

bgauryy · bgauryy/octocode

Một công cụ nghiên cứu mã nguồn tiết kiệm token giúp các AI agent tìm kiếm và hiểu các tệp cục bộ cũng như các kho lưu trữ trên GitHub.

Code research platform for AI agents; find, understand, and prove context across your code and all of GitHub, in a fraction of the tokens. One toolset, MCP or CLI

949 sao78Giấy phép: MITCập nhật 10 ngày trước0 lượt mở

Xem trước

▍

Bạn có thể làm gì với nó

  • Cung cấp cho agent ngữ cảnh chuyên sâu từ các kho lưu trữ GitHub lớn mà không tiêu tốn quá nhiều token.
  • Tìm kiếm các triển khai hàm cụ thể trên nhiều dự án cục bộ và từ xa cùng một lúc.
  • Phân tích các pull request và gói npm để giúp agent hiểu các phụ thuộc bên ngoài.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

Octocode: agentic research platform

Evidence-first code research for AI agents and developers.

Octocode researches your local code and external code alike (GitHub repositories, PRs, npm) with one toolset: ripgrep + AST search, trees, precise reads, and LSP. Use it as a CLI or MCP server, backed by a Rust engine for fast, token-efficient results across single files or mega-repos.


Table of contents


Quick start

Prerequisites: Node.js 20.12+

1. Run the Octocode CLI with npx

npx octocode --help

2. Authenticate with GitHub - optional, but unlocks private repositories and higher API rate limits:

npx octocode auth login
npx octocode status       # verify the active token source

3. Choose your interface. Same tools and Rust engine on both. (Clone is on by default in the CLI, opt-in for MCP.)

🖥️ CLI - research straight from your terminal:

npx octocode

🤖 MCP - one-click install:

Show more install options (Windsurf, Kiro, Goose, LM Studio, Claude Code)

Claude Code:

claude mcp add-json octocode --scope user '{"command":"npx","type":"stdio","args":["octocode-mcp@latest"]}'

Any other client: npx octocode install


Use it as an MCP server

Add to your MCP client config (or use a one-click install above):

{
  "octocode": {
    "command": "npx",
    "type": "stdio",
    "args": ["octocode-mcp@latest"]
  }
}

Put a GitHub token and options under env (see Configuration).

Use it as an agentic-friendly CLI

Run npx octocode and agents figure out the rest. The bare command prints built-in usage and the full tool catalog, so any coding agent knows how to drive it out of the box, no MCP client or extra wiring required.

npx octocode                                         # self-describing usage for agents
npx octocode tools                                   # list every tool
npx octocode tools localSearchCode --scheme          # inspect a tool's schema

Every MCP tool is also a plain command: JSON in, token-efficient YAML out. Local paths route to local tools; owner/repo[/path] routes to GitHub.

npx octocode tools localSearchCode \
  --queries '{"path":".","searchText":"authenticate","maxFiles":20}'
results:
  - id: localSearchCode-1
    data:
      files:
        - path: src/auth.ts
          matches:
            - line: 12
              value: "export async function authenticate(req: Request) {"

Learn more at octocode.ai.


Why Octocode

Agents code better from evidence than from guesses. Octocode researches two worlds with one flow, your local code and external code on GitHub and npm, and hands back compact, citable context before an agent changes, reviews, or explains code. Code is truth; context is the map.

Most tools do one slice (web search, or grep your repository) and hand back a fixed blob. Octocode covers the whole loop and lets the agent decide what data it needs next:

  • Agent-driven, efficient flows. Instead of one-shot dumps, Octocode chains cheap steps into an optimized research flow: broad code search, then fetch only the exact matched lines/region, with smart pagination and out-of-the-box minification so the model never over-fetches. Every result carries next-step hints to the cheapest follow-up.
  • Scales to monorepos. Spot a pattern in one repository, follow the PR that introduced it, then trace it across other repositories and your own files, without leaving the chat. Clone any repository and study it locally.
  • Smart GitHub flow. Parallel bulk queries across code, PRs, commits, issues, and repositories, all with the same search-broad, read-narrow, trace-semantically discipline.
  • Works without GitHub. Clone any repository and point the local tools (search, AST, LSP, content) at it, same evidence-first flow.
  • Reads shape, not noise. On-the-fly minify/skeletonize across 70+ languages: a 100 KB file in a few hundred tokens, not walls of boilerplate.
  • Fast, self-contained. Search, parsing, navigation, and redaction run in one prebuilt Rust engine: quick on a laptop or a mega-repo,
Xem mã nguồn trên GitHub