-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (39 loc) · 1.59 KB
/
Copy pathmain.py
File metadata and controls
54 lines (39 loc) · 1.59 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
import sys
from colorama import Fore, Style, init
from analyzer import GitHubRepoAnalyzer
init(autoreset=True)
def main():
print(f"{Fore.CYAN}{Style.BRIGHT}🚀 GITHUB REPOSITORY ANALYZER 🚀{Style.RESET_ALL}")
repo_url = sys.argv[1] if len(sys.argv) > 1 else input("Enter GitHub repo URL: ").strip()
if not repo_url:
print("❌ No URL provided")
return
analyzer = GitHubRepoAnalyzer(repo_url)
results = analyzer.analyze()
print(f"\n{Fore.GREEN}Repository:{Style.RESET_ALL} {results['repository']['name']}")
print(f"{Fore.GREEN}Stars:{Style.RESET_ALL} {results['repository']['stars']}")
print(f"\n{Fore.YELLOW}TECH STACK:{Style.RESET_ALL}")
print(results["tech_stack"])
print(f"\n{Fore.YELLOW}STRUCTURE:{Style.RESET_ALL}")
print(results["structure"])
print(f"\n{Fore.CYAN}AI INSIGHTS:{Style.RESET_ALL}\n")
print(results["ai_insights"])
print(f"\n{Fore.MAGENTA}BEGINNER EXPLANATION:{Style.RESET_ALL}\n")
print(results["beginner_explanation"])
print(f"\n{Fore.RED}SECURITY REVIEW:{Style.RESET_ALL}\n")
print(results["security_review"])
chat = input("\n💬 Enter chat mode? (y/n): ").lower()
if chat == "y":
print("\nType 'exit' to quit chat\n")
context = {
"tech_stack": results["tech_stack"],
"structure": results["structure"],
}
while True:
q = input("You: ")
if q.lower() in ["exit", "quit"]:
break
answer = analyzer.llm_chat(q, context)
print(f"\nAI: {answer}\n")
if __name__ == "__main__":
main()