-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_jarvis.py
More file actions
66 lines (58 loc) · 1.78 KB
/
Copy pathrun_jarvis.py
File metadata and controls
66 lines (58 loc) · 1.78 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
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
"""
🤖 JARVIS - Main Launcher
Launch Jarvis AI System Controller
Usage:
python run_jarvis.py # GUI mode (default) - floating widget + chat card
python run_jarvis.py --voice # GUI mode + voice input enabled
python run_jarvis.py --cli # CLI/terminal text mode (no GUI)
"""
import sys
import os
import argparse
# Add project root to path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
if __name__ == "__main__":
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('jarvis.log'),
logging.StreamHandler()
]
)
parser = argparse.ArgumentParser(
description="JARVIS - Intelligent OS Automation Agent",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"--voice",
action="store_true",
help="Enable voice mode (works in both GUI and CLI)",
)
parser.add_argument(
"--cli",
action="store_true",
help="Run in CLI/terminal mode instead of GUI",
)
args, _ = parser.parse_known_args()
print("🤖 Launching JARVIS...")
print()
try:
if args.cli:
# Legacy terminal mode
from main import main
main()
else:
# GUI mode: floating widget + chat card (default)
from ui.app import run_gui_app
sys.exit(run_gui_app(enable_voice=args.voice))
except KeyboardInterrupt:
print("\n\n👋 JARVIS shutting down...")
sys.exit(0)
except Exception as e:
print(f"\n❌ Error: {str(e)}")
import traceback
traceback.print_exc()
sys.exit(1)