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

Method showWebSearchStatus

cli/websearch_command.go:52–84  ·  view source on GitHub ↗

showWebSearchStatus prints the current override, SearxNG config, and the active fallback chain that a query would actually use right now.

()

Source from the content-addressed store, hash-verified

50// showWebSearchStatus prints the current override, SearxNG config, and the
51// active fallback chain that a query would actually use right now.
52func (cli *ChatCLI) showWebSearchStatus() {
53 fmt.Println()
54 fmt.Println(uiBox("🔎", i18n.T("ws.cmd.box_title"), ColorCyan))
55 p := uiPrefix(ColorCyan)
56
57 override := os.Getenv("CHATCLI_WEBSEARCH_PROVIDER")
58 if override == "" {
59 override = "auto"
60 }
61 searxngURL := os.Getenv("SEARXNG_URL")
62
63 fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s",
64 ColorGray, i18n.T("ws.cmd.kv_override")+":", ColorReset, override))
65 if searxngURL != "" {
66 fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s",
67 ColorGray, i18n.T("ws.cmd.kv_searxng_url")+":", ColorReset, searxngURL))
68 } else {
69 fmt.Println(p + fmt.Sprintf(" %s%-16s%s %s",
70 ColorGray, i18n.T("ws.cmd.kv_searxng_url")+":", ColorReset,
71 i18n.T("ws.cmd.searxng_not_configured")))
72 }
73
74 fmt.Println(p + "")
75 fmt.Println(p + fmt.Sprintf(" %s%s%s", ColorGray, i18n.T("ws.cmd.active_chain_header"), ColorReset))
76 for i, name := range plugins.SelectSearchChainNames() {
77 marker := "↓"
78 if i == 0 {
79 marker = "★"
80 }
81 fmt.Println(p + fmt.Sprintf(" %s %d. %s", marker, i+1, name))
82 }
83 fmt.Println()
84}
85
86// showWebSearchList enumerates all known providers with configured-or-not state.
87func (cli *ChatCLI) showWebSearchList() {

Callers 2

setWebSearchProviderMethod · 0.95

Calls 4

TFunction · 0.92
SelectSearchChainNamesFunction · 0.92
uiBoxFunction · 0.85
uiPrefixFunction · 0.85

Tested by

no test coverage detected