Add kernelwatch status [--json] #20

Merged
patrick merged 1 commits from feat/status-cli into main 2026-10-30 15:46:32 +00:00
Owner

Summary

A way to ask "which hosts need a reboot?" without opening the dashboard, with no
new network surface.

kernelwatch status prints the fleet as the dashboard does (worst first, then by
name), from the same evaluate() call with the host name passed, so the two
can't disagree (Livepatch cover, hostname note, etc.).

  • --json: generated_at, whole-fleet counts, and a per-host object with a
    stable set of keys (null for anything a host hasn't reported). No tokens or
    hashes.
  • --host NAME, --level stale|reboot|update|ok (repeatable) trim the host
    list; counts always cover the whole fleet.
  • Unknown host exits 1; bad arguments are rejected by argparse.
  • README: "Scripting" section with jq examples (including a jq -e check
    usable from cron or a monitor) and why there's no HTTP endpoint yet.

Testing

make test: 215 tests pass (13 new): ordering and counts, status/reasons equal to
evaluate() per host, field values, never-reported hosts have nulls not missing
keys, Livepatch and hostname-note passthrough, no secrets in output, filters
(and counts unaffected), argument errors, empty fleet, text output. Mutations
(host not passed, wrong sort, ignored --level, unknown host accepted, wrong
age) were each caught. jq examples run against real output.

🤖 Generated with Claude Code

## Summary A way to ask "which hosts need a reboot?" without opening the dashboard, with no new network surface. `kernelwatch status` prints the fleet as the dashboard does (worst first, then by name), from the same `evaluate()` call with the host name passed, so the two can't disagree (Livepatch cover, hostname note, etc.). - `--json`: `generated_at`, whole-fleet `counts`, and a per-host object with a stable set of keys (`null` for anything a host hasn't reported). No tokens or hashes. - `--host NAME`, `--level stale|reboot|update|ok` (repeatable) trim the host list; counts always cover the whole fleet. - Unknown host exits 1; bad arguments are rejected by argparse. - README: "Scripting" section with `jq` examples (including a `jq -e` check usable from cron or a monitor) and why there's no HTTP endpoint yet. ## Testing `make test`: 215 tests pass (13 new): ordering and counts, status/reasons equal to `evaluate()` per host, field values, never-reported hosts have nulls not missing keys, Livepatch and hostname-note passthrough, no secrets in output, filters (and counts unaffected), argument errors, empty fleet, text output. Mutations (host not passed, wrong sort, ignored `--level`, unknown host accepted, wrong age) were each caught. `jq` examples run against real output. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrick added 1 commit 2026-10-30 15:44:27 +00:00
Add kernelwatch status [--json]
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 24s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 4s
63b9151b09
Prints the fleet like the dashboard, worst hosts first, from the same
evaluate() call, so the CLI and the dashboard cannot disagree. --json gives
generated_at, whole-fleet counts and a stable per-host object with no secrets;
--host and --level (repeatable) trim the host list. No network surface.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
patrick merged commit e7a9a49438 into main 2026-10-30 15:46:32 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: patrick/kernel-automation#20