Skip to content
Merged
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
22 changes: 21 additions & 1 deletion cortex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2998,7 +2998,6 @@ def main():
)
# --------------------------

<<<<<<< HEAD
# License and upgrade commands
subparsers.add_parser("upgrade", help="Upgrade to Cortex Pro")
subparsers.add_parser("license", help="Show license status")
Expand Down Expand Up @@ -3104,6 +3103,21 @@ def main():
help="Enable verbose output",
)

# System Health Score
health_parser = subparsers.add_parser("health", help="System health score and recommendations")
health_parser.add_argument(
"action",
nargs="?",
default="check",
choices=["check", "history", "factors", "quick"],
help="Action to perform (default: check)",
)
health_parser.add_argument(
"-v", "--verbose",
action="store_true",
help="Enable verbose output",
)
Comment on lines +3115 to +3119
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The health sub-command defines its own --verbose / -v flag, but a global one already exists for the main cortex command. This is redundant and could be confusing. The existing logic correctly uses the global verbose flag, so this local definition can be removed to avoid duplication and potential conflicts.


args = parser.parse_args()

# The Guard: Check for empty commands before starting the CLI
Expand Down Expand Up @@ -3211,6 +3225,12 @@ def main():
packages=getattr(args, "packages", None),
verbose=getattr(args, "verbose", False),
)
elif args.command == "health":
from cortex.health_score import run_health_check
return run_health_check(
action=getattr(args, "action", "check"),
verbose=getattr(args, "verbose", False),
)
else:
parser.print_help()
return 1
Expand Down
Loading
Loading