MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Execute

Method Execute

internal/tool/bash.go:30–43  ·  view source on GitHub ↗
(ctx context.Context, rawInput string)

Source from the content-addressed store, hash-verified

28}
29
30func (BashTool) Execute(ctx context.Context, rawInput string) (string, bool) {
31 var in struct {
32 Command string `json:"command"`
33 }
34 if err := json.Unmarshal([]byte(rawInput), &in); err != nil {
35 return fmt.Sprintf("invalid tool input: %v", err), true
36 }
37 cmd := exec.CommandContext(ctx, "sh", "-c", in.Command)
38 out, err := cmd.CombinedOutput()
39 if err != nil {
40 return fmt.Sprintf("%s\n[exit error: %v]", out, err), true
41 }
42 return string(out), false
43}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected