Trace Execution Flows
The flows command traces execution paths from framework entry points through the call graph using BFS.
Basic Usage
Detect all entry points in a package:
Trace a specific entry point:
Cross-Module Tracing
Follow calls across package boundaries:
See Cross-Module Resolution for the algorithm details.
Source Enrichment
Include function source text in each step:
Supported Frameworks
Entry point detection uses _ENTRY_DECORATOR_PREFIXES, a dispatch table mapping framework names to decorator prefixes. A function is recognized as an entry point when its decorator starts with one of these prefixes.
| Prefix | Example |
|---|---|
app.default |
@app.default |
app.command |
@app.command("run") |
| Prefix | Example |
|---|---|
click.command |
@click.command() |
click.group |
@click.group() |
app.command |
@app.command() |
| Prefix | Example |
|---|---|
app.route |
@app.route("/api/users") |
blueprint.route |
@blueprint.route("/items") |
| Prefix | Example |
|---|---|
app.get/post/put/delete/patch |
@app.get("/users") |
router.get/post/put/delete/patch |
@router.post("/items") |
Beyond decorator-based detection, find_entry_points also recognizes:
- Test functions —
test_*prefix - Main guards —
if __name__ == "__main__"blocks __all__exports
Adding a new framework
Add a new key to _ENTRY_DECORATOR_PREFIXES in core/flows.py. The key is the framework name; the value is a list of decorator prefix strings. Matching uses startswith, so "router.get" matches @router.get("/path").
Stdlib Filtering
By default, stdlib and builtin callees (e.g. print, len, os.path.join) are excluded from BFS traces to reduce noise. Pass --no-exclude-stdlib to include them:
Depth Control
Limit BFS depth (default 5):