Conversation
Displays overall system status and per-group/component breakdown from the API's /status endpoint, with color-coded output matching the dashboard indicator.
Added error handling to the `runStatus` function to log an error message and return an error when the response status code from the Kernel API is not in the 2xx range. This improves user feedback when the API is unreachable.
…o phani/kernel-status-cli
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return strings.TrimRight(u, "/") | ||
| } | ||
| return defaultBaseURL | ||
| } |
There was a problem hiding this comment.
Duplicated base URL resolution logic across files
Low Severity
The getBaseURL() function and defaultBaseURL constant duplicate the base URL resolution logic already present inline in cmd/deploy.go (lines 150–153), which also reads KERNEL_BASE_URL and falls back to "https://api.onkernel.com". The two implementations also differ subtly — getBaseURL trims trailing slashes while deploy.go does not — creating a risk of inconsistent behavior and requiring updates in multiple places if the default URL changes.
Additional Locations (1)
| if err != nil { | ||
| pterm.Error.Println("Could not reach Kernel API. Check https://status.kernel.sh for updates.") | ||
| return fmt.Errorf("request failed: %w", err) | ||
| } |
There was a problem hiding this comment.
Double error output from printing then returning error
Medium Severity
runStatus calls pterm.Error.Println to display a friendly error, then returns a fmt.Errorf wrapping the same failure. The returned error triggers fang's WithErrorHandler in root.go, which also calls pterm.Error.Println, producing duplicate error output for the user. The rest of the codebase (e.g. cmd/browser_pools.go) follows the pattern of printing via pterm and returning nil to avoid this double-printing.
Additional Locations (1)
masnwilliams
left a comment
There was a problem hiding this comment.
cmd/status.go line 43 — nit: getBaseURL() + defaultBaseURL is duplicated from cmd/deploy.go — consider extracting to a shared helper so they stay in sync. also note that KERNEL_BASE_URL isn't actually set anywhere (no .env), so this always hits api.onkernel.com — worth a comment clarifying it's for internal dev/staging only.
cmd/status.go line 57 — nit: double error output — pterm.Error.Println prints a user-facing message, then the returned error gets printed by cobra too. pick one or the other (same on line 63).


Displays overall system status and per-group/component breakdown from the API's /status endpoint, with color-coded output matching the dashboard indicator.
Note
Low Risk
Primarily adds a new read-only CLI command and a small auth-exemption tweak; risk is limited to potential user-facing errors from the new HTTP call and output formatting.
Overview
Adds a new
kernel statuscommand that calls the Kernel API/statusendpoint (with a 10s timeout) and renders overall plus per-group/component health in a color-coded terminal view, with optional--output jsonfor machine-readable output.Wires the command into
rootCmdand exemptsstatusfrom the CLI auth requirement so it can be run without credentials; the API base URL can be overridden viaKERNEL_BASE_URL.Written by Cursor Bugbot for commit 44667b0. This will update automatically on new commits. Configure here.