diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index a24f1a4..9c35031 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -2288,6 +2288,45 @@ else fi" || printf 'unable to reach %s@%s\n' "${rpi_user}" "${rpi_host}" } +status_usage() { + cat <<'EOF' +Usage: ./jeannie status [all|oci|rpi|opi5|debian|cluster] [options] + +Without arguments, show a fast overview of all areas. A scope limits the +overview to that area; cluster uses the selected cluster profile. + + all All areas, including Compose and Argo CD applications + oci OCI edge connectivity and Compose services + rpi Raspberry Pi services and Compose containers + opi5 Orange Pi host, Compose containers, and selected K3s runtime + debian Debian services and Compose containers + cluster Selected Kubernetes cluster and Argo CD applications + +Scoped overview options: + --details Include detail fields. + --json Output structured JSON. + --all Include all results (the scoped overview default). + --no-local-rca Disable AI explanations (already disabled for scopes). + +Unscoped diagnostic options retain the existing status report: + --fast Run the existing fast diagnostic checks. + --deep Run the deeper diagnostic checks. + --json Output the existing machine-readable diagnostic report. + --details Include detail fields. + --all Include passing and skipped checks. + --ai Request an unverified AI explanation. + --no-local-rca Disable AI explanations. + --verbose Show the older full diagnostic output. + --heal-plan Show the proposed healing plan using deep checks. + --heal Run the existing healing workflow using deep checks. + +Examples: + ./jeannie status oci --details + ./jeannie remote status cluster --json + ./jeannie status --deep --no-local-rca +EOF +} + status_report() { local cascade_status=0 local heal_mode="" @@ -2296,6 +2335,13 @@ status_report() { local status_json local -a status_args=() + case "${1:-}" in + -h|--help) status_usage; return 0 ;; + all|oci|rpi|opi5|debian|cluster) + case "${2:-}" in -h|--help) status_usage; return 0 ;; esac + ;; + esac + require_debian_server "status" if (($# == 0)); then diff --git a/tests/jeannie/test_status_focus.py b/tests/jeannie/test_status_focus.py index b3b1388..482500d 100644 --- a/tests/jeannie/test_status_focus.py +++ b/tests/jeannie/test_status_focus.py @@ -45,6 +45,19 @@ status_focus_collect "$2" class FocusedStatusTests(unittest.TestCase): + def test_help_describes_scopes_and_exits_successfully(self): + commands = ROOT / "lib" / "jeannie" / "commands.sh" + for args in (("--help",), ("-h",), ("oci", "--help")): + with self.subTest(args=args): + result = subprocess.run( + ["bash", "-c", 'source "$1"; shift; status_report "$@"', + "test", str(commands), *args], + capture_output=True, text=True, check=True, + ) + self.assertIn("all|oci|rpi|opi5|debian|cluster", result.stdout) + self.assertIn("--deep", result.stdout) + self.assertIn("--heal-plan", result.stdout) + def test_scopes_do_not_collect_other_hosts(self): for scope, groups in (("debian", {"Debian", "Debian Compose"}), ("rpi", {"RPi4", "RPi4 Compose"}),