MCPcopy
hub / github.com/coder/mux / executeSSH

Function executeSSH

tests/ipc/workspace/remove.test.ts:124–134  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

122}
123
124async function executeSSH(command: string): Promise<string> {
125 if (!sshConfig) {
126 throw new Error("SSH config not ready");
127 }
128
129 using proc = execAsync(
130 `ssh -i "${sshConfig.privateKeyPath}" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -o ConnectTimeout=2 -p ${sshConfig.port} testuser@localhost '${command}'`
131 );
132 const { stdout } = await proc.result;
133 return stdout.trim();
134}
135
136async function clearMarkerFile(runtimeType: "local" | "ssh", markerPath: string): Promise<void> {
137 if (runtimeType === "ssh") {

Callers 2

clearMarkerFileFunction · 0.85
markerFileExistsFunction · 0.85

Calls 1

execAsyncFunction · 0.90

Tested by

no test coverage detected