ix
GitHubIx 是一个持久化代码库图谱工具,基于 tree-sitter 构建符号、调用和导入关系图。支持查询结构信息(如谁调用某符号、变更影响范围),提供 CLI 及 MCP 接口,辅助开发者快速理解代码结构并定位问题。
Trigger Scenarios
Install
npx skills add ix-infrastructure/Ix --skill ix -g -y
SKILL.md
Frontmatter
{
"name": "ix",
"license": "Apache-2.0",
"metadata": {
"source": "https:\/\/github.com\/ix-infrastructure\/Ix",
"version": "1.0.0"
},
"description": "Answer structural questions about a codebase — what a symbol is, what calls it, what a change breaks, where the hotspots are — from a persistent code graph via the ix CLI, instead of grepping."
}
Ix — Persistent Codebase Map
Ix parses a repository with tree-sitter (27 languages) into a graph of symbols, calls and imports, kept in a local backend (ArangoDB via Docker) and persisted between sessions. Query it for structural answers — what a symbol is, what calls it, how a flow moves, what a change breaks, which files carry the most weight, where the smells are — instead of reading files to find out. It does not answer prose or history questions.
First run
bash scripts/bootstrap.sh [repo-root] [--no-map] # macOS / Linux / Git Bash
powershell -ExecutionPolicy Bypass -File scripts/bootstrap.ps1 [repo-root] [-NoMap] # Windows
Checks Node >= 22, git, Docker and ripgrep, installs the CLI if missing, starts the backend, and maps the repo. Re-run it per repo.
Core workflow
| Step | Command | Example |
|---|---|---|
| Bounded context to start from | ix context |
ix context IngestionService |
| Start from an issue or bug report | ix context --from-issue |
ix context --from-issue issue.md (or - for stdin) |
| Understand a component | ix explain |
ix explain IngestionService |
| Trace a flow | ix trace |
ix trace user_login_flow |
| Blast radius of a change | ix impact |
ix impact verify_token |
Over MCP
When the ix-memory MCP server is connected (ix mcp; register it with
ix mcp install), the same graph is five tools. Reach for them where Grep,
Glob and Read need several steps or cannot answer at all:
| Question | Tool |
|---|---|
| Where to start on an issue or task; what a file or symbol touches | ix_context target=<name or path> or ix_context issue=<issue text> |
| Who calls / is called by / imports / is imported by X, across files | ix_neighbors symbol=X relation=callers|callees|imports|imported_by |
| What a change to X reaches, before editing it | ix_impact target=X |
| Which definition a name means when several share it | ix_search term=X |
| A definition's source by name, without knowing its file | ix_read symbol=X |
Not for a literal string or a line in a file you already have open: that is
Grep and Read. ix_context and ix_impact end in next records phrased as
tool calls; an ambiguous name answers with candidates and pick=/path= to
choose one. No health check is needed first. ix mcp --tools=all serves
every command as a tool.
How to spend calls
- Start with
ix context <file-or-symbol>— one bounded call that names the files and symbols that matter, with line ranges. - Read the ranges, not the files.
ix read <symbol>, orpath:120-180, is one to three thousand tokens; the file around it is commonly thirty to sixty thousand — and every one of those is re-sent on every later step of the turn. - Ask the graph what grep cannot:
ix callers,ix imported-byandix impactanswer "who uses this" and "what does a change reach" across files. Drill further withix search,ix callees,ix contains,ix imports,ix depends, reusing the exact entity IDs from earlier output. - Do not poll
ix status. A command that needs the backend says so itself, with a hint; a health check in front of every call is a wasted round trip. - Format:
llmis the one to read, andIX_FORMAT=llm(orix config set format llm) makes it the default so it need not be typed per call;jsonis for chaining or extracting a field. Onix contextthe same answer runs about 7.6 : 0.8 : 1 for json : llm : text.
Rules
- Answer codebase questions from targeted
ixcommands, not from training data. - Never guess a codebase fact that Ix holds.
- The graph is kept current for you: bootstrap maps the repo and editor
plugins re-ingest edited files. Run
ix map --silentonly when results are visibly stale, such as after a branch switch or a pull. - When Ix reports low confidence, say so, and never present it as established fact.
References — load on demand
- references/commands.md — command routing tables, decomposition recipes, best practices, the do-not-use list. Before any command beyond the table above.
- references/flags.md — every flag the CLI registers, per command, with values and defaults. Before guessing whether a flag exists.
- references/output-formats.md — the
llm|json|textrules, what does not implementllm, and which commands are Pro-gated. - references/troubleshooting.md — prerequisites,
ix doctor, backend health, environment flags. When a command fails. - scripts/bootstrap.sh / scripts/bootstrap.ps1 — first-run setup (bash; and native PowerShell for Windows).
Version History
-
dc740df
Current 2026-10-18 18:04
新增 Over MCP 章节说明工具用法;移除核心工作流中的 ix map 命令;更新支持语言数量为27种;新增 context --from-issue 功能说明。
-
5872bb9
2026-09-22 01:26
精简技能文档,移除安装说明,优化为优先使用行范围查询以节省Token,调整格式配置建议,并修正部分命令输出格式说明。
-
d3d95cb
2026-09-08 19:46
更新技能安装脚本以支持多Agent平台自动发现与部署;修复API文档与客户端调用的漂移问题并增加校验门禁。
-
043bc68
2026-08-16 15:58
新增 ix context 命令,用于生成确定性的有界上下文包,包含版本化输出模式及可恢复的调查状态管理。
- fa6ad7b 2026-08-12 09:08


