Documentation
¶
Overview ¶
Package nodecli is the registry of the `panda` command surface, one description per consumer:
- Catalog is the agent-facing reference injected into task prompts — every subcommand, its primary usage and a one-line purpose;
- helpPage is the human `panda help` page, with its own curated order and layout rows;
- completionVerbs is the second-level vocabulary shell completion offers.
They live together because they describe one CLI. When the page and the completion tables were hand-maintained in cmd/panda (alongside a third list for typo suggestions), adding a command meant editing three places and forgetting one failed silently; now a subcommand is named once, and tests keep the surfaces consistent with the dispatcher and with each other.
The one-line descriptions reuse the `cli.help.d.*` strings, so every surface is localized in all five project languages and cannot drift from what the others say.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompletionVerbs ¶
CompletionVerbs returns the completion vocabulary. The map is a copy: a caller may drop entries without changing what the next caller sees.
func GroupHeadingKey ¶
GroupHeadingKey names the i18n key for a section's title.
func Names ¶
func Names() []string
Names lists every accepted top-level subcommand spelling, sorted. It is the vocabulary cmd/panda hands to typo suggestions and shell completion (subcommandNames), so a new command is named once and every consumer sees it.
func PromptReference ¶
PromptReference renders the full localized catalog in group order, with terminal wraps flattened and command usages aligned for readability.
func PromptReferenceFor ¶ added in v0.1.5
PromptReferenceFor keeps the full catalog discoverable through help, while sending only the command groups relevant to this task. No command is hidden from the CLI or from authorization; this only reduces repeated prompt text.
Types ¶
type Command ¶
type Command struct {
// Names lists every accepted spelling; Names[0] is canonical. Multi-word
// names ("nodes add") are verb forms of a top-level command.
Names []string
// Usage is the command's primary invocation, flags included only where
// they change what an agent would do. `panda help` carries the rest.
Usage string
// HelpKey names the i18n string summarizing the command.
HelpKey string
Group Group
}
Command is one line of the reference.
type Group ¶
type Group string
Group places a command on the reference page. The order here is the rendering order, and mirrors `panda help`'s sections so the two references read the same.
type HelpRow ¶
HelpRow is one line of `panda help`. Cmd is the text in the command column, without the page's two-space indent (the renderer adds it); an empty Cmd continues the previous entry's column, which is how the page breaks a long spelling over two lines. An empty HelpKey prints the command line alone, with its description on the following row.
type HelpSection ¶
type HelpSection struct {
Group Group
// Col is the description column: the page uses a narrow column for the
// runtime block and a wide one wherever command spellings run long.
Col int
Rows []HelpRow
}
HelpSection is one titled block of the page.