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

Method Run

internal/tools/installer.go:35–51  ·  view source on GitHub ↗

Run executes name with args. If name is empty, it falls back to shell mode using the first arg as the full command.

(name string, args []string, stdout, stderr io.Writer)

Source from the content-addressed store, hash-verified

33// Run executes name with args. If name is empty, it falls back to shell mode
34// using the first arg as the full command.
35func (ShellRunner) Run(name string, args []string, stdout, stderr io.Writer) (int, error) {
36 if name == "" {
37 return 1, errors.New("tools: empty command")
38 }
39 cmd := exec.Command(name, args...)
40 cmd.Stdin = os.Stdin
41 cmd.Stdout = stdout
42 cmd.Stderr = stderr
43 if err := cmd.Run(); err != nil {
44 var exitErr *exec.ExitError
45 if errors.As(err, &exitErr) {
46 return exitErr.ExitCode(), nil
47 }
48 return 1, err
49 }
50 return 0, nil
51}
52
53// Install runs the install_cmd for the given tool, streaming output through w.
54// Empty install_cmd returns nil with a "no install command" sentinel.

Callers

nothing calls this directly

Calls 1

RunMethod · 0.65

Tested by

no test coverage detected