MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / writeProviderTable

Function writeProviderTable

internal/cli/provider_cmd.go:102–125  ·  view source on GitHub ↗
(out io.Writer, file providers.File, names []string)

Source from the content-addressed store, hash-verified

100}
101
102func writeProviderTable(out io.Writer, file providers.File, names []string) {
103 nameWidth := len("NAME")
104 endpointWidth := len("ENDPOINT")
105 clientsWidth := len("CLIENTS")
106 for _, n := range names {
107 if len(n) > nameWidth {
108 nameWidth = len(n)
109 }
110 ep := file.Endpoints[n]
111 if len(ep.Endpoint) > endpointWidth {
112 endpointWidth = len(ep.Endpoint)
113 }
114 clients := joinComma(ep.Clients())
115 if len(clients) > clientsWidth {
116 clientsWidth = len(clients)
117 }
118 }
119 row := fmt.Sprintf("%%-%ds %%-%ds %%-%ds %%s\n", nameWidth, endpointWidth, clientsWidth)
120 fmt.Fprintf(out, row, "NAME", "ENDPOINT", "CLIENTS", "ENABLED")
121 for _, n := range names {
122 ep := file.Endpoints[n]
123 fmt.Fprintf(out, row, n, ep.Endpoint, joinComma(ep.Clients()), enabledString(ep))
124 }
125}
126
127func enabledString(ep providers.Endpoint) string {
128 if ep.IsEnabled() {

Callers 1

providerListCommandMethod · 0.85

Calls 3

joinCommaFunction · 0.85
enabledStringFunction · 0.85
ClientsMethod · 0.80

Tested by

no test coverage detected