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

Function execBuiltin

cli/rpc_support.go:215–222  ·  view source on GitHub ↗

execBuiltin runs a plugin, capturing any streamed output into the result.

(ctx context.Context, p plugins.Plugin, argv []string)

Source from the content-addressed store, hash-verified

213
214// execBuiltin runs a plugin, capturing any streamed output into the result.
215func execBuiltin(ctx context.Context, p plugins.Plugin, argv []string) (string, error) {
216 var sb strings.Builder
217 out, err := p.ExecuteWithStream(ctx, argv, func(s string) { sb.WriteString(s) })
218 if out == "" {
219 out = sb.String()
220 }
221 return out, err
222}

Callers 1

RunBuiltinToolMethod · 0.85

Calls 2

ExecuteWithStreamMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected