Skip to content

feat(cli): add kernel status command#123

Open
jarugupj wants to merge 4 commits intomainfrom
phani/kernel-status-cli
Open

feat(cli): add kernel status command#123
jarugupj wants to merge 4 commits intomainfrom
phani/kernel-status-cli

Conversation

@jarugupj
Copy link
Contributor

@jarugupj jarugupj commented Feb 25, 2026

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 status command that calls the Kernel API /status endpoint (with a 10s timeout) and renders overall plus per-group/component health in a color-coded terminal view, with optional --output json for machine-readable output.

Wires the command into rootCmd and exempts status from the CLI auth requirement so it can be run without credentials; the API base URL can be overridden via KERNEL_BASE_URL.

Written by Cursor Bugbot for commit 44667b0. This will update automatically on new commits. Configure here.

jarugupj and others added 2 commits February 25, 2026 16:30
Displays overall system status and per-group/component breakdown
from the API's /status endpoint, with color-coded output matching
the dashboard indicator.
@jarugupj jarugupj marked this pull request as ready for review February 25, 2026 21:53
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.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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
}
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

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)
}
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

Copy link
Contributor

@masnwilliams masnwilliams left a comment

Choose a reason for hiding this comment

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

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants