nodecli

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func CompletionVerbs() map[string][]string

CompletionVerbs returns the completion vocabulary. The map is a copy: a caller may drop entries without changing what the next caller sees.

func GroupHeadingKey

func GroupHeadingKey(g Group) string

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

func PromptReference(loc i18n.Locale) string

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

func PromptReferenceFor(loc i18n.Locale, query string) string

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.

func Catalog

func Catalog() []Command

Catalog returns every command in display order. The rows and their Names slices are copies: a caller may sort or rewrite the result without disturbing the registry every other caller reads.

func Resolve

func Resolve(name string) (Command, bool)

Resolve finds the command a name names — a top-level subcommand or a verb form ("nodes add"). The empty string resolves to the bare `panda` entry.

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.

const (
	GroupRuntime       Group = "runtime"
	GroupSessions      Group = "sessions"
	GroupTasks         Group = "tasks"
	GroupMemory        Group = "memory"
	GroupSettings      Group = "settings"
	GroupObservability Group = "observability"
	GroupSetup         Group = "setup"
)

type HelpRow

type HelpRow struct {
	Cmd     string
	HelpKey string
}

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.

func HelpPage

func HelpPage() []HelpSection

HelpPage returns the page's sections in print order.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL