Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cortex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,25 @@

return 0

def dashboard(self):
"""Launch the real-time system monitoring dashboard"""
try:
from cortex.dashboard import DashboardApp

app = DashboardApp()
app.run()
return 0
except ImportError as e:
self._print_error(f"Dashboard dependencies not available: {e}")
cx_print("Install required packages with:", "info")
cx_print(" pip install psutil pynvml", "info")
return 1
except KeyboardInterrupt:
return 0
except Exception as e:
self._print_error(f"Dashboard error: {e}")
return 1


def show_rich_help():
"""Display beautifully formatted help using Rich"""
Expand Down Expand Up @@ -821,6 +840,9 @@
# Demo command (first - show this to new users)
demo_parser = subparsers.add_parser('demo', help='See Cortex in action (no API key needed)')

# Dashboard command
dashboard_parser = subparsers.add_parser('dashboard', help='Real-time system monitoring dashboard')

Check warning on line 844 in cortex/cli.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused local variable "dashboard_parser".

See more on https://sonarcloud.io/project/issues?id=cortexlinux_cortex&issues=AZr9--7zZ3ptCwdDNpLr&open=AZr9--7zZ3ptCwdDNpLr&pullRequest=277

# Wizard command
wizard_parser = subparsers.add_parser('wizard', help='Configure API key interactively')

Expand Down Expand Up @@ -869,6 +891,8 @@
try:
if args.command == 'demo':
return cli.demo()
elif args.command == 'dashboard':
return cli.dashboard()
elif args.command == 'wizard':
return cli.wizard()
elif args.command == 'status':
Expand Down
Loading
Loading