CLI `console` subcommand broken since hub #464 — re-point from /scripts/logs WebSocket to ScriptLogsDashboard Connect-RPC
Author: corestCreated Jun 16, 2026Updated Jul 10, 2026
Summary
kubeshark console has been non-functional since hub #464 (merged 2025-12-19). A transitional "under refactoring" note has been added to the command (help text + runtime warning) on the cli-console-refactoring-note branch; this issue tracks the actual client migration.
What broke
- Hub #464 moved scripting-console log streaming off the
/scripts/logsWebSocket and onto a Connect-RPC streaming service:script_logs.ScriptLogsDashboard/StreamLogs(registered inhub/server/server.go, schema in api2script_logs). The oldGET /scripts/logsroute and itsScriptLogsHandlerwere deleted. - The CLI
consolecommand still dials a raw WebSocket atws://<host>:<frontPort>/api/scripts/logs(cmd/console.go,gorilla/websocket). That route no longer exists, so the dial fails and the command spins in its 5s reconnect loop, never streaming logs.
Fix
Re-point cmd/console.go from the WebSocket dial to the Connect-RPC stream:
- Replace the
gorilla/websocketdial to/api/scripts/logswith a Connect-RPC client forScriptLogsDashboard.StreamLogs(api2script_logsconnect), reading the streamed log records and printing them (preserving the:ERROR]→ stderr/red behavior). - Reuse the existing auth: the command already mints the
kubeshark-cliSA token (MintHubToken) and falls back toLicense-Key— attach it on the Connect request the same way (X-Kubeshark-Authorization/License-Key). - Remove the transitional "under refactoring" note (Short/Long + runtime warning) added on
cli-console-refactoring-noteonce the stream works. - Verify against a gated hub (auth enabled) and an auth-disabled hub.
Context
The same SA-token auth pattern is already wired into cmd/mcpRunner.go and cmd/console.go (token minting), so this is primarily a transport swap (WebSocket → Connect-RPC streaming).
Source: kubeshark/kubeshark