Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
116111c
refactor(cli): harden oclif bridge
cv Apr 30, 2026
5e997cb
test(cli): relax uninstall helper timeouts
cv Apr 30, 2026
88cd958
refactor(cli): migrate status and tunnel commands to oclif
cv Apr 30, 2026
3f748d6
refactor(cli): migrate debug uninstall and gateway-token to oclif
cv Apr 30, 2026
0bc877a
refactor(cli): migrate credentials commands to oclif
cv Apr 30, 2026
3fd15fc
refactor(cli): migrate sandbox inspection commands to oclif
cv Apr 30, 2026
81c62bb
refactor(cli): migrate maintenance commands to oclif
cv Apr 30, 2026
7d6a6fb
refactor(cli): migrate sandbox logs command to oclif
cv May 1, 2026
3f17a4f
refactor(cli): migrate skill install command to oclif
cv May 1, 2026
0fb3c41
refactor(cli): migrate snapshot list and create to oclif
cv May 1, 2026
d11eeee
refactor(cli): migrate shields commands to oclif
cv May 1, 2026
74806ce
refactor(cli): migrate channels mutation commands to oclif
cv May 1, 2026
e637e84
refactor(cli): migrate policy mutation commands to oclif
cv May 1, 2026
ee20dfb
refactor(cli): migrate snapshot restore command to oclif
cv May 1, 2026
8d3a568
refactor(cli): migrate destroy command to oclif
cv May 1, 2026
b447f36
refactor(cli): migrate rebuild command to oclif
cv May 1, 2026
02431db
refactor(cli): migrate connect command to oclif
cv May 1, 2026
37ce2ff
refactor(cli): migrate deploy command to oclif
cv May 1, 2026
d3e218e
refactor(cli): migrate onboard aliases to oclif
cv May 1, 2026
df05a3e
refactor(cli): migrate help and version commands to oclif
cv May 1, 2026
3edcf2e
refactor(cli): centralize legacy oclif dispatch
cv May 1, 2026
47df3b5
refactor(cli): drop trivial oclif wrapper helpers
cv May 1, 2026
460173c
refactor(cli): centralize sandbox runtime bridge
cv May 1, 2026
31c0195
test(cli): keep dispatch table out of coverage ratchet
cv May 1, 2026
bad424d
refactor(cli): centralize policy and channels runtime bridge
cv May 1, 2026
5214142
refactor(cli): centralize global runtime bridge
cv May 1, 2026
5fca48f
refactor(cli): collapse runtime bridge exports
cv May 1, 2026
9616295
refactor(cli): introduce sandbox runtime action facade
cv May 1, 2026
c3a4906
refactor(cli): introduce policy and channels action facade
cv May 1, 2026
35288d8
refactor(cli): introduce global command action facade
cv May 1, 2026
06ef530
merge(main): resolve global action facade conflicts
cv May 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/lib/credentials-cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Args, Command, Flags } from "@oclif/core";

import { CLI_DISPLAY_NAME, CLI_NAME } from "./branding";
import { prompt as askPrompt } from "./credentials";
import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";
import { recoverNamedGatewayRuntime, runOpenshellProviderCommand } from "./global-cli-actions";
import { OPENSHELL_OPERATION_TIMEOUT_MS } from "./openshell-timeouts";

// Suffixes that mark per-sandbox messaging integrations in the gateway's
Expand Down Expand Up @@ -37,8 +37,7 @@ function printCredentialsUsage(log: (message?: string) => void = console.log): v
}

