Analyze project structure via AST parsing instead of reading every file.
python3 skills/code-graph/scripts/analyze.py <project_dir>
Creates .code-graph.json in the project root. Takes seconds for most projects.
python3 skills/code-graph/scripts/analyze.py <project_dir> --query <command> [args]
| Query | Description |
|---|---|
| --- | --- |
stats | Project overview: file counts, lines, functions, classes |
functions | List all functions with file + line number |
classes | List all classes with bases, methods, file + line |
calls | What does func call? (outgoing edges) |
callers | Who calls func? (incoming edges) |
file | Full summary of one file (functions, classes, imports, calls) |
imports | Import graph: file → modules imported |
search | Find functions/classes matching pattern |
stats then search to find what you needcallers to check impact--query)/.code-graph.json --output Re-run without --query to rebuild. The cache includes a fingerprint for staleness detection.
python3 skills/code-graph/scripts/analyze.py <project_dir> --exclude vendor --exclude tmp
Default excludes: node_modules, .git, __pycache__, .venv, dist, build, .next, coverage
共 1 个版本