<#1140 Console: help on open, Tab completion, comm...
# osctrl
g
#1140 Console: help on open, Tab completion, command history Pull request opened by javuto Console: help on open, Tab completion, command history Problem The node console gave no hints about which commands exist. Operators had to type
help
first, every command had to be typed out in full, and there was no way to call back an earlier command. Changes • Help after warm-up:
POST /api/v1/console/{env}/nodes/{uuid}/sessions
now returns a
help
field (
console.HelpText()
, which used to be the private
helpText()
). The console prints it once warm-up finishes. If no warm-up command was sent, or it failed or expired, the help shows right away. • Tab completion: completes the first word using commands parsed from that same help text, so the Go parser stays the only list of valid commands. One match fills in the command and a space. Several matches fill in the part they share, and pressing Tab again lists them all. In osquery mode, only dot-commands (
.tables
,
.exit
) are offered. Tab on an empty line still moves focus, so keyboard users are not trapped in the input. • History: ↑/↓ step through earlier commands, starting with the session history loaded from the server. • Input hint: the input now shows a placeholder hint, added to all 20 locales. Security / operational impact None expected.
help
is a static string added to an existing authenticated response. Completion and history run only in the browser and make no extra API calls, so no new audit entries or commands are created. Validation •
go test ./pkg/console ./cmd/api/handlers
(new assertion on
<http://resp.Help|resp.Help>
) • `cd frontend && npm test`: 682 passed, including new console tests for help after warm-up, Tab completion, history, and table-driven tests for the completion helpers •
cd frontend && npm run check
Notes • Non-English hint strings are machine-written; a native-speaker review is welcome. • Completion covers command names only, not file paths. jmpsec/osctrl