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 catalog as the compact, grouped block an agent prompt carries. Descriptions are the localized `panda help` one-liners, with the help page's terminal hard wraps flattened back into one line, and every usage aligned to a single column so the block scans as a table.
Sections render in groupOrder rather than in catalog order: the heading is therefore emitted exactly once per group even if a future edit files a command out of order, and a group added without a row in groupOrder fails the catalog test instead of disappearing from the reference.
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.