# 安装 CodeGraph SDK
$ pip install codegraph-sdk
from codegraph import CodeGraph
# 接入你的仓库
cg = CodeGraph(
repo="github.com/your/repo",
token="ghp_***"
)
# 查询调用链路
result = cg.query(
"MATCH (f:Function)-[:CALLS*1..3]->(g)"
"WHERE f.name = 'authenticate'"
"RETURN f, g"
)
▼ 返回结果
authenticate
──▶
verifyJWT
──▶
decode
depth: 2
authenticate
──▶
checkPermission
depth: 1
authenticate
──▶
logAccess
depth: 1