MCPcopy Create free account
hub / github.com/docker/docker-agent / DisplayText

Method DisplayText

pkg/config/types/commands.go:64–78  ·  view source on GitHub ↗

DisplayText returns the text to show in completion dialogs. It returns Description when available, otherwise the Instruction. For agent-only commands (no instruction or description), it falls back to a short "switch to " hint so the completion dialog still has something meaningful to show.

()

Source from the content-addressed store, hash-verified

62// short "switch to <agent>" hint so the completion dialog still has
63// something meaningful to show.
64func (c Command) DisplayText() string {
65 if c.Description != "" {
66 return c.Description
67 }
68 if c.Instruction != "" {
69 return c.Instruction
70 }
71 if c.URL != "" {
72 return "Open " + c.URL
73 }
74 if c.Agent != "" {
75 return "Switch to " + c.Agent
76 }
77 return ""
78}
79
80// Commands represents a set of named prompts for quick-starting conversations.
81// It supports multiple YAML formats:

Callers 7

processMessageMethod · 0.80
BuildCommandCategoriesFunction · 0.80
commandLinesMethod · 0.80
refreshCommandsMethod · 0.80
completeMessageFunction · 0.80

Calls

no outgoing calls

Tested by 2