-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecord-demo.sh
More file actions
58 lines (49 loc) · 1.66 KB
/
Copy pathrecord-demo.sh
File metadata and controls
58 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
G=$'\033[0;32m' R=$'\033[0;31m' Y=$'\033[0;33m' B=$'\033[1m' D=$'\033[2m' Z=$'\033[0m' C=$'\033[0;36m'
type_cmd() {
printf "${D}\$ ${Z}"
for ((i=0; i<${#1}; i++)); do printf "%s" "${1:$i:1}"; sleep 0.03; done
echo ""
}
clear
echo ""
echo " ${B}Graphify Toolkit${Z} ${D}v1.0${Z}"
echo " ${D}Turn any codebase into a queryable knowledge graph${Z}"
echo ""
sleep 1
type_cmd "graphify build ."
sleep 0.5
echo ""
echo " ${C}Scanning project files...${Z}"
sleep 0.5
echo " ${G}+${Z} 142 files analyzed"
echo " ${G}+${Z} 387 nodes extracted ${D}(functions, classes, modules, configs)${Z}"
echo " ${G}+${Z} 614 edges mapped ${D}(imports, calls, extends, configures)${Z}"
sleep 0.3
echo " ${G}+${Z} Graph written to ${D}graphify-out/graph.json${Z} ${D}(248 KB)${Z}"
echo ""
sleep 1
type_cmd "graphify query \"What depends on the auth module?\""
sleep 0.5
echo ""
echo " ${B}5 dependents found:${Z}"
echo ""
echo " ${C}auth/middleware.ts${Z} ${D}--imports--> ${Z}${B}api/routes.ts${Z}"
echo " ${C}auth/middleware.ts${Z} ${D}--imports--> ${Z}${B}api/admin.ts${Z}"
echo " ${C}auth/session.ts${Z} ${D}--calls---> ${Z}${B}db/users.ts${Z}"
echo " ${C}auth/config.ts${Z} ${D}--configures->${Z}${B}app/server.ts${Z}"
echo " ${C}auth/types.ts${Z} ${D}--extends--> ${Z}${B}shared/types.ts${Z}"
echo ""
sleep 1.5
type_cmd "graphify path \"auth/session.ts\" \"api/billing.ts\""
sleep 0.5
echo ""
echo " ${B}Shortest path (3 hops):${Z}"
echo ""
echo " ${C}auth/session.ts${Z} -> ${C}auth/middleware.ts${Z} -> ${C}api/routes.ts${Z} -> ${C}api/billing.ts${Z}"
echo ""
sleep 1.5
echo " ${B}Zero cloud.${Z} ${D}Just bash, jq, and python3.${Z}"
echo ""
sleep 3