feat: add remote main server cli passthrough
This commit is contained in:
+9
-1
@@ -6,8 +6,10 @@ import { emitError, emitJson } from "./src/output";
|
||||
import { jobWithTail, listJobs, readJob, runJob } from "./src/jobs";
|
||||
import { runChecks } from "./src/check";
|
||||
import { runSsh } from "./src/ssh";
|
||||
import { extractRemoteCliOptions, runRemoteCli } from "./src/remote";
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const remoteOptions = extractRemoteCliOptions(process.argv.slice(2));
|
||||
const args = remoteOptions.args;
|
||||
const commandName = args.join(" ") || "help";
|
||||
|
||||
function help(): unknown {
|
||||
@@ -16,6 +18,7 @@ function help(): unknown {
|
||||
output: "json",
|
||||
commands: [
|
||||
{ command: "help", description: "List supported commands." },
|
||||
{ command: "--main-server-ip <ip> [--main-server-user root] [--main-server-key path] <command>", description: "Pass the command through SSH and execute this CLI on the main server." },
|
||||
{ command: "config show", description: "Validate and print config.json as the single source of truth." },
|
||||
{ command: "check", description: "Run config, TypeScript, file presence, and docker-compose config checks." },
|
||||
{ command: "server start", description: "Fire-and-forget build/start for database, backend-core, frontend, and provider gateway." },
|
||||
@@ -84,6 +87,11 @@ function latestJobId(): string {
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
if (remoteOptions.host !== null) {
|
||||
process.exitCode = await runRemoteCli(remoteOptions);
|
||||
return;
|
||||
}
|
||||
|
||||
const [top, sub, third, fourth] = args;
|
||||
if (top === undefined || top === "help" || top === "--help" || top === "-h") {
|
||||
emitJson(commandName, help());
|
||||
|
||||
Reference in New Issue
Block a user