Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandNode ¶
type CommandNode struct {
Name string
FullPath string // e.g., "create-user" or "tag1 auth"
Description string
LongDesc string
Example string
Flags []FlagInfo
Children []CommandNode
IsGroup bool
}
CommandNode represents a single item in the explorer tree. It is either a group (has children) or a leaf command.
func BuildTree ¶
func BuildTree(root *cobra.Command) CommandNode
BuildTree walks a cobra.Command tree and produces a CommandNode tree, filtering out utility commands.
type SearchResult ¶
type SearchResult struct {
Node CommandNode
Breadcrumb string // e.g., "pets > create"
Score int // match quality (higher = better)
}
SearchResult represents a match from a recursive tree search.
func SearchTree ¶
func SearchTree(node CommandNode, query string) []SearchResult
SearchTree recursively searches the command tree for nodes matching the query. It returns all matching leaf commands and groups, sorted by match quality, with breadcrumb paths showing where each result lives in the tree hierarchy.
Click to show internal directories.
Click to hide internal directories.