Add transport-only SSH connectivity for the CLI and Electron desktop through the user's OpenSSH configuration. Remote installation and daemon lifecycle remain explicit, separate operations. Preserve actionable SSH failure details when the proxy socket closes before the SSH child exits. Closes #3949 Co-authored-by: James Strain <jstrain@nvidia.com> Co-authored-by: Reid Levesque <reidlevesque@users.noreply.github.com>
24 lines
815 B
TypeScript
24 lines
815 B
TypeScript
import type { Command } from "commander";
|
|
|
|
const JSON_OPTION_DESCRIPTION = "Output in JSON format";
|
|
const DAEMON_HOST_OPTION_DESCRIPTION =
|
|
"Daemon host target: host:port, tcp://host:port, or ssh://user@host (default: local socket/pipe, then localhost:6767)";
|
|
|
|
export function collectMultiple(value: string, previous: string[]): string[] {
|
|
return previous.concat([value]);
|
|
}
|
|
|
|
export function addJsonOption<T extends Command>(command: T): T {
|
|
command.option("--json", JSON_OPTION_DESCRIPTION);
|
|
return command;
|
|
}
|
|
|
|
export function addDaemonHostOption<T extends Command>(command: T): T {
|
|
command.option("--host <host>", DAEMON_HOST_OPTION_DESCRIPTION);
|
|
return command;
|
|
}
|
|
|
|
export function addJsonAndDaemonHostOptions<T extends Command>(command: T): T {
|
|
return addDaemonHostOption(addJsonOption(command));
|
|
}
|