How magic5644/graph-it-live works
Graph-It-Live is a local codebase-analysis product exposed through VS Code, a CLI, and MCP tools. The main workflow is to index a workspace, analyze file and symbol relationships, then explore or query the resulting graph and receive navigable or agent-ready output. The graph preserves the documented review, dead-code, call-graph, codemap, wiki, and bounded-context capabilities. Several subsystem links rely on README descriptions or SOURCE INDEX references; unsampled implementations are represented at their existing directory paths.
Main entry points: commands CLI commands · runtime.ts CLI runtime · McpWorker.ts MCP worker · extension.ts VS Code extension
Components 29
User surfaces
- CLI commands
src/cli/commands - VS Code extension
src/extension/extension.ts - MCP server
src/mcp/mcpServer.ts - CLI runtime
src/cli/runtime.ts - MCP worker
src/mcp/McpWorker.ts - MCP worker state
src/mcp/shared/state.ts
Workspace indexing
- Workspace graph index
src/analyzer/Spider.ts - File and language parsing
src/analyzer/Parser.ts - AST worker host
src/analyzer/ast/AstWorkerHost.ts - Path resolution
src/analyzer/utils/PathResolver.ts - Workspace boundaries
src/analyzer/utils/workspaceBoundary.ts - Shared index cache
src/analyzer/cache/IndexCache.ts
Graph analysis
- Cross-file call graph
src/analyzer/callgraph/CallGraphQuery.ts - Symbol analysis
src/analyzer/SymbolAnalyzer.ts - Dead-code and impact review
src/analyzer/ReviewGateAnalyzer.ts
Context and review
- Bounded graph context
src/analyzer/graph-context/GraphContextRetriever.ts - Natural-language query
src/analyzer/QueryEngine.ts - LLM provider selection
src/analyzer/llm/LlmClientFactory.ts - LLM client interface
src/analyzer/llm/LlmClient.ts - MCP query tool
src/mcp/tools/query.ts
Views and output
- Graph exploration UI
src/webview/App.tsx - Live call graph view
src/extension/services/CallGraphViewService.ts - Navigable code wiki
src/analyzer/wiki/WikiGenerator.ts - HTML graph export
src/analyzer/export/HtmlExporter.ts - CLI output formatting
src/cli/formatter.ts - Graph and query types
src/shared/query-types.ts
Other components
- Developer
- VS Code user
- MCP client
Connections 34
- Developer → CLI commands: runs commands
README.md - VS Code user → VS Code extension: explores workspace
README.md - MCP client → MCP server: invokes tools
README.md - CLI commands → CLI runtime: uses runtime
src/cli/index.ts - CLI runtime → File and language parsing: configures analysis
src/cli/runtime.ts - CLI runtime → Workspace graph index: builds workspace graph
src/cli/runtime.ts - CLI runtime → AST worker host: starts worker
src/cli/runtime.ts - CLI runtime → Path resolution: resolves paths
src/cli/runtime.ts - CLI runtime → Workspace boundaries: checks workspace
src/cli/runtime.ts - CLI runtime → Shared index cache: uses shared cache
src/cli/runtime.ts - VS Code extension → Shared index cache: indexes workspace
- VS Code extension → Workspace graph index: refreshes graph
- MCP server → MCP worker: starts worker
src/mcp/McpWorker.ts - MCP worker → MCP worker state: uses shared state
src/mcp/McpWorker.ts - MCP worker → File and language parsing: configures analysis
src/mcp/McpWorker.ts - MCP worker → Workspace graph index: builds workspace graph
src/mcp/McpWorker.ts - MCP worker → Shared index cache: uses shared cache
src/mcp/McpWorker.ts - Workspace graph index → File and language parsing: parses files
- CLI commands → MCP query tool: runs natural query
src/cli/commands/query.ts - MCP query tool → Natural-language query: delegates query
src/mcp/tools/query.ts - MCP query tool → Cross-file call graph: initializes index
src/mcp/tools/query.ts - Natural-language query → LLM client interface: uses client interface
src/analyzer/QueryEngine.ts - LLM provider selection → LLM client interface: returns provider client
src/analyzer/llm/LlmClientFactory.ts - LLM provider selection → Bounded graph context: supports query workflow
- Natural-language query → Cross-file call graph: queries call index
src/analyzer/QueryEngine.ts - Bounded graph context → Natural-language query: uses graph queries
src/analyzer/graph-context/GraphContextRetriever.ts - Graph exploration UI → VS Code extension: receives graph updates
- VS Code extension → Live call graph view: provides call graph
- CLI commands → Dead-code and impact review: runs review checks
src/cli/commands/reviewPr.ts - CLI commands → Navigable code wiki: generates wiki
README.md - CLI commands → HTML graph export: exports graph
README.md - CLI commands → CLI output formatting: formats results
src/cli/index.ts - Natural-language query → Graph and query types: returns query results
src/analyzer/QueryEngine.ts - MCP query tool → CLI output formatting: encodes TOON
src/mcp/tools/query.ts