Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f7aed07
resolve conflicts
Sahilbhatane Jan 15, 2026
63ff56c
suggestion fix
Sahilbhatane Dec 8, 2025
ebdf74e
Test fix and automation security fix
Sahilbhatane Dec 14, 2025
56ee2ed
Fix: make tests Windows-compatible
Sahilbhatane Dec 18, 2025
796ba2b
chore: address static analysis findings
Sahilbhatane Dec 19, 2025
d02beaa
cnsversation resolved, plus add changes
Sahilbhatane Jan 2, 2026
be90d44
test fixs
Sahilbhatane Jan 2, 2026
2630f4e
No automation needed for QL
Sahilbhatane Jan 2, 2026
a11aa3b
Remove duplicate import of CortexCLI
Sahilbhatane Jan 2, 2026
073aa02
style: fix import ordering in dashboard.py
Sahilbhatane Jan 5, 2026
30cfca5
security: pin GitHub Actions to full commit hashes
Sahilbhatane Jan 5, 2026
02cef20
resolve suggestion
Sahilbhatane Jan 5, 2026
f315f52
Confirmation prompt for install in TUI dashboard
Sahilbhatane Jan 8, 2026
a932ccf
Fix suggestions and restre security file
Sahilbhatane Jan 10, 2026
23cf916
Linting
Sahilbhatane Jan 10, 2026
86e6f98
fix suggestions
Sahilbhatane Jan 10, 2026
6046e86
Suggestion fix
Sahilbhatane Jan 11, 2026
250caec
Revert automation.yml changes from PR — restore original file from main
Sahilbhatane Jan 11, 2026
4dce981
Suggestion fix
Sahilbhatane Jan 12, 2026
412efa8
lint fix
Sahilbhatane Jan 12, 2026
ec6af22
chore: apply black formatting and fix import ordering
Sahilbhatane Jan 15, 2026
b17f976
Merge branch 'main' into issue-244
Sahilbhatane Jan 15, 2026
840c282
resolve conflicts
Sahilbhatane Jan 15, 2026
f5e3502
suggestion fix
Sahilbhatane Dec 8, 2025
b6505d6
Test fix and automation security fix
Sahilbhatane Dec 14, 2025
f9e7d8e
Fix: make tests Windows-compatible
Sahilbhatane Dec 18, 2025
a82ff80
chore: address static analysis findings
Sahilbhatane Dec 19, 2025
cbdcecd
cnsversation resolved, plus add changes
Sahilbhatane Jan 2, 2026
e2cbd6c
test fixs
Sahilbhatane Jan 2, 2026
e02cf73
No automation needed for QL
Sahilbhatane Jan 2, 2026
b484934
Remove duplicate import of CortexCLI
Sahilbhatane Jan 2, 2026
37b61af
style: fix import ordering in dashboard.py
Sahilbhatane Jan 5, 2026
c19ce5c
security: pin GitHub Actions to full commit hashes
Sahilbhatane Jan 5, 2026
b3a4910
resolve suggestion
Sahilbhatane Jan 5, 2026
dd5d6c1
Confirmation prompt for install in TUI dashboard
Sahilbhatane Jan 8, 2026
ec07b1c
Fix suggestions and restre security file
Sahilbhatane Jan 10, 2026
7c198a4
Linting
Sahilbhatane Jan 10, 2026
bb8bb71
fix suggestions
Sahilbhatane Jan 10, 2026
daedde2
Suggestion fix
Sahilbhatane Jan 11, 2026
f1617a2
Revert automation.yml changes from PR — restore original file from main
Sahilbhatane Jan 11, 2026
53d4114
Suggestion fix
Sahilbhatane Jan 12, 2026
397b6a0
lint fix
Sahilbhatane Jan 12, 2026
7d2b186
rebase
Sahilbhatane Jan 16, 2026
1a45552
Merge branch 'issue-244' of https://github.com/Sahilbhatane/cortex in…
Sahilbhatane Jan 16, 2026
46f72d3
fix: handle psutil import gracefully to allow test collection in CI
Sahilbhatane Jan 16, 2026
58f06e9
Fix errors and resolve conversations
Sahilbhatane Jan 16, 2026
76416cb
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
f56e3c7
Coverage for test
Sahilbhatane Jan 16, 2026
f6ac52e
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
00a517a
Test Fix
Sahilbhatane Jan 16, 2026
50b39f6
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
ea7c462
Revert unrealted files, test fix and sonar fix
Sahilbhatane Jan 16, 2026
ccc2c94
Merge branch 'issue-244' of https://github.com/Sahilbhatane/cortex in…
Sahilbhatane Jan 16, 2026
e70dea2
Conversation fix
Sahilbhatane Jan 16, 2026
52262ba
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
5f6061e
test fix
Sahilbhatane Jan 16, 2026
24b51aa
Test Fix
Sahilbhatane Jan 16, 2026
7ec855f
test fix
Sahilbhatane Jan 16, 2026
5e541ab
resolve conversation
Sahilbhatane Jan 16, 2026
94fc0d7
adding pstuil for test
Sahilbhatane Jan 16, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ dmypy.json
# ==============================
.vscode/
.idea/
.cursor/
.spyproject/
.ropeproject/
.sublime-project
Expand Down
61 changes: 58 additions & 3 deletions cortex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ def install(
execute: bool = False,
dry_run: bool = False,
parallel: bool = False,
json_output: bool = False,
):
# Validate input first
is_valid, error = validate_install_request(software)
Expand Down Expand Up @@ -878,6 +879,19 @@ def install(
InstallationType.INSTALL, packages, commands, start_time
)

# If JSON output requested, return structured data and exit early
if json_output:
import json

output = {
"success": True,
"commands": commands,
"packages": packages,
"install_id": install_id,
}
print(json.dumps(output, indent=2))
return 0

self._print_status("⚙️", f"Installing {software}...")
print("\nGenerated commands:")
for i, cmd in enumerate(commands, 1):
Expand Down Expand Up @@ -1037,17 +1051,32 @@ def parallel_log_callback(message: str, level: str = "info"):
except ValueError as e:
if install_id:
history.update_installation(install_id, InstallationStatus.FAILED, str(e))
self._print_error(str(e))
if json_output:
import json

print(json.dumps({"success": False, "error": str(e), "error_type": "ValueError"}))
else:
self._print_error(str(e))
return 1
except RuntimeError as e:
if install_id:
history.update_installation(install_id, InstallationStatus.FAILED, str(e))
self._print_error(f"API call failed: {str(e)}")
if json_output:
import json

print(json.dumps({"success": False, "error": str(e), "error_type": "RuntimeError"}))
else:
self._print_error(f"API call failed: {str(e)}")
return 1
except OSError as e:
if install_id:
history.update_installation(install_id, InstallationStatus.FAILED, str(e))
self._print_error(f"System error: {str(e)}")
if json_output:
import json

print(json.dumps({"success": False, "error": str(e), "error_type": "OSError"}))
else:
self._print_error(f"System error: {str(e)}")
return 1
except Exception as e:
if install_id:
Expand Down Expand Up @@ -2827,6 +2856,25 @@ def progress_callback(current: int, total: int, step: InstallationStep) -> None:

# --------------------------

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

app = DashboardApp()
rc = app.run()
return rc
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 a beautifully formatted help table using the Rich library.
Expand Down Expand Up @@ -2965,6 +3013,11 @@ def main():
# Demo command
demo_parser = subparsers.add_parser("demo", help="See Cortex in action")

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

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

Expand Down Expand Up @@ -3566,6 +3619,8 @@ def main():

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