diff --git a/src/lib/oclif-commands.ts b/src/lib/oclif-commands.ts index 8f41e580370..23132c9754b 100644 --- a/src/lib/oclif-commands.ts +++ b/src/lib/oclif-commands.ts @@ -18,6 +18,11 @@ import DeployCliCommand from "./deploy-cli-command"; import DestroyCliCommand from "./destroy-cli-command"; import GatewayTokenCliCommand from "./gateway-token-cli-command"; import ListCommand from "./list-command"; +import { + OnboardCliCommand, + SetupCliCommand, + SetupSparkCliCommand, +} from "./onboard-cli-commands"; import { BackupAllCommand, GarbageCollectImagesCommand, @@ -61,6 +66,7 @@ export default { debug: DebugCliCommand, deploy: DeployCliCommand, list: ListCommand, + onboard: OnboardCliCommand, "sandbox:channels:add": ChannelsAddCommand, "sandbox:channels:list": SandboxChannelsListCommand, "sandbox:channels:remove": ChannelsRemoveCommand, @@ -82,6 +88,8 @@ export default { "sandbox:snapshot:list": SnapshotListCommand, "sandbox:snapshot:restore": SnapshotRestoreCommand, "sandbox:status": SandboxStatusCommand, + setup: SetupCliCommand, + "setup-spark": SetupSparkCliCommand, share: ShareCommand, status: StatusCommand, start: DeprecatedStartCommand, diff --git a/src/lib/onboard-cli-commands.ts b/src/lib/onboard-cli-commands.ts new file mode 100644 index 00000000000..cb41524e9d3 --- /dev/null +++ b/src/lib/onboard-cli-commands.ts @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +/* v8 ignore start -- thin oclif adapters covered through CLI integration tests. */ + +import { Command } from "@oclif/core"; + +type RuntimeBridge = { + onboard: (args?: string[]) => Promise; + setup: (args?: string[]) => Promise; + setupSpark: (args?: string[]) => Promise; +}; + +function getRuntimeBridge(): RuntimeBridge { + return require("../nemoclaw") as RuntimeBridge; +} + +export class OnboardCliCommand extends Command { + static id = "onboard"; + static strict = false; + static summary = "Configure inference endpoint and credentials"; + static description = "Configure inference, credentials, and sandbox settings."; + static usage = ["onboard [flags]"]; + + public async run(): Promise { + this.parsed = true; + await getRuntimeBridge().onboard(this.argv); + } +} + +export class SetupCliCommand extends Command { + static id = "setup"; + static strict = false; + static summary = "Deprecated alias for nemoclaw onboard"; + static description = "Deprecated alias for onboard."; + static usage = ["setup [flags]"]; + + public async run(): Promise { + this.parsed = true; + await getRuntimeBridge().setup(this.argv); + } +} + +export class SetupSparkCliCommand extends Command { + static id = "setup-spark"; + static strict = false; + static summary = "Deprecated alias for nemoclaw onboard"; + static description = "Deprecated alias for onboard."; + static usage = ["setup-spark [flags]"]; + + public async run(): Promise { + this.parsed = true; + await getRuntimeBridge().setupSpark(this.argv); + } +} diff --git a/src/nemoclaw.ts b/src/nemoclaw.ts index fc699b8ac51..71e51773405 100644 --- a/src/nemoclaw.ts +++ b/src/nemoclaw.ts @@ -648,6 +648,7 @@ exports.captureOpenshell = captureOpenshell; exports.backupAll = backupAll; exports.deploy = deploy; exports.garbageCollectImages = garbageCollectImages; +exports.onboard = onboard; exports.recoverNamedGatewayRuntime = recoverNamedGatewayRuntime; exports.recoverRegistryEntries = recoverRegistryEntries; exports.runOpenshell = runOpenshell; @@ -666,6 +667,8 @@ exports.sandboxRebuild = sandboxRebuild; exports.sandboxSkillInstall = sandboxSkillInstall; exports.sandboxSnapshot = sandboxSnapshot; exports.sandboxStatus = sandboxStatus; +exports.setup = setup; +exports.setupSpark = setupSpark; exports.ensureLiveSandboxOrExit = ensureLiveSandboxOrExit; exports.G = G; exports.R = R; @@ -4778,13 +4781,13 @@ const mainPromise = (async () => { if (GLOBAL_COMMANDS.has(cmd)) { switch (cmd) { case "onboard": - await onboard(args); + await runOclif("onboard", args); break; case "setup": - await setup(args); + await runOclif("setup", args); break; case "setup-spark": - await setupSpark(args); + await runOclif("setup-spark", args); break; case "deploy": await runOclif("deploy", args);