unslop-xyz/noodles
关于
你的代码库可能是由 AI 生成的。借助 Noodles 生成的交互式图表,你可以直观看到代码的实际运行方式,从而无需逐行阅读,也能理解 AI 构建了什么。
设计与媒体实测星标增长
- 24小时
- -1
- 7天
- -1
- 15天
- +4
- 1个月
- +6
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Noodles
TL;DR
Your codebase was probably AI-generated. Get a better handle on it.
Noodles creates interactive diagrams that visualize how your code actually works, so you can understand what the AI built without reading every line.

Hosted version available at https://unslop.xyz.
What it does
- Builds function call graphs using tree-sitter AST parsing
- Generates mermaid diagrams showing code flow
- Interactive viewer (pan, zoom, drill down into sub-diagrams)
- Repo analyzer - Analyze an entire repository
- PR analyzer - Analyze a GitHub PR to see what changed
Installation
pip install git+https://github.com/unslop-xyz/noodles.git
Or for development:
git clone https://github.com/unslop-xyz/noodles.git
cd noodles
pip install -e .
Configuration
Set your LLM API key as an environment variable:
export ANTHROPIC_API_KEY=your-key-here
Supported providers: anthropic (default), openai, gemini, groq, huggingface. To use a different provider:
export LLM_PROVIDER=openai
export OPENAI_API_KEY=your-key-here
Alternatively, create a .env file in your working directory (see .env.example if you cloned the repo).
An API key enables AI-powered enrichment of node descriptions and edge labels. Without it, the call graph will still be generated but nodes and edges won't have human-readable descriptions.
Noodles uses gh to fetch your repo/PR. To set it up, run:
brew install gh
gh auth login
Usage
Analyze a repository
noodles repo <repo-url>
Analyze a PR
noodles pr <github-pr-url>
Open viewer for existing results
noodles viewer <result-dir>
Options
--output-dir <dir>- Custom output directory for results--no-view- Don't open the viewer after analysis
MCP Server (Claude Code Integration)
Noodles can run as an MCP server, allowing Claude Code to analyze PRs and repositories directly.
Setup
Install with MCP dependencies:
pip install "noodles[mcp]"Add to your Claude Code settings (
~/.claude/settings.json):{ "mcpServers": { "noodles": { "command": "noodles-mcp" } } }Restart Claude Code
Verify with
/mcp- you should see the noodles server listed
Available Tools
Once configured, Claude Code can use these tools:
analyze_pr- Analyze a GitHub PRanalyze_repo- Analyze an entire repositoryanalyze_local_repo- Analyze a local repository (no cloning)analyze_changes- Analyze uncommitted local changesget_diagram- Get Mermaid diagram from analysisget_call_graph- Get full call graph JSONfind_path- Find call path between two functionsget_callers- Get functions that call a given functionget_callees- Get functions called by a given functionfilter_graph- Filter nodes by type (entry_points, endpoints, new, updated, orphans)get_summary- Get plain English summary of analysis impactget_changes- Get detailed change info for modified functions
Viewer controls
- Pan - Click and drag
- Zoom - Scroll wheel
- Drill down - Click
[+]nodes - Back - Escape
Supported languages
The call graph builder uses tree-sitter for AST parsing. Currently supported:
| Extension | Language |
|---|---|
.py |
Python |
.js |
JavaScript |
.jsx |
JavaScript |
.ts |
TypeScript |
.tsx |
TSX |
React/Next.js JSX component usage (<MyComponent />) is detected as function calls, so component hierarchies appear correctly in the call graph.
Not yet supported
- Other languages - Requires adding tree-sitter grammar and function detection logic
Limitations
Call detection
The call graph is built by detecting function calls in the AST. This works well for:
- Direct function calls:
foo(),obj.method() - Imported function calls
- JSX component usage:
<MyComponent />,<UI.Card />
This does not detect:
- Dynamic calls -
getattr(obj, 'method')(),obj[key]() - Callbacks passed to frameworks - e.g., route handlers registered via decorators
PR analyzer
The PR analyzer prunes the call graph to functions affected by a PR. This works best when:
- Changed functions call or are called by other functions
- The codebase has interconnected function calls
It produces limited results when:
- Changes are to isolated/standalone functions
- The codebase uses patterns not detected by AST analysis (decorators, dynamic dispatch)
探索相关项目
加载中…