MCPcopy Index your code
hub / github.com/cli/cli / NewRemoteCommand

Function NewRemoteCommand

internal/codespaces/ssh.go:53–61  ·  view source on GitHub ↗

NewRemoteCommand returns an exec.Cmd that will securely run a shell command on the remote machine.

(ctx context.Context, tunnelPort int, destination string, sshArgs ...string)

Source from the content-addressed store, hash-verified

51// NewRemoteCommand returns an exec.Cmd that will securely run a shell
52// command on the remote machine.
53func NewRemoteCommand(ctx context.Context, tunnelPort int, destination string, sshArgs ...string) (*exec.Cmd, error) {
54 sshArgs, command, err := ParseSSHArgs(sshArgs)
55 if err != nil {
56 return nil, err
57 }
58
59 cmd, _, err := newSSHCommand(ctx, tunnelPort, destination, sshArgs, command)
60 return cmd, err
61}
62
63// newSSHCommand populates an exec.Cmd to run a command (or if blank,
64// an interactive shell) over ssh.

Callers 2

LogsMethod · 0.92
getPostCreateOutputFunction · 0.85

Calls 2

ParseSSHArgsFunction · 0.85
newSSHCommandFunction · 0.85

Tested by

no test coverage detected