Trace relationships between components, find call chains, and understand data flow using graphify path.
Trace relationships between any two components using graphify path — the most powerful command for understanding how code connects.
path Command1# Always signal activity first
2mkdir -p graphify-out && touch graphify-out/.graphify-activity
3
4# Trace from A to B
5graphify path <source> <target>
imports_from, calls, contains, references1graphify path scripts/dictionary/yt-to-content-v2.py tasks/content.yaml
Typical output:
scripts/dictionary/yt-to-content-v2.py
→ imports_from → argparse (stdlib)
→ calls → main()
→ calls → parse_args()
→ reads → tasks/content.yaml (via Taskfile.yaml vars)
1graphify path tasks/content.yaml scripts/dictionary/yt-to-content-v2.py
1graphify path scripts/dictionary/extract_vocab.py data/dictionary/capitalism/vocabulary.yaml
1graphify path .github/skills/youtube-content/SKILL.md scripts/dictionary/yt-to-content-v2.py
1graphify path content/courses/ags/storytelling/j-wiebe/youtube-content/articulate-your-thoughts/index.md scripts/dictionary/yt-to-content-v2.py
| Edge Type | Meaning | Example |
|---|---|---|
imports_from | Module imports another | import yaml |
calls | Function calls another | main() → parse_args() |
contains | File contains symbol | yt-to-content-v2.py → mergeParams() |
references | Symbol references another | mergeParams() → deepMerge() |
reads | Code reads file | script → tasks/content.yaml |
writes | Code writes file | script → vocabulary.yaml |
tasks/content.yaml
→ contains → yt:content task
→ references → scripts/dictionary/yt-to-content-v2.py (via {{.DICT_PYTHON}})
→ calls → graphify . (indirect)
scripts/dictionary/yt-to-content-v2.py
→ contains → main()
→ calls → argparse.ArgumentParser.parse_args()
→ calls → yt_to_content.main()
→ calls → create_folders()
→ writes → .prompts/youtube/prompts/j-wiebe/articulate-your-thoughts-prompt.md
→ writes → .prompts/youtube/transcripts/j-wiebe/articulate-your-thoughts-transcript.txt
1# Find what writes to it
2graphify query "what writes to data/course/ags/storytelling/j-wiebe/youtube-content/course-structure.yaml?"
3# Then trace
4graphify path scripts/dictionary/yt-to-content-v2.py data/course/ags/storytelling/j-wiebe/youtube-content/course-structure.yaml
1# Find all callers
2graphify query "what calls mergeParams?"
3# Or trace from each caller
4graphify path scripts/dictionary/merge_params.py scripts/dictionary/yt-to-content-v2.py
1# YouTube URL → Hugo page
2graphify path scripts/dictionary/yt-to-content-v2.py content/courses/ags/storytelling/j-wiebe/youtube-content/articulate-your-thoughts/index.md
1# Config → Script → Output
2graphify path tasks/content.yaml scripts/dictionary/yt-to-content-v2.py
3graphify path scripts/dictionary/yt-to-content-v2.py .prompts/youtube/prompts/j-wiebe/articulate-your-thoughts-prompt.md
1# Find all paths between two nodes (if multiple exist)
2for target in scripts/dictionary/*.py; do
3 graphify path tasks/content.yaml "$target" 2>/dev/null | head -20
4done
1# 1. Find the path
2graphify path A B
3
4# 2. Deep-dive on intermediate nodes
5graphify explain intermediate_node.py
1# Only show import chains
2graphify path A B | grep "imports_from"
3
4# Only show call chains
5graphify path A B | grep "calls"
| Issue | Solution |
|---|---|
| No path found | Nodes not in same graph; rebuild with graphify update . |
| Path too long | Graph has many indirect connections; use explain on key nodes |
| Wrong direction | Try graphify path B A (reverse) |
| Missing edges | Full graph needed (with API key) for doc/file references |