async function recoverGatewayOrExit(kind: "query" | "reach"): Promise<void> {
const runtime = getNemoClawRuntimeBridge();
const recovery = await runtime.recoverNamedGatewayRuntime();
const recovery = await recoverNamedGatewayRuntime();
if (recovery.recovered) return;

if (kind === "query") {
Expand Down Expand Up @@ -81,8 +80,7 @@ export class CredentialsListCommand extends Command {
await this.parse(CredentialsListCommand);
await recoverGatewayOrExit("query");

const runtime = getNemoClawRuntimeBridge();
const result = runtime.runOpenshell(["provider", "list", "--names"], {
const result = runOpenshellProviderCommand(["provider", "list", "--names"], {
ignoreError: true,
stdio: ["ignore", "pipe", "pipe"],
timeout: OPENSHELL_OPERATION_TIMEOUT_MS,
Expand Down Expand Up @@ -166,8 +164,7 @@ export class CredentialsResetCommand extends Command {

await recoverGatewayOrExit("reach");

const runtime = getNemoClawRuntimeBridge();
const result = runtime.runOpenshell(["provider", "delete", key], {
const result = runOpenshellProviderCommand(["provider", "delete", key], {
ignoreError: true,
stdio: ["ignore", "pipe", "pipe"],
timeout: OPENSHELL_OPERATION_TIMEOUT_MS,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/deploy-cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { Args, Command, Flags } from "@oclif/core";

import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";
import { runDeployAction } from "./global-cli-actions";

export default class DeployCliCommand extends Command {
static id = "deploy";
Expand All @@ -26,6 +26,6 @@ export default class DeployCliCommand extends Command {

public async run(): Promise<void> {
const { args } = await this.parse(DeployCliCommand);
await getNemoClawRuntimeBridge().deploy(args.instanceName);
await runDeployAction(args.instanceName);
}
}
58 changes: 58 additions & 0 deletions src/lib/global-cli-actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

/* v8 ignore start -- transitional action facade until implementations leave src/nemoclaw.ts. */

import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";

export async function runOnboardAction(args: string[] = []): Promise<void> {
await getNemoClawRuntimeBridge().onboard(args);
}

export async function runSetupAction(args: string[] = []): Promise<void> {
await getNemoClawRuntimeBridge().setup(args);
}

export async function runSetupSparkAction(args: string[] = []): Promise<void> {
await getNemoClawRuntimeBridge().setupSpark(args);
}

export async function runDeployAction(instanceName?: string): Promise<void> {
await getNemoClawRuntimeBridge().deploy(instanceName);
}

export function runBackupAllAction(): void {
getNemoClawRuntimeBridge().backupAll();
}

export async function runUpgradeSandboxesAction(args: string[] = []): Promise<void> {
await getNemoClawRuntimeBridge().upgradeSandboxes(args);
}

export async function runGarbageCollectImagesAction(args: string[] = []): Promise<void> {
await getNemoClawRuntimeBridge().garbageCollectImages(args);
}

export function showRootHelp(): void {
getNemoClawRuntimeBridge().help();
}

export function showVersion(): void {
getNemoClawRuntimeBridge().version();
}

export async function recoverNamedGatewayRuntime(): Promise<{ recovered: boolean }> {
return getNemoClawRuntimeBridge().recoverNamedGatewayRuntime();
}

export function runOpenshellProviderCommand(
args: string[],
opts?: {
env?: Record<string, string | undefined>;
ignoreError?: boolean;
stdio?: import("node:child_process").StdioOptions;
timeout?: number;
},
) {
return getNemoClawRuntimeBridge().runOpenshell(args, opts);
}
6 changes: 3 additions & 3 deletions src/lib/help-version-cli-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { Command } from "@oclif/core";

import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";
import { showRootHelp, showVersion } from "./global-cli-actions";

export class RootHelpCommand extends Command {
static id = "root:help";
Expand All @@ -15,7 +15,7 @@ export class RootHelpCommand extends Command {

public async run(): Promise<void> {
this.parsed = true;
getNemoClawRuntimeBridge().help();
showRootHelp();
}
}

Expand All @@ -27,6 +27,6 @@ export class VersionCommand extends Command {

public async run(): Promise<void> {
this.parsed = true;
getNemoClawRuntimeBridge().version();
showVersion();
}
}
12 changes: 8 additions & 4 deletions src/lib/maintenance-cli-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

import { Command, Flags } from "@oclif/core";

import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";
import {
runBackupAllAction,
runGarbageCollectImagesAction,
runUpgradeSandboxesAction,
} from "./global-cli-actions";

export class BackupAllCommand extends Command {
static id = "backup-all";
Expand All @@ -19,7 +23,7 @@ export class BackupAllCommand extends Command {

public async run(): Promise<void> {
await this.parse(BackupAllCommand);
getNemoClawRuntimeBridge().backupAll();
runBackupAllAction();
}
}

Expand All @@ -42,7 +46,7 @@ export class UpgradeSandboxesCommand extends Command {
if (flags.check) args.push("--check");
if (flags.auto) args.push("--auto");
if (flags.yes) args.push("--yes");
await getNemoClawRuntimeBridge().upgradeSandboxes(args);
await runUpgradeSandboxesAction(args);
}
}

Expand All @@ -65,6 +69,6 @@ export class GarbageCollectImagesCommand extends Command {
if (flags["dry-run"]) args.push("--dry-run");
if (flags.yes) args.push("--yes");
if (flags.force) args.push("--force");
await getNemoClawRuntimeBridge().garbageCollectImages(args);
await runGarbageCollectImagesAction(args);
}
}
8 changes: 4 additions & 4 deletions src/lib/onboard-cli-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { Command } from "@oclif/core";

import { getNemoClawRuntimeBridge } from "./nemoclaw-runtime-bridge";
import { runOnboardAction, runSetupAction, runSetupSparkAction } from "./global-cli-actions";

export class OnboardCliCommand extends Command {
static id = "onboard";
Expand All @@ -16,7 +16,7 @@ export class OnboardCliCommand extends Command {

public async run(): Promise<void> {
this.parsed = true;
await getNemoClawRuntimeBridge().onboard(this.argv);
await runOnboardAction(this.argv);
}
}

Expand All @@ -29,7 +29,7 @@ export class SetupCliCommand extends Command {

public async run(): Promise<void> {
this.parsed = true;
await getNemoClawRuntimeBridge().setup(this.argv);
await runSetupAction(this.argv);
}
}

Expand All @@ -42,6 +42,6 @@ export class SetupSparkCliCommand extends Command {

public async run(): Promise<void> {
this.parsed = true;
await getNemoClawRuntimeBridge().setupSpark(this.argv);
await runSetupSparkAction(this.argv);
}
}
Loading