MCPcopy Create free account
hub / github.com/diillson/chatcli / getPluginNameSuggestions

Method getPluginNameSuggestions

cli/cli_completer.go:964–979  ·  view source on GitHub ↗
(prefix string)

Source from the content-addressed store, hash-verified

962}
963
964func (cli *ChatCLI) getPluginNameSuggestions(prefix string) []prompt.Suggest {
965 if cli.pluginManager == nil {
966 return nil
967 }
968 plugins := cli.pluginManager.GetPlugins()
969 suggestions := make([]prompt.Suggest, 0, len(plugins))
970 for _, p := range plugins {
971 // Remove o '@' para a sugestão, pois é mais fácil de digitar
972 nameWithoutAt := strings.TrimPrefix(p.Name(), "@")
973 suggestions = append(suggestions, prompt.Suggest{
974 Text: nameWithoutAt,
975 Description: p.Description(),
976 })
977 }
978 return prompt.FilterHasPrefix(suggestions, prefix, true)
979}
980
981func (cli *ChatCLI) getAgentSuggestions(d prompt.Document) []prompt.Suggest {
982 line := d.TextBeforeCursor()

Callers 1

getPluginSuggestionsMethod · 0.95

Calls 3

NameMethod · 0.65
DescriptionMethod · 0.65
GetPluginsMethod · 0.45

Tested by

no test coverage detected