CLI: route gateway status through daemon status

This commit is contained in:
Vincent Koc
2026-03-15 21:11:39 -07:00
parent 7e8f5ca71b
commit cb4a298961
2 changed files with 64 additions and 28 deletions

View File

@@ -81,26 +81,36 @@ const routeGatewayStatus: RouteSpec = {
if (ssh === null) {
return false;
}
if (ssh !== undefined) {
return false;
}
const sshIdentity = getFlagValue(argv, "--ssh-identity");
if (sshIdentity === null) {
return false;
}
const sshAuto = hasFlag(argv, "--ssh-auto");
if (sshIdentity !== undefined) {
return false;
}
if (hasFlag(argv, "--ssh-auto")) {
return false;
}
const deep = hasFlag(argv, "--deep");
const json = hasFlag(argv, "--json");
const { gatewayStatusCommand } = await import("../../commands/gateway-status.js");
await gatewayStatusCommand(
{
const requireRpc = hasFlag(argv, "--require-rpc");
const probe = !hasFlag(argv, "--no-probe");
const { runDaemonStatus } = await import("../daemon-cli/status.js");
await runDaemonStatus({
rpc: {
url: url ?? undefined,
token: token ?? undefined,
password: password ?? undefined,
timeout: timeout ?? undefined,
json,
ssh: ssh ?? undefined,
sshIdentity: sshIdentity ?? undefined,
sshAuto,
},
defaultRuntime,
);
probe,
requireRpc,
deep,
json,
});
return true;
},
};